1、打开和关闭
ifconfig eth0 up
ifconfig eth0 down
2、配置ip、子网掩码、网关
ifconfig eth0 172.18.31.98 netmask 255.255.255.0
route del default eth0
route add default gw 172.18.1.1 dev eth0
3、临时修改mac
ifconfig eth0 down
ifconfig eth0 hw ether 00:0C:18:EF:FF:ED
ifconfig eth0 up
[网络配置相关]——ifconfig命令、ip命令、route命令
https://www.cnblogs.com/snsdzjlz320/p/5616775.html