Created
January 4, 2022 16:08
-
-
Save apristen/fa72d09502dc2eaced5374307f92f0e9 to your computer and use it in GitHub Desktop.
Easy way for TCP and/or UDP ports forwarding from privileged (<1024) to non-privileged (>1024) ports using just iptables PREROUTING.
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 | |
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 25 -j REDIRECT --to-ports 2525 | |
iptables -t nat -A PREROUTING -p udp -m udp --dport 53 -j REDIRECT --to-ports 5353 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment