View previous topic :: View next topic |
Author |
Message |
mansniks Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 19 Nov 2007 Posts: 290
|
Posted: Tue Aug 12, 2008 7:08 pm Post subject: eth and ppp in the same time -- iptables |
|
|
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? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mansniks Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 19 Nov 2007 Posts: 290
|
Posted: Tue Aug 12, 2008 8:57 pm Post subject: |
|
|
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
________________________________
This is forwarding everything to ppp0.
First I would like to ask about route: what is that command really doing? Why is it necessary, if there is iptables accessible? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23093
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mansniks Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 19 Nov 2007 Posts: 290
|
Posted: Thu Aug 14, 2008 8:28 am Post subject: |
|
|
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? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mansniks Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 19 Nov 2007 Posts: 290
|
Posted: Thu Aug 14, 2008 8:42 am Post subject: |
|
|
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? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|