setting up a FreeBSD access point (hostap, natd)

Kristof Provost kp at
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 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

	nat on re0 inet from to any ->

> 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 to any -> (re0)

	# Example port forwarding rule
	rdr on re0 proto tcp from any to any port 22 -> port 22

	pass in
	pass out

pf is also documented in the handbook:


More information about the freebsd-questions mailing list