* ftp mark
@ 2004-05-31 13:30 Krystian
0 siblings, 0 replies; 2+ messages in thread
From: Krystian @ 2004-05-31 13:30 UTC (permalink / raw)
To: netfilter
hi
i have a router/nating box with linux on it. can anybody tell me how to
mark outgoing ftp active/passive connections ?
Krystian
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: ftp mark
@ 2004-05-31 16:30 Daniel Chemko
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Chemko @ 2004-05-31 16:30 UTC (permalink / raw)
To: Krystian, netfilter
Krystian wrote:
> hi
>
> i have a router/nating box with linux on it. can anybody tell me how
> to mark outgoing ftp active/passive connections ?
If you mark a conntrack with the CONNMARK extension, the RELATED traffic
to that session are also marked. Otherwise, you have to make all RELATED
traffic with a single mark.
The best way to apply marks would be a sub-chain so that you can process
other operations after MARKING them. PS this is from memory so syntax
could be off a bit.
# Ingress marking (mostly for Ingress filters and Policy Routing)
iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING -m mark ! --mark 0 -j ACCEPT
iptables -t mangle -A PREROUTING -d 0/0 --dport 21 -j MARK --set-mark
0x111
iptables -t mangle -A PREROUTING -j CONNMARK --save-mark
# Egress marking (mostly for QOS operations)
iptables -t mangle -A POSTROUTING -j CONNMARK --restore-mark
iptables -t mangle -A POSTROUTING -m mark ! --mark 0 -j ACCEPT
iptables -t mangle -A POSTROUTING -o ${if_inet} --dport 21 -j MARK
--set-mark 0x111
iptables -t mangle -A POSTROUTING -j CONNMARK --save-mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-05-31 16:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-31 13:30 ftp mark Krystian
-- strict thread matches above, loose matches on Subject: below --
2004-05-31 16:30 Daniel Chemko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.