summaryrefslogtreecommitdiff
path: root/hosts/iroha/scripts/port-forward
blob: fa759d725aaf5298e516306e46c4521b031e4288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#! /usr/bin/env sh

su -c "iptables -t nat -C PREROUTING -p tcp -i enp7s0 --dport 47984 -j DNAT --to-destination 192.168.211.252:47984 || \
iptables -t nat -A PREROUTING -p tcp -i enp7s0 --dport 47984 -j DNAT --to-destination 192.168.211.252:47984;
iptables -t nat -C PREROUTING -p tcp -i enp7s0 --dport 47984 -j DNAT --to-destination 192.168.211.252:47984 || \
iptables -t nat -A PREROUTING -p tcp -i enp7s0 --dport 47984 -j DNAT --to-destination 192.168.211.252:47984;
iptables -t nat -C PREROUTING -p tcp -i enp7s0 --dport 47989 -j DNAT --to-destination 192.168.211.252:47989 || \
iptables -t nat -A PREROUTING -p tcp -i enp7s0 --dport 47989 -j DNAT --to-destination 192.168.211.252:47989;
iptables -t nat -C PREROUTING -p tcp -i enp7s0 --dport 48010 -j DNAT --to-destination 192.168.211.252:48010 || \
iptables -t nat -A PREROUTING -p tcp -i enp7s0 --dport 48010 -j DNAT --to-destination 192.168.211.252:48010;
iptables -t nat -C PREROUTING -p udp -i enp7s0 --dport 47998:48000 -j DNAT --to-destination 192.168.211.252:47998-48000 || \
iptables -t nat -A PREROUTING -p udp -i enp7s0 --dport 47998:48000 -j DNAT --to-destination 192.168.211.252:47998-48000;"