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.

Hi have a Debian Squeeze box with eth0 and eth1.

In /etc/network/interfaces is:

auto eth1
iface eth1 inet static
 address 10.1.2.208
 netmask 255.255.255.0
 gateway 10.1.2.1

But every 24 hours, eth1 loses its statically-assigned IP address, and fetches one from DHCP instead! Manually doing:

# ifup eth1 && ifdown eth1

puts it back to how it should be.

But why does it spontaneously break in the first place?!

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Is dhcpcd/dhclient still running? It will refresh its DHCP address on the interface if you don't kill it.

Also, did you configure Network Manager? That'll override the interfaces file. Get rid of it if you're not using it.

share|improve this answer
3  
Change 'dhcpcd' to 'dhclient' above, and I'll mark this answer as correct. It seems that if you edit /etc/networking/interfaces so that eth1 is now 'static' instead of 'dhcp', then an 'ifdown eth1 && ifup eth1' won't kill the dhclient instance which ifupdown started initially. Kill it manually, and it stays away when you ifdown/ifup. –  David Bullock Dec 16 '11 at 15:25
2  
Exactly. It would have worked if you had run ifdown, THEN edited to change the method to static, THEN run ifup. In your case, ifdown had no idea that dhclient needed to be killed. –  MikeyB Dec 16 '11 at 22:05

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.