Networking Forums

Networking Forums > Computer Networking > Linux Networking > (newbie) ROUTE target + SNAT - how can I do that?

Reply
Thread Tools Display Modes

(newbie) ROUTE target + SNAT - how can I do that?

 
 
arielCo
Guest
Posts: n/a

 
      11-22-2005, 10:26 PM
Hello there...

My original intention is to force all trafic to/from a certain command
to go through ppp0, so I thought the simplest choice would be

iptables -A OUTPUT -t mangle -m owner --cmd-owner [my-cmd] -j ROUTE
--oif ppp0

But now, I have to do a SNAT so inbound traffic arrives through ppp0
too:

iptables -A POSTROUTING -t nat -m owner --cmd-owner [my-cmd] -j SNAT
--to-source 10.252.155.87
(where 10.252.155.87 is the address just assigned to ppp0)

Am I on the right track so far?

I don't know how to do *both* operations on outbound packets, and I'm
afraid there's something about traversing chains that I still don't
get, despite having read the tutorial at frozentux.net and the manpage.
Once a packet matches the first (OUTPUT) rule, no further procesing is
done (iptables counters and tcpdump confirm that). And I don't know how
to jump from a custom chain on one table to another on a different
table.

I would really appreciate some light on what I'm dealing with!

regards...

- ariel

 
Reply With Quote
 
 
 
 
arielCo
Guest
Posts: n/a

 
      11-22-2005, 10:57 PM
PS:
I've seen comments about using target MARK and iproute2
(Advanced-routing HOWTO), but I suspect the solution does not require
that much (and my deadline is crawling near).

thanx!

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
route newbie question mackdaddy315 Linux Networking 3 08-21-2007 02:08 PM
iptables: rule with RETURN target just after a rule with ACCEPT target Neroku Linux Networking 0 04-25-2007 08:13 AM
iptables: rule with RETURN target after a rule with the ACCEPT target Neroku Linux Networking 0 04-24-2007 08:43 PM
Wireless route/cable modem - newbie question Dave Spencer Broadband 2 10-15-2006 02:41 PM
newbie trouble with ip route Markus Haberstock Linux Networking 1 05-01-2004 10:32 AM



1 2 3 4 5 6 7 8 9 10 11