Skip to content

Instantly share code, notes, and snippets.

@travispaul
Created March 30, 2017 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travispaul/76ad0b0f3fd11cf03b2b4ce117ac90ff to your computer and use it in GitHub Desktop.
Save travispaul/76ad0b0f3fd11cf03b2b4ce117ac90ff to your computer and use it in GitHub Desktop.
Example npf config to redirect ports 80/443 to unprivileged ports
$ext_if = "vioif0"
$ext_v4 = inet4(vioif0)
map $ext_if dynamic XXX.XXX.XXX.XXX port 8080 <- $ext_v4 port 80
map $ext_if dynamic XXX.XXX.XXX.XXX port 4443 <- $ext_v4 port 443
group default {
pass final on lo0 all
pass final on $ext_if all
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment