Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Share internetconnection whit FreeBSD and ipnat? 1

Status
Not open for further replies.

EyEr0n

Technical User
Nov 17, 2002
3
SE
I have these specs:

BROADBAND (Gives ip via DHCP)
|
|
|
NIC #1 (DHCP)
FreeBSD BOX
NIC #2 (IP: 192.168.0.1, NETMASK: 255.255.255.0)
|
|
|
WinXP comp (IP: 192.168.0.5, NETMASK: 255.255.255.0)

The FreeBSD box have IP_FILTER compiled into the kernel.

How should my ipnat rules look like?
The only thing i know is that i should start whit:
map

I've read the man pages but i don't understand them.
Could you please help me?
 
Hi,

it is very easy to set up.
Simply put those three lines in /etc/rc.conf:

natd_enable="YES"
natd_interface="NIC #1" CHANGE THIS!
natd_flags="-dynamic"

You should have something like this in your kernel:

options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=50
options IPDIVERT
 
map sis0 192.168.0.0/24 -> 0/32 portmap tcp/udp 20000:30000
map sis0 192.168.0.0/24 -> 0/32

(sis0 will be your nic#1)
that is the first two line in the ipnat.conf

to redirect a port

rdr sis0 0.0.0.0/32 port 110 -> 192.168.0.5 port 110 tcp

external ip internal ip

that is an example to redirect port 110 to the ip 192.168.0.1

let me know if it works or if you need more help

good luck
Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top