Our server has LAN (DHCP) connection to Internal Network and 3G (via USB dongle) to the Internet. The Internet access should not be exposed to internal network and vice versa.

To be able use 3G modem i followed those two manuals:

3G USB Modem Not Working in 12.04


Now when i do wvdial provider_name the connection is established. The interface is up and has IP, DNS etc setup according to ifconfig

However whenever i try to ping any public internet server it is still trying to use LAN network for it and not PPP interface.

How can i solve it?

PS: I've tried following - put auto ppp0 iface ppp0 inet wvdial into /etc/network/interfaces before auto eth0 and now on start it brings the ppp0 interface up, then i unplug cable from LAN and restart, after this it works fine, but if i restart server with LAN cable plugged in, it is still using eth0 gateway by default!

The output from ip route show:

default via dev p2p1 dev ppp0  proto kernel  scope link  src dev p2p1  proto kernel  scope link  src 

I know there is a way to use route2 to load balance between interfaces, but in all manuals i could find they use static IP and DNS, whereas in my case of 3G connection it is not possible to do...


Ok, found it. The command for setting default routing interface is:

$ route add default dev %interface_name%

The issue with setting PPP interface as default is that this should be done after the interface is up which can take some time. So as the solution i created an Upstart task which runs after everything else is done and sets the default interface

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.