Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to use Ethernet + wifi in DHCP client mode
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Mon Mar 14, 2005 1:46 pm    Post subject: How to use Ethernet + wifi in DHCP client mode Reply with quote

Hi.

Might sound a dummy question but I have here a laptop with Wireless and an Ethernet card. Coldplug sucessfully starts the wireless and I get an IP automatically if there is a DHCP server behind. I'd like to use DHCP for both the wireless and wired interfaces. Till now everytime I had 2 NICs one of them had a fixed IP, usual for a server. Things are different with a laptop.

Out-of-the box my resolv.conf file gets overwritten when the last interface gets its IP from the DHCP server if both interfaces are active at the same time. Is there a way to have two distinct resolv.conf files, each would be used by its own interface?

There are cases when I must use the domain name that is received by the wireless adapter (at home). There are other cases when I must use the one received by the wired Ethernet. Both links might be active at the same time.

Thanks for any hint/link/suggestion.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Prompty
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 292

PostPosted: Mon Mar 14, 2005 2:36 pm    Post subject: Reply with quote

AFAIR option -R for dhcpcd
Code:
 dhcpcd -R IF_NAME

forbids dhcpcd from overwriting resolve.conf

look into your dhcp client man page for details. my case
Code:
 man dhcpcd



EDIT:
in your /etc/conf.d/net.IF_NAME you can find
Code:

# To stop DHCP from overwritting DNS (/etc/resolv.conf) use the below settings
# peer_dns="no"
# peer_dns_eth0="no"

# To stop DHCP from overwritting NIS (/etc/yp.conf) use the below settings
# peer_nis="no"
# peer_nis_eth0="no"

# To stop DHCP from overwritting NTP /etc/ntp.conf use the below settings
# peer_ntp="no"
# peer_ntp_eth0="no"


it's as easy as that :]
_________________
<input stupid message here>
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Mon Mar 14, 2005 9:00 pm    Post subject: Reply with quote

Thanks, Prompty. However I cannot just prevent one single eth to overwrite resolv.conf. Doing this would suppose one interface is always my main interface (i.e. the one that connects to, say, a private LAN with DNS, firewall, aso).

In some cases my main network is the wireless interface (e.g. at home). In some other cases, e.g. at work, I connect to the LAN using the Ethernet card and to a secondary network using the Wireless interface. Sometimes simultaneously.

If I prevent resolv.conf from being overwritten, say, each time I'm using the wireless, then I wouldn't be able to use my private LAN at home. The other way round is also true. Hence it's not that simple, I think.

I looked into dhcpcd man pages but didn't find any option that would allow me to append, for instance, instead of overwriting the file each time. But I guess this is a bit too complex an operation for DHCPCD.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum