孽小颜
centos下如何设置多IP
RT 本人新手 希望大家多多指导
kenduest
[quote]原帖由 [i]孽小颜[/i] 于 2008-5-28 18:51 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&pid=6598907&ptid=1007018][img]http://linux.chinaunix.net/bbs/images/common/back.gif[/img][/url]
RT 本人新手 希望大家多多指导 [/quote]
同 /etc/sysconfig/network-scripts/ifcfg-eth0,有點小修改就是。
/etc/sysconfig/network-scripts/ifcfg-eth0:0 :
[code]
DEVICE=eth0:0
IPADDR=192.168.1.100
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=static
[/code]
後續用 ifdown eth0 停用,以 ifup eth0 啟用即可。
若是要使用 command line 設定,語法為:
[code]ifconfig eth0:0 192.168.1.100 netmask 255.255.255.0[/code]
[code]ip addr add 192.168.1.100 dev eth0 brd + label eth0:0[/code]
==
--