tirsdag den 29. august 2017

Change from DHCP to a Static IP Address on Ubuntu Server


Very simple...

nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s31f6   # Do a ifconfig to see the network dev..
#iface enp0s31f6 inet dhcp  #you DO NOT want dhcp on a server!!!
iface enp0s31f6 inet static
address 192.168.x.xxx
netmask 255.255.255.x
network 192.168.x.x
broadcast 192.168.x.x
gateway 192.168.x.x
dns-nameservers 192.168.x.x

Source :
https://www.howtogeek.com/howto/ubuntu/change-ubuntu-server-from-dhcp-to-a-static-ip-address/