Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Yet more resolv.conf problems
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
rickj
Guru
Guru


Joined: 06 Feb 2003
Posts: 427
Location: Calgary, Alberta, Canada

PostPosted: Fri Dec 19, 2008 7:56 pm    Post subject: Yet more resolv.conf problems Reply with quote

On a laptop I have two LAN interfaces, eth0 wired, eth1 wireless. Eth0 is sometimes on a local network with no DHCP, sometimes on a DHCP network, sometimes disconnected. It's configured to use DHCP by default, time out in ten seconds, then use a fixed fallback configuration. All this works fine.

The rot sets in when the wireless interface starts up. It always configures by DHCP. Regardless of whether it finds a network or not, it overwrites /etc/resolv.conf so that the DNS info for the first network is lost. If it does not connect, /etc/resolv.conf has nothing in it except comments. To add insult to injury, the working resolv.conf is not restored if eth1 is taken down.

Of course, I can stop this with the nodns option for eth1 (provided I use masked dhcpcd 4.0.7, stable version 4.0.2 seems to ignore this switch), but then I will never see an appropriate nameserver for eth1.

If both interfaces come up, each will generally have a nameserver, so that the appropriate behaviour is surely for the information from the second to be *appended* to resolv.conf. At a minimum, if the second interface does not connect, it should refrain from removing the DNS information which applies to an already-working interface. I'm at a loss as to how to obtain this behaviour.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Fri Dec 19, 2008 10:46 pm    Post subject: Reply with quote

Code:
# emerge openresolv
Back to top
View user's profile Send private message
rickj
Guru
Guru


Joined: 06 Feb 2003
Posts: 427
Location: Calgary, Alberta, Canada

PostPosted: Fri Dec 19, 2008 11:19 pm    Post subject: Reply with quote

Thanks cyrillic, after a bit of config-ing that seems to do at least some of the right things. I need to test it under different circumstances, and probably config a bit more as a result. I'll post results.

<EDIT> The more I test it, the better I like it. A handy utility that solves a real problem well.
Back to top
View user's profile Send private message
rickj
Guru
Guru


Joined: 06 Feb 2003
Posts: 427
Location: Calgary, Alberta, Canada

PostPosted: Sun Dec 21, 2008 8:14 pm    Post subject: Reply with quote

So I had it all working well, but I had to try gilding the lily so I set up bonding.

The bonded interfaces work for some functions, but the resolv.conf is very basic. Despite the fact that the two devices involved n the bond are the same as the ones used previously, their DNS info is not transmitted to resolv.conf. Is there any way to persuade bonding to send its device info to openresolv?
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sun Dec 21, 2008 9:55 pm    Post subject: Reply with quote

Is your DHCP client running on the bond or on the underlying interfaces ?
Back to top
View user's profile Send private message
rickj
Guru
Guru


Joined: 06 Feb 2003
Posts: 427
Location: Calgary, Alberta, Canada

PostPosted: Sun Dec 21, 2008 10:21 pm    Post subject: Reply with quote

It runs on the underlying interfaces. I tried, just now, to run it on bond0 and got:

Code:

# /etc/init.d/net.bond0 restart
 * Caching service dependencies ...                                       [ ok ]
 * Service net.bond0 stopping
No resolv.conf for interface bond0
 * Service net.bond0 stopped
 * Service net.bond0 starting
bond0: dhcpcd 4.0.7 starting
bond0: waiting for carrier
bond0: carrier acquired
bond0: broadcasting for a lease
bond0: offered 192.168.1.22 from 10.100.0.4
bond0: checking 192.168.1.22 is available on attached networks
bond0: acknowledged 192.168.1.22 from 10.100.0.4
bond0: leased 192.168.1.22 for 9054 seconds
bond0: add_route: Network is unreachable
SIOCADDRT: Network is unreachable                                         [ !! ]
 * Service net.bond0 started


and the network really was unreachable. Perhaps I'm just configuring it wrongly in /etc/conf.d/net. Any tips would be very welcome.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sun Dec 21, 2008 10:46 pm    Post subject: Reply with quote

I have not played around with the fancy stuff like bonding and bridging, so I can't really help you there.

I normally let all my network interfaces come up separately, and whichever one has a connection will be the one that is used.
Back to top
View user's profile Send private message
rickj
Guru
Guru


Joined: 06 Feb 2003
Posts: 427
Location: Calgary, Alberta, Canada

PostPosted: Sun Dec 21, 2008 10:54 pm    Post subject: Reply with quote

That's exactly the behaviour I'm seeking. I'd like to use the wired connection if available, and the wireless connection otherwise. Ideally, I'd do this automatically, even if I connect a wired connection where the wireless is able to connect to a network.

If your setup does this, how is it configured, please?
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sun Dec 21, 2008 11:29 pm    Post subject: Reply with quote

I have ifplugd installed and handling my wired interfaces, and openresolv handling DNS for multiple interfaces.

I did not need to configure anything, it just works. :)
Back to top
View user's profile Send private message
rickj
Guru
Guru


Joined: 06 Feb 2003
Posts: 427
Location: Calgary, Alberta, Canada

PostPosted: Mon Dec 22, 2008 12:10 am    Post subject: Reply with quote

Great!

I emerged ifplugd, deconfigured all the bonding stuff, and, as you say, it "just works"

It's a little strange that there is no trace of ifplugd in /etc/init.d or /etc/conf.d, but it now seems to be run automagically at boot time.

Many thanks for your kind help
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Mon Dec 22, 2008 4:12 am    Post subject: Reply with quote

Yeah, the Gentoo networking scripts have a lot more built-in functionality than most people realize.

Many thanks to the developers who set it up this way.
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