Ubuntu 14.04 Server Install Unable to Connect to Network via Ethernet

6,056

If:

em1 = ethernet
192.168.1.254 = IP address of router
192.168.0.120 = IP address of server

Test this /etc/network/interfaces file:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto em1
iface em1 inet static
address 192.168.1.120
gateway 192.168.1.254
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
Share:
6,056
atavel
Author by

atavel

Beginning Sysadmin. Formerly IT at Wikimedia. Currently freelance.

Updated on September 18, 2022

Comments

  • atavel
    atavel over 1 year

    I have tried so much and cannot seem to configure the ethernet network properly. I've looked at past questions that have similar issues but none of them resolved my issues. Note that my ethernet interface logical name is em1 (as opposed to eth0 or eth1). My guess is that my error is either in configuration of the /etc/network/interfaces file or in the fact that there is no /etc/resolvconfig file and I have even tried to add manually as root but it will not save the changes.

    Sorry for the picture situation- I am a new user and don't have any reputation (but there are links)

    I have provided as much detail as possible below:

    1. Upon boot, it stops on "Waiting for network configuration" for about 4 minutes.

    2. See current configurations below:

    ifconfig -a

    sudo lshw -class network

    sudo ethtool em1 pic (can't provide pic because of reputation)

    but Link Detected: yes

    ip route

    192.168.1.0/24 dev em1 proto kernel scope link src 192.168.1.216
    
    1. I did a temporary IP assignment with:

      sudo ifconfig em1 192.168.1.216 netmask 255.255.255.0

      note that address is the network IPv4 address

    2. And configured the default gateway with:

      sudo route add default gw 192.168.1.254 em1

      IP address is the one on the ISP router

    3. My current /etc/network/interfaces file is as follows:

    auto lo iface lo inet loopback

    auto em1 iface em1 inet static

    address 192.168.0.120 #(this is the IP address of server)
    netmask 255.255.255.0 gateway 192.168.0.1 #(gateway address of server)
    dns-nameserver 8.8.8.8 192.168.1.254 #(IP address of router)

    1. One factor that I think is playing a big role is that there is no /etc/resov.conf file. There is a resolvconf directory and in it is:

      /resolvconf/interface-order I can't post more pics (because reputation) but em is about 8 places down. Should em be higher in the order?

    There are also these files in the resolvconf directory:

    /resolvconf/resolv.conf.d/base
    /resolvconf/resolv.conf.d/head
    /resolvconf/update.d/dnscache
    /resolvconf/update.d/libc
    
    1. I can now ping 8.8.8.8 (couldn't when I started writing out this question)

    Any ideas greatly appreciated. This is my first server Ubuntu server build.

    • Anders F. U. Kiær
      Anders F. U. Kiær over 9 years
      'sudo apt-get update' not "... install update"
  • atavel
    atavel over 9 years
    I updated /etc/network/interfaces file. I can ping my router and external machines using it's IP address and DNS name, but still cannot install packages ect.