ubuntu16.0.4 设置固定ip地址和dns

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

1.设置ip地址

vi /etc/network/interface

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens32
iface ens32 inet static
address 192.168.2.83
netmask 255.255.255.0
gateway 192.168.2.1
 

2.设置dns

 vi /etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8
nameserver 8.8.4.4

3.刷新配置文件

resolvconf -u

4.重启网络服务

/etc/init.d/networking restart

 

 

转载于:https://my.oschina.net/jiaoyanli/blog/826022

你可能感兴趣的:(ubuntu16.0.4 设置固定ip地址和dns)