I am running Ubuntu 12.04.
I have a HSDPA USB Modem, with which I can successfully dial in. It works fine as well when I set the default gateway (remote IP address) in the main routing table. But I would like to use this modem in parallel to my WLAN, which will be the main interface, and therefore occupy the default gateway in the main table.
I want to send packets through the modem only from sockets on the local IP address assigned by dialing. Thus I introduced a new rule in the IP rule table from x.x.x.x lookup table 1
, where I used the local IP address. Then in the table I simply added the default via x.x.x.x dev ppp0
where I used the remote IP address provided by the dialing process.
Now, if I turn of my WLAN and remove the default rule in the main table, I cannot resolve any host. I can however use traceroute
to trace a path to the primary DNS server (Address also supplied by the dialing). If I add the default rule back to the main table, everything works fine again.
So, I suspected that the IP from rule would do its job, but somehow somewhere packets are apparently dropping. Can anyone suggest or hint to a solution to my problem?
EDIT:
By adding the primary (and secondary if you like) nameserver to the ip rule list of to address, from all to x.x.x.x lookup table 1
, I can actually retrieve host information, i.e. I can e.g. run host google.com
successfully. But even by forcing ping to use the ppp0 interface, ping google.com -I ppp0
, I cannot reach it, Network is unreachable.