Linux配置虚拟地址

立即生效:

[root@server ~]$ ifconfig eth0:0 192.168.1.101 broadcast 192.168.1.255 netmask 255.255.255.0 up
[root@server ~]$ route add -host 192.168.1.101 dev eth0:0

 

写入本地:

[root@server ~]$ cd /etc/sysconfig/network-scripts
[root@server network-scripts]$ vi ifcfg-eth0:0

DEVICE=eth0:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.101
NETMASK=255.255.255.0

[root@server network-scripts]$ ifconfig eth0:0 up/down

 

将配置写入本地后,可设置成开机自动就应用虚拟IP。

posted @ 2014-12-11 20:17  lichmama  阅读(632)  评论(0编辑  收藏  举报