Saturday, March 28, 2009

ubuntu and umts, not a happy couple

Tired of random unsuccessful connections via my huawei umts modem, I started paying attention to my wvdial output.


.....
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat Mar 28 22:52:15 2009
--> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
--> --> PAP (Password Authentication Protocol) may be flaky.
--> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
--> --> CHAP (Challenge Handshake) may be flaky.
--> Pid of pppd: 15700
--> Using interface ppp0
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> local IP address 10.40.242.234
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> remote IP address 10.64.64.64
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> primary DNS address 10.11.12.13
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> secondary DNS address 10.11.12.14
--> pppd: ��[06][08]��[06][08]H�[06][08]


That doesn't look like a valid dns address! And it isn't. Apparently, this is a known bug:

https://bugs.launchpad.net/ubuntu/+source/ppp/+bug/331322

It might be due to different software at the mobile internet cells that the modem connects to, in some cases an ms-dns is sent, and rejected by pppd. In that case, the bogus dns addresses mentioned above are sent, disabling your internet, while your modem is connected.

To work around this, you need to add working nameservers in /etc/resolv.conf (don't forget that during a pppd session, the file is overwritten, and a backup is made. Change that too)

Furthermore, /etc/wvdial.conf needs to have

Auto DNS = No

And /etc/ppp/peers/wvdial needs to have commented out the usepeerdns option:

#usepeerdns


This should solve the problem! Care has to be taken that the dns addresses from your umts provider will always be in the /etc/resolv.conf file. I am not sure how to ensure this after connecting to wlan, vpn, etc, the ubuntu network manager will likely overwrite the /etc/resolv.conf file