Linux Netfilter discussions
 help / color / mirror / Atom feed
* MARK Locally Generated Packets
@ 2003-06-19 18:11 Jay
  2003-06-20 11:08 ` Joerg Kinzebach
  0 siblings, 1 reply; 2+ messages in thread
From: Jay @ 2003-06-19 18:11 UTC (permalink / raw)
  To: netfilter

Hi,

     I'm trying to mark locally generated packets to be able to re-route
HTTP(S) requets out a different gateway. Similar to a transparent proxy,
with the exception that I want only traffic generated from this box to
get marked and re-routed. I've setup everything correctly according to
the many documents I've found, and I can manually use ip rules to get the
actions I want, I'm jut not getting a mark recognized by the ip rules.
Anybody have any ideas on how to get iptables to mark locally generated
packets?

-= Jay =-



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: MARK Locally Generated Packets
  2003-06-19 18:11 MARK Locally Generated Packets Jay
@ 2003-06-20 11:08 ` Joerg Kinzebach
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Kinzebach @ 2003-06-20 11:08 UTC (permalink / raw)
  To: netfilter

>      I'm trying to mark locally generated packets to be able to re-route
> HTTP(S) requets out a different gateway. Similar to a transparent proxy,
> with the exception that I want only traffic generated from this box to
> get marked and re-routed. I've setup everything correctly according to
> the many documents I've found, and I can manually use ip rules to get the
> actions I want, I'm jut not getting a mark recognized by the ip rules.

Something like this should do:

iptables -t mangle -I OUTPUT -p tcp --sport 443 -s <local_ip> \
    -j MARK --set-mark 0xc

ip rule add pref 1 fwmark 0xc table 101
ip route add 0.0.0.0/0 via $router table 101

This marks all ports originated on TCP port 443 of <local_ip> with
"0xc" and for all packets with 0xc the routing table "101" will
be used which routes everything that hits it towards $router.

I asumme you used the PREROUTING chain of the mangle table instead
of the OUTPUT chain.



joerg


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-20 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-19 18:11 MARK Locally Generated Packets Jay
2003-06-20 11:08 ` Joerg Kinzebach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox