Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
eth and ppp in the same time -- iptables
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mansniks
Apprentice
Apprentice


Joined: 19 Nov 2007
Posts: 290

PostPosted: Tue Aug 12, 2008 7:08 pm    Post subject: eth and ppp in the same time -- iptables Reply with quote

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
View user's profile Send private message
mansniks
Apprentice
Apprentice


Joined: 19 Nov 2007
Posts: 290

PostPosted: Tue Aug 12, 2008 8:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23093

PostPosted: Wed Aug 13, 2008 3:13 am    Post subject: Reply with quote

You want source based routing. See Linux Advanced Routing & Traffic Control HOWTO.
Back to top
View user's profile Send private message
mansniks
Apprentice
Apprentice


Joined: 19 Nov 2007
Posts: 290

PostPosted: Thu Aug 14, 2008 8:28 am    Post subject: Reply with quote

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
View user's profile Send private message
mansniks
Apprentice
Apprentice


Joined: 19 Nov 2007
Posts: 290

PostPosted: Thu Aug 14, 2008 8:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum