{"id":4289,"date":"2022-12-20T17:48:53","date_gmt":"2022-12-20T20:48:53","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/shorewallrtrules-man5\/"},"modified":"2022-12-20T17:48:53","modified_gmt":"2022-12-20T20:48:53","slug":"shorewallrtrules-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/shorewallrtrules-man5\/","title":{"rendered":"SHOREWALL&minus;RTRULES (man5)"},"content":{"rendered":"<h1 align=\"center\">SHOREWALL\u2212RTRULES<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">rtrules \u2212 Shorewall Routing Rules file<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"38%\">\n<p style=\"margin-top: 1em\"><b>\/etc\/shorewall[6]\/rtrules<\/b><\/p>\n<\/td>\n<td width=\"51%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Entries in this file cause traffic to be routed to one of the providers listed in <b><font color=\"#0000FF\">shorewall\u2212providers<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">(5).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">The columns in the file are as follows.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>SOURCE<\/b> (Optional) \u2212 {<b>\u2212<\/b>|[&#038;]<i>interface<\/i>|<i>address<\/i>|<i>interface<\/i>:<i>address<\/i>}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">An ip <i>address<\/i> (network or host) that matches the source IP address in a packet. May also be specified as an <i>interface<\/i> name optionally followed by &#8220;:&#8221; and an address. If the device <b>lo<\/b> is specified, the packet must originate from the firewall itself.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.5.0, you may specify &#038;<i>interface<\/i> in this column to indicate that the source is the primary IP address of the named interface.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.6.8, you may specify a comma\u2212separated list of addresses in this column.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>DEST<\/b> (Optional) \u2212 {<b>\u2212<\/b>|<i>address<\/i>}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">An ip address (network or host) that matches the destination IP address in a packet.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">If you choose to omit either <b>SOURCE<\/b> or <b>DEST<\/b>, place &#8220;\u2212&#8221; in that column. Note that you may not omit both <b>SOURCE<\/b> and <b>DEST<\/b>.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.6.8, you may specify a comma\u2212separated list of addresses in this column.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>PROVIDER<\/b> \u2212 {<i>provider\u2212name<\/i>|<i>provider\u2212number<\/i>|<b>main<\/b>}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">The provider to route the traffic through. May be expressed either as the provider name or the provider number. May also be <b>main<\/b> or 254 for the main routing table. This can be used in combination with VPN tunnels, see example 2 below.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>PRIORITY<\/b> \u2212 <i>priority<\/i><b>[!]<\/b><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">The rule&#8217;s numeric <i>priority<\/i> which determines the order in which the rules are processed. Rules with equal priority are applied in the order in which they appear in the file.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">1000\u22121999<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">Before Shorewall\u2212generated &#8216;MARK&#8217; rules<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">11000\u221211999<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">After &#8216;MARK&#8217; rules but before Shorewall\u2212generated rules for ISP interfaces.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">26000\u221226999<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">After ISP interface rules but before &#8216;default&#8217; rule.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 5.0.2, the priority may be followed optionally by an exclaimation mark (&#8220;!&#8221;). This causes the rule to remain in place if the interface is disabled.<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><b><big>Caution<\/big><\/b> <br \/> Be careful when using rules of the same PRIORITY as some unexpected behavior can occur when multiple rules have the same SOURCE. For example, in the following rules, the second rule overwrites the first unless the priority in the second is changed to 19001 or higher:<\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\">10.10.0.0\/24 192.168.5.6 provider1 19000 <br \/> 10.10.0.0\/24 \u2212 provider2 19000<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b><big>MARK \u2212 {\u2212|<\/big><\/b><big><i>mark<\/i><b>[\/<\/b><i>mask<\/i><b>]}<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Optional \u2212\u2212 added in Shorewall 4.4.25. For this rule to be applied to a packet, the packet&#8217;s mark value must match the <i>mark<\/i> when logically anded with the <i>mask<\/i>. If a <i>mask<\/i> is not supplied, Shorewall supplies a suitable provider mask.<\/big><\/font><\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>Example 1:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>You want all traffic coming in on eth1 to be routed to the ISP1 provider.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#SOURCE DEST PROVIDER PRIORITY MASK <br \/> eth1 \u2212 ISP1 1000<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 2:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>You use OpenVPN (routed setup \/tunX) in combination with multiple providers. In this case you have to set up a rule to ensure that the OpenVPN traffic is routed back through the tunX interface(s) rather than through any of the providers. 10.8.0.0\/24 is the subnet chosen in your OpenVPN configuration (server 10.8.0.0 255.255.255.0).<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#SOURCE DEST PROVIDER PRIORITY MASK <br \/> \u2212 10.8.0.0\/24 main 1000<\/big><\/font><\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\/etc\/shorewall\/rtrules<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\/etc\/shorewall6\/rtrules<\/big><\/font><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><b><font color=\"#0000FF\">https:\/\/shorewall.org\/MultiISP.html<\/font><\/b><\/big> <font color=\"#000000\">[2]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b><big><font color=\"#0000FF\">https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/font><\/big><\/b> <font color=\"#000000\">[3]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>shorewall(8)<\/big><\/font><\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>1.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"29%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>shorewall-providers<\/big><\/font><\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/manpages\/shorewall-providers.html<\/big><\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>2.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"54%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/MultiISP.html<\/big><\/font><\/p>\n<\/td>\n<td width=\"29%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/MultiISP.html<\/big><\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>3.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/big><\/font><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/big><\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  rtrules \u2212 Shorewall Routing Rules file <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,1291,1309],"class_list":["post-4289","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-shorewall-rtrules"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4289","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=4289"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4289\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}