Set a static IP address under Ubuntu16.0.4

 1, first check the card name: I was ens33

ifconfig

2, modify the network card configuration file

sudo  vi /etc/network/interfaces

 Add the following:

auto ens33  
iface ens33 inet static  
address 192.168.0.23
netmask 255.255.255.0
gateway 192.168.0.1   

3, modify the DNS

sudo gedit /etc/resolve.conf

 Add the following:

nameserver 8.8.8.8

4. Restart

sudo /etc/init.d/networking restart

 

Published 130 original articles · won praise 379 · views 470 000 +

Guess you like

Origin blog.csdn.net/qq_31122833/article/details/103736488