Created
July 1, 2024 18:49
-
-
Save JSH32/d6ebb2306f08544602115921a4a56095 to your computer and use it in GitHub Desktop.
Port forward out of a tunneled server
This file contains hidden or 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
# /etc/ufw/before.rules | |
*nat | |
:PREROUTING ACCEPT [0:0] | |
# Port forward example | |
-A PREROUTING -p tcp --dport 443 -j DNAT --to ip:443 | |
-A PREROUTING -p tcp --dport 80 -j DNAT --to ip:80 | |
# setup routing | |
-A POSTROUTING -j MASQUERADE | |
COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is usually done in combination with tailscale to expose a server that cant port forward directly from a different location