Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Ubuntu Server keeps overriding static IP.

  1. #1
    Join Date
    Feb 2007
    Location
    Slovenia
    Beans
    251
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Question Ubuntu Server keeps overriding static IP.

    My ISP offers me a static IP and 2 dynamic IPs. I want to use the static one.
    When I run
    Code:
    /etc/init.d/newtorkings restart
    the static IP will be used.
    But the next morning (not every morning though) my IP will be the dynamic one again. Something seems to be overriding it. The last time it changed was today at around 8:30 AM.

    Why does it keep doing that?
    Last edited by unimatrix; January 27th, 2010 at 03:39 PM.

  2. #2
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,868
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Ubuntu Server keeps overriding static IP.

    What type of isp connection do you have?

    What type of hardware is between isp and server?

    Please post your /etc/networking/interfaces file.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  3. #3
    Join Date
    Feb 2007
    Location
    Slovenia
    Beans
    251
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Ubuntu Server keeps overriding static IP.

    Quote Originally Posted by volkswagner View Post
    What type of isp connection do you have?

    What type of hardware is between isp and server?

    Please post your /etc/networking/interfaces file.
    It's a FTTH connection, established via DHCP (unless of course you set your own static IP). Between my ISP and the server there is a FTTH-to-Ethernet switch (the server then acts as a router).

    Here is the content of my /etc/network/interfaces:
    Code:
    # 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
    #auto lo eth0 eth1
    
    iface lo inet loopback
    
    # The primary network interface
    auto eth1
    iface eth1 inet static
    	address 192.168.2.1
    	netmask 255.255.255.0
    	broadcast 192.168.2.255
    	network 192.168.2.0
    
    auto eth0
    iface eth0 inet static
    	address ***.***.***.***
    	netmask 255.255.0.0
    	broadcast 93.103.0.255
    	network 93.103.0.0
    	gateway 93.103.0.1
    	post-up iptables-restore < /etc/iptables.up.rules
    (Forgive me for censoring out my static IP)
    Last edited by unimatrix; January 27th, 2010 at 04:56 PM.

  4. #4
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Ubuntu Server keeps overriding static IP.

    Maybe you're still running a dhcp client. Check the output of,

    ps afx

    to see if dhclient or dhcpd or similar named daemon is running. That's the only reason I can think off hand that the IP would get updated. You'll want to kill any such program.

  5. #5
    Join Date
    Feb 2007
    Location
    Slovenia
    Beans
    251
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Ubuntu Server keeps overriding static IP.

    Quote Originally Posted by BkkBonaza View Post
    Maybe you're still running a dhcp client. Check the output of,

    ps afx

    to see if dhclient or dhcpd or similar named daemon is running. That's the only reason I can think off hand that the IP would get updated. You'll want to kill any such program.
    Code:
    4378 ?        Ss     0:36 /usr/sbin/dhcpd3 -q -pf /var/run/dhcp3-server/dhcpd.pid -cf /etc/dhcp3/dhcpd.conf eth1
    This is the only dhcp-related thing running (the DHCP server for my internal network on eth1 - the external is on eth0).

  6. #6
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Ubuntu Server keeps overriding static IP.

    Doesn't sound like that's the problem then. What do you see in your logs around the time that you think the IP change occurs? It may give a hint as to what's happening. I think both syslog and messages could have something. Maybe also make sure there isn't a cron job or cron.daily set that may be doing something.

  7. #7
    Join Date
    Feb 2007
    Location
    Slovenia
    Beans
    251
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Ubuntu Server keeps overriding static IP.

    OK it took a while to find, but this seems to be it from syslog:

    Jan 27 07:12:53 bojler dhclient: DHCPREQUEST of <null address> on eth0 to 255.255.255.255 port 67
    Jan 27 07:13:35 bojler last message repeated 3 times
    Jan 27 07:14:34 bojler last message repeated 3 times
    Jan 27 07:14:48 bojler dhclient: DHCPREQUEST of <null address> on eth0 to 255.255.255.255 port 67
    Jan 27 07:14:58 bojler dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
    Jan 27 07:14:58 bojler dhclient: DHCPOFFER of ***.***.***.*** from 89.212.0.1
    Jan 27 07:14:58 bojler dhclient: DHCPREQUEST of ***.***.***.*** on eth0 to 255.255.255.255 port 67
    Jan 27 07:14:59 bojler dhclient: DHCPACK of ***.***.***.*** from 89.212.0.1
    Jan 27 07:14:59 bojler dhclient: bound to ***.***.***.*** -- renewal in 42309 seconds.
    ***.***.***.*** is, obviously, my dynamic IP.


    Also this is what I have in /etc/cron.daily:
    Code:
    apache2  apt  apt-get  aptitude  bsdmainutils  chkrootkit  exim4-base  find  find.notslocate.dpkg-new  logrotate  man-db  mlocate  rkhunter  samba  slocate  standard  sysklogd  tomcat55
    EDIT: Didn't find anything relevant in /var/log/messages.
    Last edited by unimatrix; February 2nd, 2010 at 12:33 PM. Reason: Censored the IP

  8. #8
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Ubuntu Server keeps overriding static IP.

    It seems that dhclient must be running or gets started by something. Are you still running network-manager or wicd? These typically will mess up manual changes to the interfaces file because they use their own config to determine what they do, and then they update interfaces sometimes (usually during a boot).

    If either of these is installed I would remove them or at least try to alter their config to not interfere, if you need it for wifi.

  9. #9
    Join Date
    Feb 2007
    Location
    Slovenia
    Beans
    251
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Ubuntu Server keeps overriding static IP.

    Nope, neither of those are running (I did not install X).

  10. #10
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Ubuntu Server keeps overriding static IP.

    Is it possible those dhclient log entries are just left overs from previous config that has been fixed now? Maybe this problem has already been fixed. You could try a reboot and make sure that nothing shows up trying to do a dhcp request as whatever is doing it is likely to try during the boot.

    Other than that I'm out of ideas, for now.

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •