1.route命令
route –n
route add –net 192.168.2.0/24 dev eth0
route add –net 192.168.2.0 netmask 255.255.255.0 dev eth0
route add default gw 192.168.1.1 dev eth0
route del default gw 192.168.1.1
2.ifconfig命令
ifconfig eth0 192.168.1.1
ifconfig eth0:0 192.168.1.1/24
ifconfig eth0:1 192.168.1.1 netmask 255.255.255.0
ifconfig eth0:0 down
ifconfig eth0 up
3.ip命令
ip link show
ip –s link show
ip link set eth0 up
ip link set eth0 down
ip link set eth0 name vbird --需要先关闭网卡ip link set eth0 down
ip link set eth0 address aa:aa:aa:aa:aa:aa
ip addr show
ip addr add 192.168.50.50/24 dev eth0 label eth0:1
ip addr del 192.168.50.50/24 dev eth0
ip route show
ip route add 192.168.5.0/24 dev eth0
ip route add 192.168.10.0/24 via 192.168.5.100 dev eth0
ip route add default via 192.168.1.254 dev eth0
ip route del 192.168.10.0/24
ip route del default
ip neigh --查看邻居mac
ip neigh add 192.168.1.2 lladdr aa:bb:cc:dd:ee:ff dev eth0 nud permanent\
ip neigh del 192.168.1.2 dev eth0
ip neigh flush all
来源:oschina
链接:https://my.oschina.net/u/4392164/blog/3893460