Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save peschee/e56f32a3d718c461d9566b01ffa9561a to your computer and use it in GitHub Desktop.
Save peschee/e56f32a3d718c461d9566b01ffa9561a to your computer and use it in GitHub Desktop.
Making macos on boot redirect port 80 to 8080 and 443 to 8443 on all interfaces permanently, -- = /
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>co.echo.httpdfwd</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>cat /etc/pf.anchors/dev | sudo pfctl -ef - &amp;&amp; sysctl -w net.inet.ip.forwarding=1</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>root</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment