Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 2006 19:28:52 -0200
From:      "Nilton Volpato" <nilton.volpato@gmail.com>
To:        freebsd-ipfw@freebsd.org
Subject:   port redirection with natd and ipfw
Message-ID:  <27fef5640611171328r2973167dm2b58e1dc2e393bb7@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I'm using a computer with FreeBSD as a gateway and NAT for a private
LAN. Let's say the gateway has external.com as external address, and
192.168.0.1 as internal address, so that the LAN is 192.168.0.0/24.

I'm doing a number of port redirects in the gateway, for svn, http,
https, ssh, etc using natd. However, these port redirects do not work
from inside the LAN.

For instance, if I point my browser to http://external.com and I'm in
the LAN, then it will not work. I can't use the internal address of
the web server because none of the links will work on the web page.

In summary, I want that my port redirections work also when I try to
connect to the gateway's external address from inside the LAN.

I'm using a minimal ipfw configuration to try to solve this. This is
the default configuration.

00050 divert 8668 ip4 from any to any via vr0
00100 allow ip from any to any via lo0
00200 deny ip from any to 127.0.0.0/8
00300 deny ip from 127.0.0.0/8 to any
65000 allow ip from any to any
65535 deny ip from any to any

I tried to add:

00060 divert 8668 ip4 from 192.168.0.0/24 to external.com

expecting that it would send the packets from LAN to natd, which would
apply the port redirections. But it did not work.

How can I solve this?

Thanks,
-- Nilton



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