Ubuntu 16.04.3 LTS dual NIC configuration requirements
- A dual NIC implements a static IP assignment, and another DHCP implementation
- Preparatory work:
[email protected]:~$ sudo su - #需要跳到root用户[sudo] password for wanghui:[email protected]:~# apt-get install openssh-server vim -y #安装sshd服务和vim编辑器[email protected]:~# /etc/init.d/ssh start #启动ssh服务[email protected]:~# ifconfig | awk ‘{print $1}‘ | grep ‘en‘ #查看网卡ens33 #这个是要DHCP的ens34 #这个是要static的
- Modifying the network card configuration file
[email protected]:~# vim /etc/network/interfaces #修改网卡配置文件auto loiface lo inet loopbackauto ens33iface ens33 inet dhcpauto ens34iface ens34 inet staticaddress 192.168.56.31netmask 255.255.255.0
- To modify the network management configuration file:
[email protected]:~# vim /etc/NetworkManager/NetworkManager.conf #修改网管文件,可以使得不重启就让修改的ip配置生效managed=true #把这个默认的false参数改成true,就能在重启网卡的时候刷新配置到系统
- Service restart
[email protected]:~# /etc/init.d/network-manager restart #重启网管[email protected]:~# /etc/init.d/networking restart #重新加载ip配置
- At this point, you can see the configured IP
[email protected]:~# hostname -I192.168.85.152 192.168.56.31
Ubuntu 16.04.3 LTS Dual NIC Configuration