Linux网络子接口配置
2017-12-19 本文已影响197人
一木之夏
方式一:临时方式(重启则失效):
添加网络子接口:
ifconfig eth0:1 10.1.77.87 netmask 255.255.255.0
除子接口:
ifconfig eth0:1 10.1.77.87 netmask 255.255.255.0 down
注:在/etc/rc.local中配置该命令可以每次重启PC时均执行次命令配置子网络
方式二:
修改配置文件,永久生效
方式一:临时方式(重启则失效):
添加网络子接口:
ifconfig eth0:1 10.1.77.87 netmask 255.255.255.0
除子接口:
ifconfig eth0:1 10.1.77.87 netmask 255.255.255.0 down
注:在/etc/rc.local中配置该命令可以每次重启PC时均执行次命令配置子网络
方式二:
修改配置文件,永久生效