ip 命令

ip命令和ifconfig类似,但前者功能更强大,并旨在取代后者。使用ip命令,只需一个命令,你就能很轻松地执行一些网络管理任务。ifconfig是net-tools中已被废弃使用的一个命令,许多年前就已经没有维护了。iproute2套件里提供了许多增强功能的命令,ip命令即是其中之一。

net-tools       vs      iproute2
arp -na         |       ip neigh
ifconfig        |       ip link
ifconfig -a     |       ip addr show
ifconfig --help     |       ip help
ifconfig -s         |       ip -s link
ifconfig eth0 up    |       ip link set eth0 up
ipmaddr         |       ip maddr
iptunnel        |       ip tunnel
netstat         |       ss
netstat -i      |       ip -s link
netstat -g      |       ip maddr
netstat -r      |       ip route //可以查网关ip
route add       |       ip route add
route del       |       ip route del
route -n        |       ip route show
vconfig         |       ip link