一:命令行方式添加与删除
1. 在网卡1上添加一个虚IP
ifconfig eth0:1 192.168.100.10 netmask 255.255.255.0
删除刚才添加的虚IP
删除刚才添加的虚IP
ip addr del 192.168.100.10/24 dev eth0 注意这里一定要加掩码,否则会弹出一个警告,如下:
“Warning: Executing wildcard deletion to stay compatible with old scripts.
Explicitly specify the prefix length (192.168.100.10/32) to avoid this warning.
This special behaviour is likely to disappear in further releases,
fix your scripts!”
Explicitly specify the prefix length (192.168.100.10/32) to avoid this warning.
This special behaviour is likely to disappear in further releases,
fix your scripts!”
该警告的大意就是说,你应该明确你要删除的IP的通配符长度,也就是掩码长度