how to use dhcp *only* for IP address?

Asked by mc5686

I need to use DHCP (dhclient) to get my current IP address from my ISP, but I do not want dhclient to change *any* other setting (default gateway, name servers, ...) since I'm using this interface in a bridge.

I have the following in my /etc/network/interfaces:

auto eth2 tap2 br2
iface eth2 inet manual
iface tap2 inet manual
    up ifconfig $IFACE 0.0.0.0 up
    down ifconfig $IFACE down
    tunctl_user mauro
iface br2 inet manual
    bridge_ports eth2 tap2
    bridge_maxwait 0

This is to allow access to the physical eth2 from tap2 (used in a virtualBox virtual machine).
At bootup everything seems ok, but when the virtual machine tries to get *its* ip via dhcp apparently a dhcp request is triggered also in the host, so the dhcp server hands out *two* addresses: one (as requested) for the virtual machine and one (useless to me) for the host eth2.
This is a bit annoying but not a real problem.
The real problem is that a complete dhcp reconfigure is done *on the host* and it changes my default route (pointing to the host on the "other side" of eth2) and my dns (overwriting /etc/resolv.conf).
I can undo the reconfiguration (on the host) manually and all is well... for a while. After that a new reconfiguration (lease reload?) is done and I have to re-configure my host.
What can I do (short of a cron job...)?

Any hint welcome.

TiA
Mauro

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu dhcp3 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

I think you can play with the /etc/dhcp3/dhclient.conf settings...

The terminal command man dhclient.conf and Google are your friends

Hope this helps

Can you help with this problem?

Provide an answer of your own, or ask mc5686 for more information if necessary.

To post a message you must log in.