1

My Dell precision M4800, running Ubuntu 14.04 LTS, periodically changes its IP address. It looks like the DHCP lease expires and for some reason it gets a new IP adress instead of renewing the old lease.

Possibly relevant output from syslog:

Jan 25 12:14:19 pc-1838 NetworkManager[1360]: <info> (eth0): DHCPv4 state changed reboot -> expire
Jan 25 12:14:14 pc-1838 dhclient: message repeated 781 times: [ DHCPREQUEST of 192.168.1.63 on eth0 to 255.255.255.255 port 67 (xid=0x79a31c7e)]
Jan 25 12:14:19 pc-1838 dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x648ffe4b)
Jan 25 12:14:19 pc-1838 NetworkManager[1360]: <info> (eth0): DHCPv4 state changed expire -> preinit
Jan 25 12:14:22 pc-1838 dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6 (xid=0x648ffe4b)
Jan 25 12:14:28 pc-1838 dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12 (xid=0x648ffe4b)
Jan 25 12:14:40 pc-1838 dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14 (xid=0x648ffe4b)
Jan 25 12:14:54 pc-1838 dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11 (xid=0x648ffe4b)
Jan 25 12:14:57 pc-1838 dhclient: DHCPREQUEST of 192.168.1.71 on eth0 to 255.255.255.255 port 67 (xid=0x4bfe8f64)
Jan 25 12:14:57 pc-1838 dhclient: DHCPOFFER of 192.168.1.71 from 192.168.1.1
Jan 25 12:14:57 pc-1838 dhclient: DHCPACK of 192.168.1.71 from 192.168.1.1
Jan 25 12:14:57 pc-1838 dhclient: bound to 192.168.1.71 -- renewal in 35252 seconds.

Searches with google, here, and elsewhere have been fruitless.

This behavior is annoying because I often have long-running ssh connections to this machine that of course break with no warning when the IP changes.

Maybe its a misconfiguration with dhclient or Network Manager? But what's the setting? (And why would there even be a setting for this? Who would want this behavior?)

FWIW, this never happens to my other Linux box (which runs Sabayon). So it seems like I should be able to get my Ubuntu box to stop this.

4
  • If your router is your DHCP server, you may want to check its options. It's probably set to assign new IPs every renew. Jan 25, 2016 at 17:59
  • OK, does it actually change you IP ? check every so often with ip addr Jan 25, 2016 at 18:03
  • @Zacharee1 Good thought. I checked and there aren't any relevant options (it's a Verizon router). Also, it doesn't happen to my other Linux box.
    – Chris
    Jan 25, 2016 at 18:05
  • @Serg Yes, it does. For example, in the log I posted above, it had address 192.168.1.63 but then changes it to 192.168.1.71.
    – Chris
    Jan 25, 2016 at 18:06

1 Answer 1

0

If you open up "Edit Connections" on the Networking menu (on the toolbar upper right) and choose the connection in question (eth0) then Edit you will see a pop up that lets you choose "Manual"

enter image description here

You may need to reserve the address on your router, assuming you are using a typical home router? You don't say so I am assuming that. In a typical setup your best bet is to choose a high address like x.x.x.240 so there won't be a conflict with other devices (you don't have 250 devices connected do you?). If you do that you likely won't have to reserve an address on the router.

Then enter settings like this: enter image description here


EDIT 2: Based on a comment, the OP needs to have a DHCP config using eth0 at work. It's possible to create a second config, say eth_work, that uses DHCP, and modify eth0 as above, then just choose the one you need based on location/environment.


EDIT I see in a comment you have a Verizon router -- so of course, not sure if it's relevant, we are talking about your LAN ip addresses. The WAN address can change from time to time (router restart or other times) unless you pay them for a fixed IP address. You probably know that, just added to round out the answer for others who may read it

6
  • That assumes your netmask is 255.255.255.0 which is will be for virtually ALL home networking setups
    – JimLohse
    Jan 25, 2016 at 18:15
  • 1
    You can obtain your netmask, local ip, gateway, and DNS by clicking on the network-manager icon and selecting "Connection Information" before you begin. Additionally, you must reconnect/refresh your connection or restart network manager using the command: sudo service network-manager restart to apply these changes.
    – mchid
    Jan 25, 2016 at 18:18
  • Thanks. Unfortunately, I need it to use dhcp because I use it at work, also.
    – Chris
    Jan 25, 2016 at 18:27
  • 1
    Updated answer to reflect this requirement ... @Chris You can have two configurations, call the second one eth_work or some such. Just choose based on where you are. Otherwise, as noted, there should be a way to map your MAC address to the fixed IP you want, it's probably buried somewhere in those router settings :) Let us know what works for you please
    – JimLohse
    Jan 25, 2016 at 18:29
  • 1
    @Chris Where is says Connection name "wired connection 1", you can change it to "wired connection 2" or like jim said "eth_work" or "eth_home".
    – mchid
    Jan 25, 2016 at 18:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .