[root@node01 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 1e:00:cb:00:00:3e brd ff:ff:ff:ff:ff:ff inet 172.16.50.111/24 brd 172.16.50.255 scope global noprefixroute dynamic eth0 valid_lft 2608381sec preferred_lft 2608381sec inet6 fe80::1c00:cbff:fe00:3e/64 scope link valid_lft forever preferred_lft forever
添加IP命令
[root@node01 ~]# ifconfig eth0:0 172.16.50.190 netmask 255.255.255.0 up
在查看
[root@node01 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 1e:00:cb:00:00:3e brd ff:ff:ff:ff:ff:ff inet 172.16.50.111/24 brd 172.16.50.255 scope global noprefixroute dynamic eth0 valid_lft 2608282sec preferred_lft 2608282sec inet 172.16.50.190/24 brd 172.16.50.255 scope global secondary eth0:0 valid_lft forever preferred_lft forever inet6 fe80::1c00:cbff:fe00:3e/64 scope link valid_lft forever preferred_lft forever
删除命令
ifconfig eth0:0 down