setting up a FreeBSD access point (hostap, natd)
kp at FreeBSD.org
Fri Nov 25 12:36:24 UTC 2016
On 25 Nov 2016, at 12:54, Christoph P.U. Kukulies wrote:
> Am 25.11.2016 um 12:46 schrieb Kristof Provost:
>> nat on re0 inet from 192.168.0.0/24 to any -> (re0)
> Thanks. I'll try that. What does (re0) mean (in parens)? Just curious.
That rule tells pf to NAT traffic from your internal IP range, and to
map it onto the IP address assigned to re0.
That’s what the ‘(re0)’ means. You could also do this (assuming
your WAN IP is 184.108.40.206):
nat on re0 inet from 192.168.0.0/24 to any -> 220.127.116.11
> Do I have to put anything more into pf.conf?
That depends on what you want your firewall to do, but you’ll likely
want a couple more things, yes.
At a minimum I’d do this:
set skip on lo0
scrub on re0 fragment reassemble
nat on re0 inet from 192.168.0.0/24 to any -> (re0)
# Example port forwarding rule
rdr on re0 proto tcp from any to any port 22 -> 18.104.22.168 port 22
pf is also documented in the handbook:
More information about the freebsd-questions