Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Linux, you can do NAT port redirection with a command like this:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8000

What is the equivalent with BSD's PF?

share|improve this question
up vote 1 down vote accepted

You can do it like this with Packet Filter :

pass in on em0 proto tcp from any to any port 80 rdr-to port 8000

Change em0 with your network interface, and change the IP address to suit your needs.

Read more : http://www.openbsd.org/faq/pf/rdr.html#filter

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.