Subject: kern/25332: IP Filter 4.1.1 "fastroute" doesn't throw packet to different interface correctly
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <yuuji-netbsd@es.gentei.org>
List: netbsd-bugs
Date: 04/27/2004 00:05:48
>Number:         25332
>Category:       kern
>Synopsis:       "fastroute(to)" in ipf.conf doesn't work
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 26 15:06:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     HIROSE yuuji
>Release:        NetBSD 2.0E
>Organization:
>Environment:
% ldd =ipf
/sbin/ipf:
         -lkvm.5 => /usr/lib/libkvm.so.5
         -lc.12 => /usr/lib/libc.so.12
% ident =ipf
/sbin/ipf:
     $NetBSD: crt0.c,v 1.13 2003/07/26 19:24:27 salo Exp $
     $NetBSD: skeleton.c,v 1.25 2003/08/07 11:17:54 agc Exp $

System: NetBSD tmax.yk.gentei.org 2.0E NetBSD 2.0E (TMAX) #20: Sun Apr 25 23:17:34 JST 2004 root@tmax.yk.gentei.org:/sys/arch/i386/compile/TMAX i386
Architecture: i386
Machine: i386
>Description:
It doesn't seem ipf-v4 work well on fastroute.

On netbsd box which has two network interfaces;


      Internet
        |
        |Global-Address-1
    [[default-router(NAT)]]
       |10.0.0.95
       |
       |10.0.0.50
+--- fxp0 ---+
|            |
| NetBSD box |
|            |
+--- aue0 ---+
      | 10.0.2.50
      |
      | 10.0.2.60
   [[backup-router(NAT)]]
      |Global-Address-2
      |
    Internet


where default route of NetBSD box is default-router.

After upgrading to ipf-v4, my NetBSD box can't throw packets to
backup-router by ipf.conf fastrouting line;

	pass out on fxp0 to aue0:10.0.2.60 from 10.0.2.50 to any

which threw packets to backup-router formerly by older ipf.


I checked the link-level header with `tcpdump -e -i aue0' and
found that ipf-v4's fastroute throws the matching packets to
aue0:10.0.2.60 with MAC-address of default-router beyond fxp0.  This
should be a MAC-address of backup-router beyond aue0, I think.

>How-To-Repeat:

(According to the figure above)
After setting up tcp-port forwarding from backup-router to NetBSD box's
secondary interface(aue0); forward tcp/25 to 10.0.2.50 for example.

Trying to connect from outside.

outside% telnet Global-Address-2 25

No answer from NetBSD box with ipf-v4.
Previously(ipf-v3.4.29), we got smtp greeting message from inner NetBSD box.

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: