39

I wanted to update the DHCP lease of an Amazon EC2 instance, so I executed the following command:

user@host:~$ sudo dhclient

Following that, the system's DHCP lease is updated successfully updated. However, the command prints the following to the console:

RTNETLINK answers: File exists

What on earth does that mean? Is it a cause for concern?

For what it's worth, dhclient returned without any errors:

user@host:~$ echo $?
0
AlfaZulu
  • 607

3 Answers3

31

Basically what happens is that dhclient adds a route to the routing table.

It tries this while the route is already in the table.

Check

ip route

for a route which was added by the dhcp server.

For having the lease renewed do

dhclient -r

if thats not enough you can remove all leases by removing the file and getting a new lease

sudo rm /var/lib/dhcp/dhclient.leases; sudo dhclient eth0

Depending on your exact setup this might be an issue with having to type your password twice, so watch out for that.

Dennis Nolte
  • 2,966
1

See I saw a lot of answers none of them see to work .. But here is how it can be done. See the router looks at the MAC address and assigns the same IP address every time. ...To change MAC address of the Wireless adapter ==> sudo ifconfig wlan0 down ==> sudo macchanger -r wlan0 ==> sudo ifconfig wlan0 up ==> dhclient -r wlan0 ==> dhclient -v wlan0

Aditya Nag
  • 11
  • 2
0

Wow thank you that worked.

My LAN changed and it messed up some Ubuntu servers I have they would not get a IP.

It changed like this:

192.168.82.xx not 192.168.86.xx

I did the "dhclient -r" and then that got it so I could do a dhclient on the Ethernet then. Before that it would give me a "TRNETLINK answers: File exists"

Then I looked at the /var/lib/dhcp/dhclient.leases and it had the 82 not 86 in it. rm it worked.

Thank you.

I guess Ubuntu should fix this is the 3rd number in the IP changes it can't get a IP.

-Raymond Day