Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question
    
    
The user in the post you reference gets the error Failed to bring up wlan0. I don't get any output besides RTNETLINK answers: File exists. –  AlfaZulu Jun 3 at 13:23
    
yes and its the same reason why you get it. adding a route which is already in the table. simple test: disable your interface, enable your interface. first time dhclient run the message will not appear. just confirmed this locally on a debian system. –  Dennis Nolte Jun 3 at 13:29
    
This machine is an Amazon EC2 instance, I can't take down the interface for obvious reasons. I guess my question basically is, what is the right way to renew my DHCP leases given that I can't up/down my interfaces? –  AlfaZulu Jun 3 at 13:32
    
then this might answers your "new" question: askubuntu.com/questions/151958/… if thats not "enough you can remove the old lease within /var/lib/dhcp/dhclient.leases (might be slightly different location on EC2) dhclient -r –  Dennis Nolte Jun 3 at 13:40

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
Ah, I executed ip route and spotted the extra route it added. This all started because I wanted to renew DHCP client leases after having made changes to the DHCP server. The problem is I can't up/down my interfaces because the machine is an EC2 instance. Also, I want to avoid restarting the system. So how can I simply update my DHCP client leases without any unwanted side effects? –  AlfaZulu Jun 3 at 13:41
    
@AlfaZulu added some info which should help your issue. Basically even on a remote system you can up/down the interfaces if you "chain command" it, but its prone to fail if you cannot test it properly so do not do this :) –  Dennis Nolte Jun 3 at 13:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.