• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.


Port forwarding on FreeBSD via ipnat

Page history last edited by trunasuci 12 years, 1 month ago


it's normally happen when your server is running "behind the firewall" and using private ip network, we use port forwarding to forward "request" based on specified ports on services...

in this case, we take apache/http port 80 as an example



1- FreeBSD FW gateway + ipnat

ext ip = based on ISP, it's dynamic

internal ip =



2- NetBSD server which running web/apache/http

ip port 80/tcp



3- For IPNAT setup, refer to my previous HOW-TO NAT with ipnat on FreeBSD,


just edit /etc/ipnat.conf and add this value:


rdr tun0 0/0 port 80 -> port 80 tcp/udp




tun0 is device tunnel 0 created while ure using ppp foa dialing your DSL connection, any connection froum outside/internet to web services port 80, receive by FreeBSD gateway box, will be redirected to the NetBSD web server..


so after saving, u just need to flush and run/apply the rules..NAT with ipnat on FreeBSD



trunasuci# ipnat -FC && ipnat -f /etc/ipnat.rules

2 entries flushed from NAT table

4 entries flushed from NAT list



trunasuci# ipnat -l

List of active MAP/Redirect filters:

map xl1 ->

rdr tun0 port 80 -> port 80 tcp/udp

List of active sessions:

MAP      22    <- ->      22    [ 4741]



so now u can test it from outside/internet and see if u can reach the webserver behind the firewall..









Comments (0)

You don't have permission to comment on this page.