Last active
January 8, 2021 21:15
-
-
Save moredure/47c2887890db9a070b0284dcfcbb49e5 to your computer and use it in GitHub Desktop.
Failover Proxy for service migration using iptables (like aiven do)
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
| #!/bin/bash | |
| iptables -t nat -A PREROUTING -p tcp --dport $PORT -j DNAT --to-destination $TARGET:$PORT | |
| iptables -t nat -A POSTROUTING -j MASQUERADE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment