环境
Ubuntu 16.04 LTS
配置步骤
1.修改 /etc/network/interfaces
auto enp4s0
iface enp4s0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
auto enp5s0
iface enp5s0 inet static
address 192.168.2.20
netmask 255.255.255.0 # 内网指定访问不需要设置网关
2.修改/etc/NetworkManage/NetworkManage.conf
[ifupdown]
managed=true
3.修改/etc/resolvconf/resolv.conf.d/base
nameserver 1.1.1.1
4.在桌面右上角删除,之前系统自动配置的连接
除了ifupdown相关的连接都删除
5.重启网络管理服务,重启网卡
/etc/init.d/network-manage restart
/etc/init.d/networking restart