查看网卡及IP
ifconfig
ip link [show]
---------
ifconfig -a
ip addr show
激活和停止网络接口
ifconfig eth0 up/down
ip link set eth0 up/down
设置IP地址
ifconfig eth0 192.168.0.56 netmask 255.255.255.0 broadcast 192.168.0.255
ip addr add 192.168.0.193/24 dev wlan0
ip addr del 192.168.0.193/24 dev wlan0
查看网关路由
route -n
ip route show
设置网关(默认路由)
route add default gw 192.168.0.1
ip route add default via 192.168.0.1 (默认路由)
ip route del default