Last active
October 12, 2022 07:19
-
-
Save gregjhogan/ba118222c66c81209c41be24c28ceebf to your computer and use it in GitHub Desktop.
local port forwarding on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ifconfig lo0 alias 127.0.1.1 | |
ifconfig lo0 alias 127.0.10.1 | |
# clear rules | |
pfctl -F all -f /etc/pf.conf | |
# set rules | |
echo " | |
rdr pass inet proto tcp from any to 127.0.1.1 port 443 -> 127.0.1.1 port 1443 | |
rdr pass inet proto tcp from any to 127.0.10.1 port 443 -> 127.0.10.1 port 10443 | |
" | sudo pfctl -ef - | |
# list rules | |
# pfctl -s nat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment