Results 1 to 4 of 4

Thread: Ubuntu wont keep Static IP on restart

  1. #1
    Join Date
    Mar 2009
    Beans
    38

    Ubuntu wont keep Static IP on restart

    Hey guys,
    I assigned my computer a static IP and 2 DNS servers for it to use.
    Everything works perfectly except when I reset the computer it reverts back to the Automatic DHCP settings but it does keep the 2 DNS servers.

    I followed the instructions to add the 2 DNS servers in the resolv.conf file and that worked perfectly. Unfortunately I cant figure out how to make the IP address save.

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Jan 2007
    Beans
    5,549

    Re: Ubuntu wont keep Static IP on restart

    try inserting the static ips to your /etc/network/interfaces file

    for reference : http://www.prash-babu.com/2008/11/ho...-in-linux.html

  3. #3
    Join Date
    Mar 2009
    Beans
    38

    Re: Ubuntu wont keep Static IP on restart

    Thanks for the link.
    I followed the instructions but ran into two problem:

    He says to type sudo gedit /etc/network/interfaces
    and to find this line in the document:

    iface eth0 inet dhcp

    In my document I don't have that line instead mine reads:

    auto lo
    iface lo inet loopback


    So I replace the iface part anyway with my IP address, netmask, and gateway.

    But I figure none of that did anything because when I type in the following instructions this is what I get:
    Code:
    chris@otacon:~$ sudo /etc/init.d/networking restart
     * Reconfiguring network interfaces...                                          SIOCDELRT: No such process
                                                                             [ OK ]
    chris@otacon:~$ sudo ifdown eth0
    ifdown: interface eth0 not configured
    chris@otacon:~$ sudo ifup eth0
    chris@otacon:~$
    Once I restart the connection it still has its default IP address and not the static one I assigned.

  4. #4
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Beans
    11

    Re: Ubuntu wont keep Static IP on restart

    Hi, bruceleeroy.
    It doesn't seem your "interfaces" file has lines that configure eth0(your ethernet network interface card). Mine looks like below:

    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.1.2
    netmask 255.255.255.0
    gateway 192.168.1.1

    Just copy & paste these lines to your "interfaces" file and change the values for "address", "netmask", and "gateway" as you like. Then sudo ifdown eth0 && sudo ifup eth0. It will work.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •