You are not logged in.
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
Both your connections use the same device name [eth0]? someone may jump in with a solution I am sure its possible...
Mr Green
Offline
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
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
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
Make it a hardlink then, I assume they're both on the same filesystem. Just drop the "-s" argument to ln.
Offline
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
Offline
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
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