Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jan 30 at 21:30

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

The DNS server is determined by /etc/resolv.conf (Ubuntu has annoying "helpers" the write to this file) To have the IP 10.11.12.13 be the nameserver used for name lookups, have /etc/resolv.conf look like this:

nameserver 10.11.12.13

A DNS setup where one nameserver resolves some IPs and another nameserver resolves other IPs is more complicated, but I have one documented here:

http://maradns.samiam.org/deadwood/doc/Deadwood-HOWTO

share|improve this answer
    
I had noticed that file, yes. For the wlan there is a nameserver as well as a dns-search entry. For the ppp0 interface there are two nameserver entries (primary and secondary addresses). When the wlan goes down, the latter two remain there. So I think that works properly. –  Oxidator Jan 31 at 8:17
    
When you have multiple nameserver entries in /etc/resolv.conf, it just uses one of the nameservers at random. –  samiam Jan 31 at 21:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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