{"id":3762,"date":"2022-12-20T17:19:59","date_gmt":"2022-12-20T20:19:59","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/firewall-mark-classifier-in-tc-man8\/"},"modified":"2022-12-20T17:19:59","modified_gmt":"2022-12-20T20:19:59","slug":"firewall-mark-classifier-in-tc-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/firewall-mark-classifier-in-tc-man8\/","title":{"rendered":"Firewall mark classifier in tc (man8)"},"content":{"rendered":"<h1 align=\"center\">Firewall mark classifier in tc<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">fw \u2212 fwmark traffic control filter<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:23%; margin-top: 1em\"><b>tc filter<\/b> &#8230; <b>fw<\/b> [ <b>classid<\/b> <i>CLASSID<\/i> ] [ <b>action<\/b> <i>ACTION_SPEC<\/i> ]<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">the <b>fw<\/b> filter allows to classify packets based on a previously set <b>fwmark<\/b> by <b>iptables<\/b>. If it is identical to the filter\u2019s <b>handle<\/b>, the filter matches. <b>iptables<\/b> allows to mark single packets with the <b>MARK<\/b> target, or whole connections using <b>CONNMARK<\/b>. The benefit of using this filter instead of doing the heavy-lifting with <b>tc<\/b> itself is that on one hand it might be convenient to keep packet filtering and classification in one place, possibly having to match a packet just once, and on the other users familiar with <b>iptables<\/b> but not <b>tc<\/b> will have a less hard time adding QoS to their setups.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>classid<\/b> <i>CLASSID<\/i><\/p>\n<p style=\"margin-left:22%;\">Push matching packets to the class identified by <i>CLASSID<\/i>.<\/p>\n<p style=\"margin-left:11%;\"><b>action<\/b> <i>ACTION_SPEC<\/i><\/p>\n<p style=\"margin-left:22%;\">Apply an action from the generic actions framework on matching packets.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Take e.g. the following tc filter statement:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">tc filter add &#8230; handle 6 fw classid 1:1<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">will match if the packet\u2019s <b>fwmark<\/b> value is <b>6<\/b>. This is a sample <b>iptables<\/b> statement marking packets coming in on eth0:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">iptables -t mangle -A PREROUTING -i eth0 -j MARK &#8211;set-mark 6<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tc<\/b>(8), <b>iptables<\/b>(8), <b>iptables-extensions<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  fw \u2212 fwmark traffic control filter <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,865],"class_list":["post-3762","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-tc-fw"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3762"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3762\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}