Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a small embedded computer running busybox. It has a wired eth0 interface, which is connected to an on-board wlan-module's wired interface by a cable. Also there's an 3G module on ppp0.

I need to route traffic from (localhost) to (wlan-module) through eth0 and everything else should go through ppp0.

Current settings:

# ip rule
0:      from all lookup local
1000:   from lookup mobile
32766:  from all lookup main
32767:  from all lookup default

# ip route show table mobile
default via dev ppp0

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    0      0        0 eth0   U     0      0        0 eth0 UH    0      0        0 ppp0

This works partly. I can connect to from and I can connect to this computer from outside over ppp0 but I can't make any connections from this computer to outside using ppp0.

I tried adding

# ip rule add from all lookup mobile
# ip route flush table cache
# ip rule
0:      from all lookup local
999:    from all lookup mobile
1000:   from lookup mobile
32766:  from all lookup main
32767:  from all lookup default

This will of course route all traffic through ppp0 but I lose my connection to

I have tried several different rules and routes to make this work but I'm not having any luck with it. What kind of rule/route should I make?

  • ip rule, ip route and route are available
share|improve this question
up vote 1 down vote accepted

I see your default route is pointing to eth0, you will need to point your default route to ppp0 instead. Remove the default route and try "ip route add default dev ppp0".

share|improve this answer
Yep, I realized this just when you posted this. Deleted the default route pointing to eth0 and added new default route 'default gw dev ppp0'. Everything seems to work now. – Spitz Jan 9 '14 at 12:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .