From owner-freebsd-questions Fri Mar 20 19:47:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA07862 for freebsd-questions-outgoing; Fri, 20 Mar 1998 19:47:08 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from hanoi-fw-ex.vnn.vn (hanoi-fw.vnd.net [203.162.3.234]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id TAA07709 for ; Fri, 20 Mar 1998 19:46:33 -0800 (PST) (envelope-from ) Date: Fri, 20 Mar 1998 19:46:33 -0800 (PST) Received: from [203.162.7.92] by hanoi-fw-ex.vnn.vn via smtpd (for hub.FreeBSD.ORG [204.216.27.18]) with SMTP; 21 Mar 1998 03:46:19 UT Received: from ncst.ac.vn ([203.160.0.20]) by mail.netnam.vn (Post.Office MTA v3.1.2 release (PO203-101c) ID# 0-45134U2500L250S0) with SMTP id AAA20712; Sat, 21 Mar 1998 11:03:11 -0500 Received: from laidbak.i88.isc.com by ncst.ac.vn id aa06343; 21 Mar 98 13:49 Hanoi From: Nguyen Hoang Trung To: freebsd-questions@FreeBSD.ORG Cc: hoangtrung@yahoo.com Subject: Help with NATD MIME-Version: 1.0 X-netMessengerType: Email Content-Type: Text/plain; charset=us-ascii X-Mailer: netMedia netMessenger Version 1.0 X-Priority: 3 (Normal) Message-ID: <9803211349.aa06343@ncst.ac.vn> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I am running FreeBSD 2.2.5 on a machine with 2 network interfaces: vx0: 203.162.7.90/27 (public network) ep0: 203.160.0.5/24 (local network) I have also configured natd and ipfw as follows: - File /etc/rc.firewall: /sbin/ipfw -f flush /sbin/ipfw add divert natd log all from any to 203.162.7.90 /sbin/ipfw add divert natd log all from 203.162.7.66 to any /sbin/ipfw add divert natd log all from 203.160.0.11 to any /sbin/ipfw add pass log all from any to any - File /etc/natd.conf: verbose use_sockets redirect_port tcp 203.162.7.66:8081 0.0.0.0:80 interface vx0 alias_address 203.162.7.90 The output of comand " natd -f /etc/natd.conf " is: In [TCP] 203.160.0.11:32845 -> 207.25.71.28:80 aliased to 203.160.0.11:32845 -> 207.25.71.28:80 Out [TCP] 203.160.0.11:32845 -> 207.25.71.28:80 aliased to 203.162.7.90:32845 -> 207.25.71.28:80 In [TCP] 207.25.71.28:80 -> 203.162.7.90:32845 aliased to 207.25.71.28:80 -> 203.160.0.11:32845 ..... It seems that natd works but port redirection doesn't. If I use a real IP# (e.g. 203.162.0.12) instead of 0.0.0.0, it works as follows: In [TCP] 203.160.0.11:32705 -> 203.162.0.12:80 aliased to 203.160.0.11:32705 -> 203.162.7.66:8081 Out [TCP] 203.160.0.11:32705 -> 203.162.7.66:8081 aliased to 203.162.7.90:32705 -> 203.162.7.66:8081 In [TCP] 203.162.7.66:8081 -> 203.162.7.90:32705 aliased to 203.162.7.66:8081 -> 203.160.0.11:32705 Out [TCP] 203.162.7.66:8081 -> 203.160.0.11:32705 aliased to 203.162.0.12:80 -> 203.160.0.11:32705 Can you pls explain it to me. Thank you in advance. Nguyen Hoang Trung To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message