wvdial, /etc/resolv.conf on Fedora 10

I think I’ve solved a curious problem on Fedora 10 with wvdial and pppd not updating /etc/resolv.conf. The result is even though there is a network connection, no name resolution is possible unless I manually add the nameservers to /etc/resolv.conf.

I use wvdial to connect to the Internet on mobile broadband (3G/HSDPA) using my Nokia E51 and E66. Of course, I could use NetworkManager, but why do everything the easy way? Anyway, when Fedora 10 came out, the E51 and E66 were not recognised by NM as mobile broadband devices which is why I had to learn wvdial/pppd.

One thing I noticed with wvdial (or pppd from the command line) is that they didn’t update /etc/resolv.conf even though configured to do so. Other people on the Internet seem to have encountered the same problem.

The root cause of the problem is this: when the ppp interface comes up, pppd calls /etc/ppp/ip-up which calls /etc/sysconfig/network-scripts/ifup-post. ifup-post is the magic script which populates /etc/resolv.conf. However /etc/ppp/ip-up is meant to be called with 6 arguments (say 6th arg = XXXX), then it looks for the existence of /etc/sysconfig/network-scripts/ifcfg-XXXX. Only if this file exists is ifup-post called. So…drum roll… wvdial invokes pppd which invokes /etc/ppp/ip-up with 5 arguments! The result is ip-up looking for /etc/sysconfig/network-scripts/ifcfg-.

The solution is to create a dummy file /etc/sysconfig/network-scripts/ifcfg- with the following lines:
##contents of /etc/sysconfig/network-scripts/ifcfg-
PEERDNS=yes
DEFROUTE=yes

These two lines are enough for ifup-post to do its magic with DNS /etc/resolv.conf.

FIXME: Frankly I don’t know how NM does it; under NM ip-up gets called with e.g. the following args
ppp0 /dev/ttyACM0 115200 119.234.159.74 10.6.6.6 /org/freedesktop/NetworkManager/PPP/0

No way does /etc/sysconfig/network-scripts/ifcfg-/org/freedesktop/NetworkManager/PPP/0 exist! There must other stuff going on. Under wvdial /etc/ppp/ip-up is called e.g. with

ppp0 /dev/ttyACM0 460800 119.234.145.157 10.6.6.6

Notice only 5 args! BTW these scripts are highly Fedora 10 specific so this “solution” may not apply to random Linux distribution.

Advertisements

11 Responses

  1. Facing a similar issue with installing Reliance Netconnect on Fedore 10.. Though this doesnt work in my case.. the ppp is connected but no internet on firefox neither does ping work but it fetches ip and dns and shows connected .. this is bugging me like anything now

    • Hi Nave,

      Can you edit /etc/ppp/ip-up near the top to include the lines:

      ##DEBUG: see how this script is being invoked
      echo DEBUG $* >> /var/tmp/debug-pppd.log

      I would be curious to see what’s going on after the ip address, dns stuff is negotiated ok.

  2. Hi!
    I just tried this workaround on Fedora 11, and it works perfectly – I was screwing around with the other ifup/ifcfg scripts and the /etc/ppp/resolv.conf but as soon as I added the file with those two lines, everything works >perfectly<. Thankyou very much for documenting this, you've saved me a huge headache!

    • Cool – so glad it works for Fedora 11; I’m just about to migrate all my systems (slowly) so it’s good to know that this workaround still does the trick.

  3. Looks like pppd should add the 6th argument if ipparam options is specified for pppd. On F11, pppd seems to get ipparam but your hack is stil needed.

    You should open a bug at bugzilla.redhat.com. When you do, add “linville@redhat.com” to the CC list if you don’t mind.

    Thanks for the hack!

  4. I had wvdial working on several distributions and needed it now on my fedora11 laptop. 2 Days of headache and messing with scripts until I found your solution.

    Thanx alot you made my day!

    I hope its fixed in F12 anyway.

    Thanx!

  5. Thank you, your solution worked just fine. Had the wvdial issue with a bootable Fedora10 USB stick and Nokia E63 tethering, now the /etc/resolv.conf was written just fine. Thanks to the stick’s persistent storage feature the fix will work later too.

    https://fedorahosted.org/liveusb-creator/

  6. hey thanks man,
    The hack worked perfectly.
    I have installed fedora 15 and still ve the same problem. you should expect the issue to be sorted out by now. Thanks man u r a life saver.

  7. Thanks a lot, it works fine with fedora 16 too..

  8. Thanks, it works on fedora 17 too

  9. Just lovely hack! I am using Fedora 17 x64, my ZTE usb modem AC2726 (CDMA/EVDO Rev.A) never dialed comfortably with network-manager. I searched the net read, read & read and apply every solution/work-around carefully but to no avail. I even totally changed debian distros, upgraded kernels and packages to latest ones, etc, etc & etc. But I was forced to come to command-line and enter into stuff like editing lot of configuration files manual with lot of SUDOs and SUs. Only stable solution is WvDial and linux lovers should make scripts, applets and even light GUIs that could tackle wvdial, pppd and other network related stuff. I know it is long… but necessary. you can google for every major debian distro for modem model I mentioned.
    BIG THANKS…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: