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?


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy