Bootstrap

Linux 各种ip命令

设置网口IP地址

ifconfig eth0 192.168.1.1 netmask 255.255.255.0

增加网口的IP地址

ifconfig eth0:0 172.16.2.1 netmask 255.255.255.0 broadcast 172.16.2.255 up

ifconfig eth0:1 10.0.0.1 netmask 255.0.0.0 broadcast 10.255.255.255 up

ip address add 172.16.2.1/32 dev eth0 label eth0:0

ip address add 10.0.0.1/24 dev eth0

删除网口的IP

ifconfig eth0:1 down

ip address del ip/netmask dev eth0

清空指定网卡的所有IP

ip address flush dev eth0

;