Unable to set static IP address in Ubuntu 14.04

29,271

Ok, I ditched Microsoft and change my household computers and laptops to Ubuntu 14.04.

After a week long searching the internet how to get a static ip-address on Ubuntu 14.04 I finally found a way.

It seems the network-manager is overwriting (or by-passing) my /etc/network/interfaces every single time, I thought of removing it but decided on trying to use it first.

Go to the right upper corner and click the network icon, go down to the bottom and right click edit connections.

This opens network connections and choose the connection to change, click edit and go to IPv4 settings. Choose Method: Manual and then fill in the Address, Netmask and Gateway and your desired DNS server.

Just save and your done. It will change to the given static IP-address on the fly even after reboot!!

This might be an old thread, but after a week of searching I updated the 10 first hits in Google. Hope to safe other people some time!!

Share:
29,271

Related videos on Youtube

Clutsicus
Author by

Clutsicus

Updated on September 18, 2022

Comments

  • Clutsicus
    Clutsicus over 1 year

    I've never had so much problems setting a network interface card to static addressing.

    I'm not sure what has changed, but I can only seem to get this thing to work if it's set to obtain the address via DHCP.

    I've tried multiple attempts to get this to work and referred to documentation on here as well as on other sites.

    Here is a copy of my /etc/network/interfaces file:

    # interfaces(5) file used by ifup(8) and ifdown(8)
    #       First SETUP Attempt
    # auto lo
    # iface lo inet loopback
    # iface lo inet interface
    # auto eth0
    # iface eth0 inet static
    # address 192.168.100.25
    # netmask 255.255.255.0
    # gateway 192.168.100.254
    # dns-nameservers 8.8.8.8 8.8.4.4
    #       Current Setup
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    # The loopback network interface
    auto lo
    iface lo inet loopback
    # The primary network interface
    auto eth0
    # Comment out
    #iface eth0 inet dhcp
    # add these lines
    iface eth0 inet static
    address 192.168.100.25 # define IP address
    network 192.168.100.0  # define network address
    netmask 255.255.255.0  # define subnet mask
    broadcast 192.168.100.255   # define broadcast address
    gateway 192.168.100.254     # define default gateway
    dns-nameservers 192.168.100.254   # define name server - Router/Gateway
    

    Restarting the networking services fails. I end up trying to reboot. At that point the network interface does not come back up

    If I force it back up with sudo ip link set eth0 up the interface comes up, but shows no addressing other than broadcast information. It does not connect to the internet.

    Help with this is greatly appreciated.

    • Louis Matthijssen
      Louis Matthijssen about 10 years
      Are you using Ubuntu or Ubuntu Server?
    • Clutsicus
      Clutsicus about 10 years
      Originally was Ubuntu Server 12.04, but upgraded as releases came out and then installed the Gnome 3 GUI from PPA repository when at 13.10. Upgraded to 14.04 only in the last 2 weeks.
    • Louis Matthijssen
      Louis Matthijssen about 10 years
      Shouldn't you use GNOME's network manager then?
    • Clutsicus
      Clutsicus about 10 years
      You woulld think that would work, but since installing Gnome, the network manager portion never worked. That's why trying to configure via command line at system level.
  • jmunsch
    jmunsch almost 10 years
    There are also some good answers here: askubuntu.com/questions/367553/cant-set-static-ip-on-ubuntu