Date: Wed, 3 Apr 2013 04:32:57 -0700 (PDT) From: Unga <unga888@yahoo.com> To: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: ipfw+natd port forward does not work as intended Message-ID: <1364988777.50574.YahooMailNeo@web161904.mail.bf1.yahoo.com>
next in thread | raw e-mail | index | archive | help
Hi all=0A=0AI'm on 192.168.1.62, the server running on 192.168.1.3 and list= en to port 1234. I want any connection going out of my machine to port 1234= to port forward to 192.168.1.3:1234.=0A=0ABut when I attempt to connect to= 192.168.1.1:1234 , natd shows following verbose message:=0Anatd[2051]: Ali= asing to 192.168.1.62, mtu 1500 bytes=0AOut {default}[TCP]=A0 [TCP] 192.168= .1.62:45642 -> 192.168.1.1:1234 aliased to=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= [TCP] 192.168.1.62:45642 -> 192.168.1.1:1234=0A=0A=0AThis is FreeBSD 8.1-R= ELEASE and the kernel is built with following options:=0Aoptions=A0=A0=A0= =A0=A0=A0=A0=A0 IPFIREWALL=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 # Enable = ipfw=0Aoptions=A0=A0=A0=A0=A0=A0=A0=A0 IPFIREWALL_FORWARD=A0=A0=A0=A0=A0 # = Enable ipfw forward=0Aoptions=A0=A0=A0=A0=A0=A0=A0=A0 IPDIVERT=0A=0A=0A/etc= /rc.conf=0A--------------=0A=0A# Enable ipfw firewall=0Afirewall_enable=3D"= YES"=0Afirewall_script=3D"/etc/rc.firewall.test"=0A=0A# Natd=0Agateway_enab= le=3D"YES"=0Anatd_enable=3D"YES"=0Anatd_interface=3D"msk0"=0Anatd_flags=3D"= -f /etc/natd.conf"=0Asysctl net.inet.ip.forwarding=3D1=0A=0A/etc/rc.firewal= l.test=0A-----------------------=0A=0A#!/bin/sh=0A=0A=0AIFACE=3Dmsk0=0A=0AI= PFW=3D/sbin/ipfw=0A=0A${IPFW} -f flush=0A${IPFW} add 100 divert natd ip fro= m any to any 1234 via ${IFACE} =0A${IPFW} add 60000 permit ip from any to a= ny=0A=0A=0A/etc/natd.conf=0A-----------------=0A=0Aport 8668=0Alog=0Averbos= e=0Ainterface msk0 =0Aredirect_port tcp 192.168.1.3:1234 1234=0A=0A=0AIs th= ere any configuration error above?=0A=0ABest regards=0AUnga
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1364988777.50574.YahooMailNeo>