# eth and ppp in the same time -- iptables

## mansniks

How to make particular user's network traffic going through ppp, but all the others' through eth?

Any links to some how-to-s about using multiple interfaces in same time?

----------

## mansniks

route add -net 192.168.0.0 netmask 255.255.0.0 dev ppp0

iptables --insert OUTPUT 1 --source 0.0.0.0/0.0.0.0 \

--destination 192.168.0.0/16 --jump ACCEPT --out-interface ppp0

iptables --insert INPUT 1 --source 192.168.0.0/16 \

--destination 0.0.0.0/0.0.0.0 --jump ACCEPT --in-interface ppp0

iptables --insert FORWARD 1 --source 0.0.0.0/0.0.0.0 \

--destination 192.168.0.0/16 --jump ACCEPT --out-interface ppp0

iptables --insert FORWARD 1 --source 192.168.0.0/16 \

--destination 0.0.0.0/0.0.0.0 --jump ACCEPT

iptables --table nat --append POSTROUTING --out-interface ppp0 \

--jump MASQUERADE

iptables --append FORWARD --protocol tcp \

--tcp-flags SYN,RST SYN --jump TCPMSS --clamp-mss-to-pmtu

----------

## Hu

You want source based routing.  See Linux Advanced Routing & Traffic Control HOWTO.

----------

## mansniks

Please explain somebody some more about how should I route! (trying for too long..)

I understand, first mark packets with iptables, then, hoping, that packets are first reviewed by netfilter and then routed, route them through right interface. But that is not really trivial! 

How should I route?

----------

## mansniks

And one more thing: when I used modem (not VPN), I noticed, I have to reconnect to LAN, if I have used modem. How internet browser knows, which interface it should use?

----------

