kern/115725: pf nat -> ($if) works only intermittently

Eric Kjeldergaard kjelderg at gmail.com
Wed Aug 22 08:30:01 PDT 2007


>Number:         115725
>Category:       kern
>Synopsis:       pf nat -> ($if) works only intermittently
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 22 15:30:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Eric Kjeldergaard
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD fluffy.dname.net 6.2-RELEASE FreeBSD 6.2-RELEASE #3: Fri May  4 11:22:03 CDT 2007 root at fluffy.dname.net:/usr/obj/usr/src/sys/FLUFFY  i386
>Description:
rc.conf network configuration and jail configuration:

# network setup
ifconfig_re0="inet 10.1.1.9 netmask 255.255.255.0 media 100baseTX mediaopt full-duplex"
defaultrouter="10.1.1.1"
 
# FreeNX Jail setup
jail_freenx_rootdir="/jails/FreeNXJail"
jail_freenx_hostname="freenx.fluffy.dname.net"
jail_freenx_interface="re0"
jail_freenx_ip="192.168.1.2"
jail_freenx_procfs_enable="YES"
jail_freenx_devfs_enable="YES"
jail_freenx_devfs_ruleset="devfsrules_jail"
jail_freenx_mount_enable="NO"

pf rules:
ext_if="re0"
freenx_jail_ip="192.168.1.2"
nat pass on $ext_if from $freenx_jail_ip to any -> ($ext_if)

When I then jexec a shell in the jail and try to do things on the network, only 1 in 3 or so connections would work.  Ideally they should have all worked.  My solution follows, but it is a workaround for the bug.
>How-To-Repeat:
set up a jail as described and a pf conf as described.  Try to access the network, it will fail most of the time by timing out.
>Fix:
This goes into pf.conf instead of what was shown above.

ext_ip="10.1.1.9"
nat pass on $ext_if from $freenx_jail_ip to any -> $ext_ip

Now the networking works flawlessly.  Unfortunately, this also limits my ability to change my external ip freely.

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


More information about the freebsd-bugs mailing list