Hello,

- Does the ipf redirection feature work on Solaris 10?

I would like to use the ipf redirection statements "to
interface:router_ip" or "reply-to interface:router_ip" as decribed in
http://coombs.anu.edu.au/~avalon/ipf.new.txt

(The syntax is mentionned in the BNF of the Solaris 10 ipf(4) man
page, but the explanations there are lacking.)

On a machine that has two interfaces, the purpose is to send output
reply packets of a TCP session to the same interface that the input
packets came from.  The idea to use ipfilter to do this comes from the
blog entry:
Packets out of the wrong interface
 http://blogs.sun.com/carlson/entry/packets_out_of_the_wrong

My first try was to use "reply-to" in a "keep state" rule:

pass in quick on e1000g305000 reply-to e1000g305000:10.13.5.1 proto tcp from 
any to any port = 443 keep state keep frags group i_sso-test1

Which I understand as "once a connection to port 443 starts on
interface e1000g305000 send all reply packets to the same interface via
the gateway 10.13.5.1"

But it does not work; in the ipf log it shows that the rule matched:

22:56:32.770690 e1000g305000 @i_sso-test1:1 p 10.194.17.11,5648 -> 
10.13.5.181,443 PR tcp len 20 60 -S K-S K-F IN
22:56:32.770783 e1000g0 @i_sso-test1:1 p 10.13.5.181,443 -> 10.194.17.11,5648 
PR tcp len 20 44 -AS K-S K-F OUT

But the reply packet is not seen on the router (10.13.5.1), nor does
it get to 10.194.17.11 through another route (no firewall on that
machine).

My second try was to use two stateless rules, and to do "source port
routing" for outgoing packets:

pass in quick proto tcp from any to any port = 443 group i_sso-test1
pass out quick  on e1000g0 to e1000g305000:10.13.5.1 proto tcp from any port = 
443 to any group o_sso-test1
pass out quick proto tcp from any port = 443 to any group o_sso-test1

Which I understand as "incoming packets to port 443 are allowed and
outgoing packets from port 443, if passing on interface e1000g0, are
redirected through interface e1000g305000 via the gateway 10.13.5.1,
if not, are simply allowed".

It does not work either; in the ipf log it shows that both the in and
the first out rules matched:

23:09:00.591163 e1000g305000 @i_sso-test1:1 p 10.194.17.11,26080 -> 
10.13.5.181,443 PR tcp len 20 60 -S IN
23:09:00.591363 e1000g0 @o_sso-test1:1 p 10.13.5.181,443 -> 10.194.17.11,26080 
PR tcp len 20 44 -AS OUT


But again the reply packet seems to be lost in thin air.
I have tried various other rules to no avail.

- Should this work with ipfilter v4.1.9 (592) coming with Solaris 10
 u7?
- Am I missing something in the configuration?
- Shouldn't the ipf log show the outgoing reply packet twice? (Once on
 the "wrong" interface e1000g0 and once on the interface it is
 redirected to e1000g305000.) Or indicate in another manner that the
 redirection occurred (like it indicates K-S for "keep state")?


Context:

# netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- default 10.194.7.1 UG 1 2407 default 10.194.7.1 UG 1 5104 e1000g0 10.13.5.0 10.13.5.181 U 1 5 e1000g305000:1 10.194.7.0 10.194.7.81 U 1 3 e1000g0:2 224.0.0.0 10.194.7.81 U 1 0 e1000g0:2 127.0.0.1 127.0.0.1 UH 1 7 lo0:7 # cat /etc/release Solaris 10 5/09 s10s_u7wos_08 SPARC
          Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                       Use is subject to license terms.
                            Assembled 30 March 2009
# ipf -V
ipf: IP Filter: v4.1.9 (592)
Kernel: IP Filter: v4.1.9 Running: yes
Log Flags: 0x70000000 = pass, block, nomatch
Default: pass all, Logging: available
Active list: 0
Feature mask: 0x107


If it matters, this is occuring in a Solaris 10 zone, whith virtual
interfaces one of which uses 801.q tagging (vlan 305, subnet
10.13.5.0/24), and the "router" is a Cisco ACE load balancer with
interface 10.13.5.1 on the server side.


Thanks in advance for your help in this matter!
Best regards,
Dominique

Mr Dominique Petitpierre       Email: u...@domain
Division Informatique                 User=Dominique.Petitpierre
University of Geneva                  Domain=unige.ch


Reply via email to