From owner-freebsd-security Tue Dec 4 18:29:13 2001 Delivered-To: freebsd-security@freebsd.org Received: from VL7.net (OL51-141.fibertel.com.ar [24.232.141.51]) by hub.freebsd.org (Postfix) with ESMTP id 6F58737B417 for ; Tue, 4 Dec 2001 18:29:00 -0800 (PST) Received: from localhost (fox@localhost) by VL7.net (8.11.6/8.11.6) with ESMTP id fB52SCp51160 for ; Tue, 4 Dec 2001 23:28:13 -0300 (ART) (envelope-from fox@vl7.net) Date: Tue, 4 Dec 2001 23:28:12 -0300 (ART) From: Vladimir Pianykh To: freebsd-security@FreeBSD.ORG Subject: ipfw In-Reply-To: <4.3.2.7.2.20011204172959.04d112e0@localhost> Message-ID: <20011204232236.L51132-100000@VL7.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi! I tried to make port forwarding to server in internal network, and nat for users in same network. Just port forwarding is working fine, but if I enable masquarad for internal network, I'm losing connection to redirected servers. What is wrong in my script? Thank you. out=192.168.2.1 ext_i=ep0 int_serv_1=192.168.1.1 port_1=80 int_serv_2=192.168.1.2 port_2=25 ########################## forwarding ############################### ipfw add 1000 divert 8888 tcp from any to $out $port_1 via $ext_i ipfw add 1100 divert 8888 ip from $int_serv_1 to any via $ext_i natd -p 8888 -n $ext_i -redirect_port tcp $int_serv_1:$port_1 $port_1 #-------------------------------------------------------------------- ipfw add 1500 divert 8889 tcp from any to $out $port_2 via $ext_i ipfw add 1600 divert 8889 ip from $int_serv_2 to any via $ext_i natd -p 8889 -n $ext_i -redirect_port tcp $int_serv_2:$port_2 $port_2 ############################ NAT #################################### ipfw add 0900 divert 8887 ip from any to any via $ext_i natd -p 8887 -n $ext_i ipfw add 65000 allow ip from any to any To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message