Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a virtual box debian guest running on a mac 10.7.5 host. adapter 1 of the guest is bridged network to en1 the wifi. adapter 2 is ahost only adapter to vboxnet0

the guest's /etc/network/interfaces file is as follows;

auto lo
iface lo inet loopback

allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.1.6
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
broadcast 192.168.1.255

auto eth1
iface eth1 inet static
address 192.168.56.20
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255

the guest boots fine, however within a few hours probably more than 3 but less than 7 it drops 192.168.1.6 and replaces it with an address from a DHCP server on the network.

I can't think of any reason why it would do this. Can anyone suggest places to look?

Thanks.

share|improve this question
    
I'd say your machine has a DHCP client process running, which races with the "regular" (static) network setup. Please do ps ax|grep dhcp and comment there on where this finds something. –  kostix Feb 4 at 13:14
add comment

2 Answers 2

up vote 0 down vote accepted

Most likely, what happens is that at some point your wifi connection drops and, upon reconnection, the DHCP server cannot allow the old IP address to be assigned (to the same machine) because its time to live has not expired yet, and the number is taken.

If you want a work-around, use address reservation in your router GUI: this instructs the router to re-assign always the same IP address to a given MAC address, drawn from the DHCP Ip address range. This means that, when the wifi connection drops, your VM will be assigned the same address, because it is the same MAC address asking for it.

share|improve this answer
    
this is exactly what was happening. I happened to catch it in the process. I reserved the address on the router and all is sorted. –  mark Feb 5 at 9:52
add comment

NetworkManager is probably the culprit. Normally, the network manager should ignore interfaced taht are defined as static in interfaces. This seems to fail here.

If you don't need it for other interfaces but only have these two statically defined interfaces, you can disable NetworkManager completely.

share|improve this answer
add comment

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.