Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2008 16:40:38 +0200
From:      Stefan Lambrev <stefan.lambrev@moneybookers.com>
To:        Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Cc:        freebsd-net@freebsd.org, Vlad GALU <dudu@dudu.ro>
Subject:   Re: route-to not working
Message-ID:  <47E27766.6010901@moneybookers.com>
In-Reply-To: <glw/W3D3xtjzTIyZcVIM3WS70YU@0BcoiRg9FUCxpIK5KNlPqkjtUcI>
References:  <a49a70ea0803190611u317b289fkb3c7c3c82bdd7c2f@mail.gmail.com> <a49a70ea0803200524h594d5cb3pcfc903145fc244a7@mail.gmail.com> <47E25F45.8010805@moneybookers.com> <ad79ad6b0803200606n1fc2bffhb56e836412b61791@mail.gmail.com> <47E26A10.4040305@moneybookers.com> <glw/W3D3xtjzTIyZcVIM3WS70YU@0BcoiRg9FUCxpIK5KNlPqkjtUcI>

next in thread | previous in thread | raw e-mail | index | archive | help
Greetings,

Eygene Ryabinkin wrote:
> 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?
>   
Yes you are absolutely right - last rule, that match will win,
and there is only one rule that will match incoming packets  and will 
create
state, thus preventing outgoing packets to match anything else, just 
this state.
> Thank you.
>   

-- 

Best Wishes,
Stefan Lambrev
ICQ# 24134177




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47E27766.6010901>