Solaris 添加删除 虚拟网卡IP的方法

发布时间:2019-10-16编辑:脚本学堂
solaris 添加删除 虚拟网卡IP的方法,有需要的朋友可以参考下。

solaris 添加删除 虚拟网卡IP的方法,有需要的朋友可以参考下。

一、查看当前网卡IP配置
root@solaris # ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.0.3 netmask ffffff00 broadcast 192.168.0.255
groupname ipmp1
ether 0:14:4f:7a:2d:98

二、添加虚拟网卡IP
ifconfig ce0 addif 192.168.0.24 netmask 255.255.255.0
ifconfig ce0 addif 192.168.0.15 netmask 255.255.255.0

三、查看所有网卡IP配置
root@solaris # ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.0.3 netmask ffffff00 broadcast 192.168.0.255
groupname ipmp1
ether 0:14:4f:7a:2d:98
ce0:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 2
inet 192.168.0.24 netmask ffffff00 broadcast 192.168.0.255
ce0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.0.15 netmask ffffff00 broadcast 192.168.0.255

四、删除虚拟网卡IP
ifconfig ce0 removeif 192.168.0.24
ifconfig ce0 removeif 192.168.0.15

五、查看所有网卡IP配置
root@solaris # ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.0.3 netmask ffffff00 broadcast 192.168.0.255
groupname ipmp1
ether 0:14:4f:7a:2d:98