Subject: kern/16180: ipnat not working in current
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mihai@kefren.netbsd.ro>
List: netbsd-bugs
Date: 04/03/2002 19:49:53
>Number:         16180
>Category:       kern
>Synopsis:       ipnat is not working in current
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 03 08:50:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Mihai Chelaru
>Release:        NetBSD 1.5ZC
>Organization:
	
	RomTeleNet
>Environment:
	
	
System: NetBSD kefren.netbsd.ro 1.5ZC NetBSD 1.5ZC (Kefren) #1: Wed Apr 3 19:16:34 EEST 2002 mihai@kefren.netbsd.ro:/data/usr/src/sys/arch/i386/compile/Kefren i386
Architecture: i386
Machine: i386
>Description:
	
	NAT is not working in current as far as i see. look at my config:
	# ifconfig -a
	ex0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	capabilities=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
	enabled=0<>
	address: 00:04:76:97:5c:c0
	media: Ethernet autoselect (100baseTX full-duplex)
	status: active
	inet 193.226.59.5 netmask 0xfffffff0 broadcast 193.226.59.15
	inet alias 193.226.59.7 netmask 0xfffffff0 broadcast 193.226.59.15
	lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 33220
	inet 127.0.0.1 netmask 0xff000000
	gif0: flags=8151<UP,POINTOPOINT,RUNNING,PROMISC,MULTICAST> mtu 1280
	tunnel inet 193.226.59.5 --> 212.93.128.6
	inet 10.0.0.1 -> 10.0.0.2 netmask 0xfffffffc
	# tcpdump -l -p -i ex0 | grep yahoo
	tcpdump: listening on ex0
	19:41:42.719423 212.93.128.6 > kefren.netbsd.ro: 10.0.0.2.3438 > w8.dcx.yahoo.com.www: S 2387698336:2387698336(0) win 31680 <mss 1440,sackOK,timestamp 105236460 0,nop,wscale 0> (DF) (ipip-proto-4)
	19:41:42.719564 10.0.0.2.3438 > w8.dcx.yahoo.com.www: S 2387698336:2387698336(0) win 31680 <mss 1440,sackOK,timestamp 105236460 0,nop,wscale 0> (DF)
	19:41:45.716764 212.93.128.6 > kefren.netbsd.ro: 10.0.0.2.3438 > w8.dcx.yahoo.com.www: S 2387698336:2387698336(0) win 31680 <mss 1440,sackOK,timestamp 105236760 0,nop,wscale 0> (DF) (ipip-proto-4)
	19:41:45.716923 10.0.0.2.3438 > w8.dcx.yahoo.com.www: S 2387698336:2387698336(0) win 31680 <mss 1440,sackOK,timestamp 105236760 0,nop,wscale 0> (DF)
	19:41:51.716104 212.93.128.6 > kefren.netbsd.ro: 10.0.0.2.3438 > w8.dcx.yahoo.com.www: S 2387698336:2387698336(0) win 31680 <mss 1440,sackOK,timestamp 105237360 0,nop,wscale 0> (DF) (ipip-proto-4)
	19:41:51.716258 10.0.0.2.3438 > w8.dcx.yahoo.com.www: S 2387698336:2387698336(0) win 31680 <mss 1440,sackOK,timestamp 105237360 0,nop,wscale 0> (DF)
	# tcpdump -i gif0
	tcpdump: listening on gif0
	19:40:28.317750 10.0.0.2.3436 > 64.58.76.176.www: S 2271784814:2271784814(0) win 31680 <mss 1440,sackOK,timestamp 105229020 0,nop,wscale 0> (DF)
	19:40:29.354638 10.0.0.2.3437 > 64.58.76.228.www: S 2303373666:2303373666(0) win 31680 <mss 1440,sackOK,timestamp 105229123 0,nop,wscale 0> (DF)
	19:40:32.348067 10.0.0.2.3437 > 64.58.76.228.www: S 2303373666:2303373666(0) win 31680 <mss 1440,sackOK,timestamp 105229423 0,nop,wscale 0> (DF)
	# ipnat -l
	List of active MAP/Redirect filters:
	map ex0 192.168.1.0/24  -> 193.226.59.7/32  portmap tcp/udp 40000:60000
	map ex0 10.0.0.0/30  -> 193.226.59.7/32  portmap tcp/udp 40000:60000
	map ex0 192.168.100.0/24  -> 193.226.59.7/32  portmap tcp/udp 40000:60000
	map ex0 10.0.0.4/30  -> 193.226.59.7/32  portmap tcp/udp 40000:60000

	List of active sessions:
	# cat /etc/ipnat.conf
	map ex0 192.168.1.0/24 -> 193.226.59.7/32 portmap tcp/udp 40000:60000
	map ex0 10.0.0.0/30 -> 193.226.59.7/32 portmap tcp/udp 40000:60000
	map ex0 192.168.100.0/24 -> 193.226.59.7/32 portmap tcp/udp 40000:60000
	map ex0 10.0.0.4/30 -> 193.226.59.7/32 portmap tcp/udp 40000:60000
	#

	As far as i see on ex0 i have packets with source address 10.0.0.2 instead of the NATed address.
>How-To-Repeat:
	
	look up.
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: