Take the 2-minute tour ×
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.

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

1 Answer 1

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 192.168.1.20 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

 
discard

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.