diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 829082c987..aef2b7a67a 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1991,34 +1991,6 @@ pass out on \$IPsec all keep state label "IPsec internal host to host" EOD; - /* pass traffic between statically routed subnets and the subnet on the - * interface in question to avoid problems with complicated routing - * topologies - */ - if(isset($config['filter']['bypassstaticroutes']) && is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) { - $ipfrules .= "anchor \"staticrouted\" \n"; - foreach ($config['staticroutes']['route'] as $route) { - $realif = guess_interface_from_ip(lookup_gateway_ip_by_name($route['gateway'])); - $friendly = convert_real_interface_to_friendly_interface_name($realif); - if(is_array($FilterIflist[$friendly])) { - $oc = $FilterIflist[$friendly]; - if($oc['ip']) { - $sa = $oc['sa']; - $sn = $oc['sn']; - $if = $oc['if']; - } - if($sa) { - $ipfrules .= << 1 && !empty($FilterIflist['lan']['if'])) { /* if antilockout is enabled, LAN exists and has @@ -2106,6 +2078,35 @@ EOD; } } + /* pass traffic between statically routed subnets and the subnet on the + * interface in question to avoid problems with complicated routing + * topologies + */ + if(isset($config['filter']['bypassstaticroutes']) && is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) { + $ipfrules .= "anchor \"staticrouted\" \n"; + foreach ($config['staticroutes']['route'] as $route) { + $realif = guess_interface_from_ip(lookup_gateway_ip_by_name($route['gateway'])); + $friendly = convert_real_interface_to_friendly_interface_name($realif); + if(is_array($FilterIflist[$friendly])) { + $oc = $FilterIflist[$friendly]; + if($oc['ip']) { + $sa = $oc['sa']; + $sn = $oc['sn']; + $if = $oc['if']; + } + if($sa) { + $ipfrules .= <<