虽说net-tools工具箱要被iproute2取代,但是连net-tools工具都不会,也说不过去吧。
net-tools工具箱包括arp, hostname, ifconfig, netstat, rarp, route, plipconfig, slattach, mii-tool and iptunnel and ipmaddr等命令。
参考:
https://www.cnblogs.com/wonux/p/6268134.html
一、ifconfig
1. ifconfig:查看已启用的网卡信息
2. ifconfig -a:查看所有网卡信息(包括未激活的),这个a表示all:display all interfaces which are currently available, even if down。
3. ifconfig eth0:查看单个网卡信息(后面表示单个网口名都用eth0表示)
4. ifconfig eth0 up/down:激活/关闭某个端口
5. ifconfig eth0 192.168.1.2/24 ifconfig eth0 192.168.1.2 255.255.255.0 :设置网卡IP地址
6. ifconfig eth0 hw ether 00:11:22:33:44:55:设置网卡MAC地址
7. ifconfig eth0 0:删除网卡IP地址
8. ifconfig -s:short,显示网卡简短的信息