Last active
February 2, 2021 03:00
-
-
Save wintersolutions/d59234b27538fec1af81e41708fdcfef to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# outside connections | |
/usr/sbin/iptables -w -t nat -A PREROUTING -d EXTERNALIP -p tcp --dport 80 -j DNAT --to-destination INGRESSIP:80 | |
/usr/sbin/iptables -w -t nat -A PREROUTING -d EXTERNALIP -p tcp --dport 443 -j DNAT --to-destination INGRESSIP:443 | |
/usr/sbin/iptables -w -t nat -A PREROUTING -d EXTERNALIP -p tcp --dport 6443 -j DNAT --to-destination K8IP:6443 | |
# host | |
/usr/sbin/iptables -w -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination INGRESSIP:80 | |
/usr/sbin/iptables -w -t nat -A OUTPUT -p tcp --dport 443 -j DNAT --to-destination INGRESSIP:443 | |
/usr/sbin/iptables -w -t nat -A OUTPUT -p tcp --dport 6443 -j DNAT --to-destination K8IP:6443 | |
# cluster | |
/usr/sbin/iptables -w -t nat -A PREROUTING -s LXCIP/16 -d EXTERNALIP -p tcp --dport 80 -j DNAT --to-destination INGRESSIP:80 | |
/usr/sbin/iptables -w -t nat -A PREROUTING -s LXCIP/16 -d EXTERNALIP -p tcp --dport 443 -j DNAT --to-destination INGRESSIP:443 | |
/usr/sbin/iptables -w -t nat -A PREROUTING -s LXCIP/16 -d EXTERNALIP -p tcp --dport 6443 -j DNAT --to-destination K8IP:6443 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment