默认情况下,Linode VPS 是采用DHCP(DHCP解释见维基百科http://zh.wikipedia.org/zh/DHCP)方式分配IP,如果你购买了新的IP是不生效的.你要指定静态地址才行.
由于我这里装的是centos 这里只说下centos 5.4 &Fedora 下面添加新的IP的设置方法吧.
首先VI 编辑File: /etc/sysconfig/network-scripts/ifcfg-eth0
# Configuration for eth0 DEVICE=eth0 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0 - This is the main IP address that will be used for most outbound connections. # The address, netmask and gateway are all necessary. IPADDR=12.34.56.78 (这里是你的第一个IP地址) NETMASK=255.255.255.0 (这里是子网掩码) GATEWAY=12.34.56.1 (网关)
添加第二个IP, File: /etc/sysconfig/network-scripts/ifcfg-eth0:0
# Configuration for eth0:0 DEVICE=eth0:0 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0:0 IPADDR=34.56.78.90 NETMASK=255.255.255.0 GATEWAY=12.34.56.1
添加第三个IP File: /etc/sysconfig/network-scripts/ifcfg-eth0:1
# Configuration for eth0:1 DEVICE=eth0:1 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0:1 - Private IPs have no gateway (they are not publicly routable) so all you need to # specify is the address and netmask. IPADDR=192.168.133.234 NETMASK=255.255.128.0 GATEWAY=12.34.56.1
当然这一切配置完之后,执行 service network restart即可.
burst.net VPS上也碰到这个问题,手工设置网络,出现错误。 最后提交ticket,很快就解决了。
[Reply]
mark
留作备用,谢谢久酷哈~
[Reply]
Linode的文档里有多ip的设置方法
其实也可以不用重启,在控制台用ifdown和ifup命令就可以
[Reply]
久酷
Reply:
January 2nd, 2010 at 15:59
@hamo, 他的文档我还没怎么研究,以后多研究研究 ^_^
[Reply]
Linux技术越来越强了,以后要多向你请教
[Reply]
久酷
Reply:
January 2nd, 2010 at 14:03
@Timothy, 还是菜鸟级别,菜菜啊……呵呵
[Reply]
我通常没有环境去折腾就不去折腾,哈
[Reply]
久酷
Reply:
January 2nd, 2010 at 13:49
@zwwooooo, 折腾起来也是比较费劲啊
[Reply]
“技术活”越来越到家了~
[Reply]
久酷
Reply:
January 2nd, 2010 at 13:49
@断峰狼, 比较折腾人哇
[Reply]
你技术又进步了,以后可能来和你同居,哈哈
[Reply]
久酷
Reply:
January 2nd, 2010 at 13:50
@Youwei, 来吧来吧,给你留着位置
[Reply]