To set 8.8.8.8 as our name server, add "dns-nameservers 8.8.8.8" to the file.
And to set the static IP, modify the file "/etc/network/interface" as well.
# The primary network interfacechange dhcp to static, and add information you need.
auto ens33
iface ens33 inet dhcp
e.g.
# The primary network interface
auto ens33
iface ens33 inet static
address 192.168.20.103
netmask 255.255.255.0
gateway 192.168.20.1
Then "sudo systemctl restart networking.service" or "sudo /etc/init.d/networking restart" to make the modification effective.
沒有留言:
張貼留言