Recently in class, many students reported that when setting up the environment, the virtual machine IP often changes, so the web services we configured may not be available. Let's talk about how to set static ip on ubuntu
I am here ubuntu16.04
vim /etc/network/interfaces
**# Add the following **
**auto ens33iface ens33 inet staticaddress 192.168.1.131 #The gateway must be consistent with the host netmask 255.255.255.0gateway 192.168.1.1 #The gateway must be consistent with the host **dns-nameserver 8.8.8.8 #dns information must be configured
# Configure dns information
sudo vi /etc/systemd/resolved.conf
Recommended Posts