Ubuntu – Assigning a static IP to Ubuntu Server 14.04 LTS

dhcpnetworkingserver

I've installed Ubuntu 14.04 LTS Server in my machine on a separate hard drive alonside my Windows 7 installation. The Windows OS has full network connectivity and internet access through the Ethernet, but the Ubuntu installation does not.

I have a hunch that this could be because my router which sees 2 different computers with the same MAC address, and the DHCP is not working. How do I assign the machine a common static IP so that both partitions can use my network? I am new to Ubuntu and I couldn't figure out which file to edit so that I can assign the static IP.

Best Answer

I'm not sure if this will solve your problem, but this answers your question and I think it's worth a shot.

To assign a static IP, you need to edit /etc/network/interfaces.

The interface will probably be called eth0.

The current entry will look something like:

auto eth0
iface eth0 inet dhcp

You will need to change this to:

auto eth0
iface eth0 inet static
   address 10.253.0.50
   netmask 255.255.255.0
   network 10.253.0.0
   gateway 10.253.0.1
   dns-nameservers 8.8.8.8

You will have to change the numbers around depending on your network, but you can find out the information by checking out ipconfig from Windows.

Make sure you choose an address outside the address space of the DHCP server.

Then restart networking sudo service networking restart. If that gives you trouble, reboot the machine.

Related Question