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.

share|improve this question
1  
Hi & Welcome to AU. I'm actually lost when you say Windows & Ubuntu on a separate partition. Because either it has to be a dual boot which will run separately or else it has to be a VM (virtual machine). Can you please elaborate on how both of these OS operates and configured?? :) – AzkerM May 21 '14 at 17:52
1  
You WILL have problems with two simultaneously connected machines with the same MAC address, but not if they are running at different times. So your problem is probably in some other place, if I understand well (and even if you have the server in a VM, the VM will solve the MAC problem for you; each VM has its own unique MAC). – Rmano May 21 '14 at 18:08
    
See help.ubuntu.com/14.04/serverguide/network-configuration.html . The router doesn't see two computers ; it sees the same interface card (NIC) no matter which is running. – belacqua May 21 '14 at 19:24

I found I had to include the dns settings:

auto lo enp0s25
iface lo inet loopback
iface enp0s25 inet static
    address 192.168.1.128
    netmask 255.255.255.0
    gateway 8.8.8.8.7
    dns-search example.com
    dns-nameservers 8.8.8.8 8.8.4.4

See https://help.ubuntu.com/lts/serverguide/network-configuration.html

share|improve this answer
    
you missing gateway – Pavel Niedoba yesterday
    
yes, thanks @Pavel Niedoba, now that I look more closely on my server, I'm not sure how I missed that. Fixed. – Roger 11 hours ago

Set your IP address changes in /etc/network/interfaces. Example:

auto eth0
iface eth0 inet static

address 192.168.1.128
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Don't give your DNS configurations in /etc/resolv.conf because while we restart the server sometimes the configuration get erased.

So use vim /etc/resolvconf/resolv.conf.d/base (while updating configs in this it doesn't get removed)

example:

search  (domain name)
nameserver 8.8.8.8
nameserver 8.8.4.4

Save and then restart your server, this fixed my static issue! :)

share|improve this answer
3  
Bare in mind that your device name can be other than eth0. Mine are enp1s7 and enp2s15. I have 2 LAN card. – Vladimir Vukanac May 5 '16 at 21:40

I'm not sure if this will solve you problem but this answers you question and I think its 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 you 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 you 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.

share|improve this answer
    
@dan08- I believe dns-nameservers is also needed here. I suggest you edit your answer. – chili555 May 22 '14 at 14:47
21  
Restart eth0 with sudo ifdown eth0 && sudo ifup eth0 instead of the last command. – Kenny Evitt Jan 27 '15 at 4:45
    
In my env gateway ended with .254, not sure if this applies for everyone. Other than that this answer works for 14.14 – mau May 9 '15 at 15:59
1  
Does not work by me, I still got DHCP IP. Sadly it is coming from a hybrid modem + router device, which does not have to feature to set static IP by MAC address. :S I might need to buy a router. :S According to ifdown eth0 the interface is not configured. – inf3rno Feb 28 '16 at 16:57
    
but now the network would start automatically – Allan Ruin Aug 10 '16 at 16:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.