Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Route only traffic from eth2
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
enkil
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 115
Location: Bern, Switzerland

PostPosted: Wed Nov 15, 2006 8:23 pm    Post subject: Route only traffic from eth2 Reply with quote

I hope this question is not too noob'ish, but I'm kinda confused when it comes to iptables.

Here's my network-layout:

eth0: 192.168.32.0/23
eth1: adsl (ppp0)
eth2: 172.16.0.0/24

I want to route traffic from 172.16.0.0/24 through ppp0. I'm kinda cautious with this, because I don't want to route traffic coming from 192.168.32.0/23.

Is it sufficient to do something like this (dunno if the syntax is right in the first place...)
Code:
itpables -t nat -A POSTROUTING -i eth2 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -i eth0 -j DROP

I'm not sure what to do with the FORWARD-Chain at all... Something like this maybe?
Code:
iptables -A FORWARD -s  192.168.32.0/23 -j DROP


Thanks for your help...
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