Commit 13a720b570af625761520ae9e373d059d23622fe

Authored by Sergio Oliveira
1 parent f533dad5

Added missing chains on iptables commands

Showing 1 changed file with 3 additions and 2 deletions   Show diff stats
utils/reverseproxy_ssh_setup
1 #!/bin/sh 1 #!/bin/sh
2 2
3 set -e 3 set -e
  4 +set -x
4 5
5 port="$1" 6 port="$1"
6 reverseproxy_ip="$2" 7 reverseproxy_ip="$2"
@@ -19,6 +20,6 @@ semanage port -a -t ssh_port_t -p tcp "$port" @@ -19,6 +20,6 @@ semanage port -a -t ssh_port_t -p tcp "$port"
19 systemctl restart sshd 20 systemctl restart sshd
20 21
21 # Setup port redirect 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 sysctl -w net.ipv4.ip_forward=1 25 sysctl -w net.ipv4.ip_forward=1