Quantcast
Viewing all articles
Browse latest Browse all 18

Change Ubuntu Linux Server from DHCP to Static

Changing this setting without a GUI will require text editing.

Open up the /etc/network/interfaces file. I’m going to use nano, but you can choose a different editor

sudo nano /etc/network/interfaces

This is what you should see
auto eth0
iface eth0 inet dhcp

You need to change that to something like this.
auto eth0
iface eth0 inet static
address 192.168.1.7
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.2 8.8.8.8

You can remove the DHCP client
sudo apt-get remove dhcp-client


Viewing all articles
Browse latest Browse all 18

Trending Articles