Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Mar 1998 19:46:33 -0800 (PST)
From:      Nguyen Hoang Trung <htrung@ncst.ac.vn>
To:        freebsd-questions@FreeBSD.ORG
Cc:        hoangtrung@yahoo.com
Subject:   Help with NATD
Message-ID:   <9803211349.aa06343@ncst.ac.vn>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <9803211349.aa06343>