You are not logged in.

#1 2008-12-25 10:37:21

Miles28
Member
From: Spain
Registered: 2008-08-31
Posts: 88

resolv.conf and two ways for internet access

Hi.

I use two ways to connect to internet with my laptop. At home by ethernet cable. At weekends, I can use a mobile as a modem to connect via wvdial.

What's the problem. Everytime I use wvdial i have to overwrite by hand resolv.conf for adding its own dns because it doesn't do it automatically, and comment eth0="dhcp" and INTERFACES=(eth0) at /etc/rc.conf for adding its own dns because it doesn't do it automatically. I've red that wvdial writes its dns on /etc/ppp/resolv.conf.

So, what I need is to get wvdial to write dns on /etc/resolv.conf or any other way to get both ways to connect without writing dns by hand. I am pretty there is an easy way to get a solution.

Thanks in advance.


Inteligencia militar son términos contradictorios (G. Marx).

Offline

#2 2008-12-25 11:06:14

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: resolv.conf and two ways for internet access

Both your connections use the same device name [eth0]? someone may jump in with a solution I am sure its possible...


Mr Green

Offline

#3 2008-12-25 11:28:13

string
Member
Registered: 2008-11-03
Posts: 286

Re: resolv.conf and two ways for internet access

I'm just thinking out loud here but couldn't you make /etc/ppp/resolv.conf a symlink to /etc/resolv.conf? (Caution: you should investigate and make sure this isn't a -stupid- thing to do)

Offline

#4 2008-12-25 12:49:05

Miles28
Member
From: Spain
Registered: 2008-08-31
Posts: 88

Re: resolv.conf and two ways for internet access

Mr Green wrote:

Both your connections use the same device name [eth0]? someone may jump in with a solution I am sure its possible...

No, cable conection use eth interface. Wvdial use ppp.


Inteligencia militar son términos contradictorios (G. Marx).

Offline

#5 2008-12-25 12:52:37

Miles28
Member
From: Spain
Registered: 2008-08-31
Posts: 88

Re: resolv.conf and two ways for internet access

string wrote:

I'm just thinking out loud here but couldn't you make /etc/ppp/resolv.conf a symlink to /etc/resolv.conf? (Caution: you should investigate and make sure this isn't a -stupid- thing to do)

I tried before opening this string. When making a symlink, everytime i connect via cable (eth0), dhcpcd overwrites /etc/resolv.conf destroying the symlink.


Inteligencia militar son términos contradictorios (G. Marx).

Offline

#6 2008-12-25 12:55:37

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: resolv.conf and two ways for internet access

Make it a hardlink then, I assume they're both on the same filesystem. Just drop the "-s" argument to ln.

Offline

#7 2008-12-25 19:41:57

briest
Member
From: Katowice, PL
Registered: 2006-05-04
Posts: 468

Re: resolv.conf and two ways for internet access

Maybe pdnsd can help? It's a tiny DNS proxy; you can define multiple upstream server sets and switch between them either manually or by various rules: interface presence, ping, test query, custom script... just put nameserver 127.0.0.1 in resolv.conf and protect the file with chattr +i wink

Offline

#8 2008-12-26 18:55:39

mcover
Member
From: Germany
Registered: 2007-01-25
Posts: 134

Re: resolv.conf and two ways for internet access

You can disable dhcpcd write to /etc/resolv.conf by removing 'domain_name_servers' from /etc/dhcpcd.conf - in case you were interested.

But solution would be to tell /etc/ppp/ip-up to write /etc/resolv.conf. Simply put a "cp /etc/ppp/resolv.conf /etc/resolv.conf" in there.

I haven't tested it, but afaik wvdial uses pppd, so it should work.

Offline

#9 2008-12-26 23:36:16

Miles28
Member
From: Spain
Registered: 2008-08-31
Posts: 88

Re: resolv.conf and two ways for internet access

mcover wrote:

But solution would be to tell /etc/ppp/ip-up to write /etc/resolv.conf. Simply put a "cp /etc/ppp/resolv.conf /etc/resolv.conf" in there.

It works perfect.
Thanks a lot you all.


Inteligencia militar son términos contradictorios (G. Marx).

Offline

Board footer

Powered by FluxBB