Blame man/man8/tc-fw.8

Packit Service 3880ab
.TH "Firewall mark classifier in tc" 8 "21 Oct 2015" "iproute2" "Linux"
Packit Service 3880ab
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
fw \- fwmark traffic control filter
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
.in +8
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR tc " " filter " ... " fw " [ " classid
Packit Service 3880ab
.IR CLASSID " ] [ "
Packit Service 3880ab
.B action
Packit Service 3880ab
.IR ACTION_SPEC " ]"
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
the
Packit Service 3880ab
.B fw
Packit Service 3880ab
filter allows to classify packets based on a previously set
Packit Service 3880ab
.BR fwmark " by " iptables .
Packit Service 3880ab
If it is identical to the filter's
Packit Service 3880ab
.BR handle ,
Packit Service 3880ab
the filter matches.
Packit Service 3880ab
.B iptables
Packit Service 3880ab
allows to mark single packets with the
Packit Service 3880ab
.B MARK
Packit Service 3880ab
target, or whole connections using
Packit Service 3880ab
.BR CONNMARK .
Packit Service 3880ab
The benefit of using this filter instead of doing the
Packit Service 3880ab
heavy-lifting with
Packit Service 3880ab
.B tc
Packit Service 3880ab
itself is that on one hand it might be convenient to keep packet filtering and
Packit Service 3880ab
classification in one place, possibly having to match a packet just once, and on
Packit Service 3880ab
the other users familiar with
Packit Service 3880ab
.BR iptables " but not " tc
Packit Service 3880ab
will have a less hard time adding QoS to their setups.
Packit Service 3880ab
.SH OPTIONS
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI classid " CLASSID"
Packit Service 3880ab
Push matching packets to the class identified by
Packit Service 3880ab
.IR CLASSID .
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI action " ACTION_SPEC"
Packit Service 3880ab
Apply an action from the generic actions framework on matching packets.
Packit Service 3880ab
.SH EXAMPLES
Packit Service 3880ab
Take e.g. the following tc filter statement:
Packit Service 3880ab
Packit Service 3880ab
.RS
Packit Service 3880ab
.EX
Packit Service 3880ab
tc filter add ... handle 6 fw classid 1:1
Packit Service 3880ab
.EE
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
will match if the packet's
Packit Service 3880ab
.B fwmark
Packit Service 3880ab
value is
Packit Service 3880ab
.BR 6 .
Packit Service 3880ab
This is a sample
Packit Service 3880ab
.B iptables
Packit Service 3880ab
statement marking packets coming in on eth0:
Packit Service 3880ab
Packit Service 3880ab
.RS
Packit Service 3880ab
.EX
Packit Service 3880ab
iptables -t mangle -A PREROUTING -i eth0 -j MARK --set-mark 6
Packit Service 3880ab
.EE
Packit Service 3880ab
.RE
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.BR tc (8),
Packit Service 3880ab
.BR iptables (8),
Packit Service 3880ab
.BR iptables-extensions (8)