Commit 13a720b570af625761520ae9e373d059d23622fe
1 parent
f533dad5
Exists in
master
and in
89 other branches
Added missing chains on iptables commands
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
utils/reverseproxy_ssh_setup
1 | 1 | #!/bin/sh |
2 | 2 | |
3 | 3 | set -e |
4 | +set -x | |
4 | 5 | |
5 | 6 | port="$1" |
6 | 7 | reverseproxy_ip="$2" |
... | ... | @@ -19,6 +20,6 @@ semanage port -a -t ssh_port_t -p tcp "$port" |
19 | 20 | systemctl restart sshd |
20 | 21 | |
21 | 22 | # Setup port redirect |
22 | -iptables -A PREROUTING -d $reverseproxy_ip/32 -p tcp -m tcp --dport 22 -j DNAT --to-destination $integration_ip:22 | |
23 | -iptables -A POSTROUTING -d $integration_ip/32 -p tcp -m tcp --dport 22 -j SNAT --to-source $reverseproxy_ip | |
23 | +iptables -t nat -A PREROUTING -d $reverseproxy_ip/32 -p tcp -m tcp --dport 22 -j DNAT --to-destination $integration_ip:22 | |
24 | +iptables -t nat -A POSTROUTING -d $integration_ip/32 -p tcp -m tcp --dport 22 -j SNAT --to-source $reverseproxy_ip | |
24 | 25 | sysctl -w net.ipv4.ip_forward=1 | ... | ... |