0

Possible Duplicate:
iptables - Target to route packet to specific interface?

Ubuntu 12.04. So on the client's machines I've got two NICs eth1 and wlan0. I'd like all the web browsing traffic to go through wlan0 and the rest via eth1. What is the simplest way to achieve that? Thanks

0

1 Answer 1

2

you'll have to use a policy based routing - mark outgoing packets to the port 80, then use separate routing table for them. take a look here and just google for linux policy routing.

3
  • I was actually hoping for iptables guru to give me the exact commands rather than abstract. But thanks anyway.
    – tkane
    May 8, 2012 at 10:13
  • Then maybe your question should reflect what answer you are hoping for? i.e. maybe you should include "Could someone provide the exact iptables commands to achieve this?" May 8, 2012 at 10:50
  • @tkane - i've done it few times but do not have example at hand. you'll -j MARK packets on prerouting [eg just for outgoing traffic on port 80], then you'll use "ip rule add fwmark markNumber table someRoutingTableNumber" to direct traffic to separate routing table. you'll need to create that table and add default route to it.
    – pQd
    May 8, 2012 at 10:52

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