Date: Thu, 20 Mar 2008 17:29:48 +0300 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> To: Stefan Lambrev <stefan.lambrev@moneybookers.com> Cc: freebsd-net@freebsd.org, Vlad GALU <dudu@dudu.ro> Subject: Re: route-to not working Message-ID: <glw/W3D3xtjzTIyZcVIM3WS70YU@0BcoiRg9FUCxpIK5KNlPqkjtUcI> In-Reply-To: <47E26A10.4040305@moneybookers.com> References: <a49a70ea0803190611u317b289fkb3c7c3c82bdd7c2f@mail.gmail.com> <a49a70ea0803200524h594d5cb3pcfc903145fc244a7@mail.gmail.com> <47E25F45.8010805@moneybookers.com> <ad79ad6b0803200606n1fc2bffhb56e836412b61791@mail.gmail.com> <47E26A10.4040305@moneybookers.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Stefan, good day. Thu, Mar 20, 2008 at 03:43:44PM +0200, Stefan Lambrev wrote: >>> But here is working example which you can improve off course. >>> >>> #dual home >>> pass in on $ext_if1 reply-to ($ext_if1 $gw1) from any to $external_addr1 >>> keep state >>> pass out on $ext_if2 route-to ($ext_if1 $gw1) from $external_addr1 to any >>> pass in on $ext_if2 reply-to ($ext_if2 $gw2) from any to $external_addr2 >>> keep state >>> pass out on $ext_if1 route-to ($ext_if2 $gw1) from $external_addr2 to any >>> >>> #dual home ssh only >>> pass out on $ext_if2 route-to ($ext_if1 $gw1) from $external_addr1 to any >>> pass out on $ext_if1 route-to ($ext_if2 $gw1) from $external_addr2 to any >>> pass in on $ext_if1 reply-to ($ext_if1 $gw1) proto tcp from any to >>> $external_addr1 port 22 keep state >>> pass in on $ext_if2 reply-to ($ext_if2 $gw2) proto tcp from any to >>> $external_addr2 port 22 keep state [...] > You forget that the first rule to match wins and keep state (which is on by > default in 7.0) will make replies to match the state not the pass out rules. May be I am badly interpreting the last sentence, but in pf, the last rule that matches (or the first rule with the 'quick' keyword) wins. The above rules are just decoupled from each other, because they are differing in the interface/direction. And sure, when the state is created, the subsequent packets are not passed through the ruleset. Am I missing something? Thank you. -- Eygene
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?glw/W3D3xtjzTIyZcVIM3WS70YU>