summaryrefslogtreecommitdiff
path: root/src/testing/netjail_start_v2.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/netjail_start_v2.sh')
-rwxr-xr-xsrc/testing/netjail_start_v2.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testing/netjail_start_v2.sh b/src/testing/netjail_start_v2.sh
index dd1f2ad93..81196d53d 100755
--- a/src/testing/netjail_start_v2.sh
+++ b/src/testing/netjail_start_v2.sh
@@ -61,12 +61,12 @@ for N in $(seq $GLOBAL_N); do
# TODO Topology configuration must be enhanced to configure forwarding to more than one subnet node via different ports.
- if [ "1" == "${R_TCP[$N]}" ]
+ if [ -z "${R_TCP[$N]}" -a "1" == "${R_TCP[$N]}" ]
then
ip netns exec ${ROUTERS[$N]} iptables -t nat -A PREROUTING -p tcp -d $GLOBAL_GROUP.$N --dport 60002 -j DNAT --to $LOCAL_GROUP.1
ip netns exec ${ROUTERS[$N]} iptables -A FORWARD -d $LOCAL_GROUP.1 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
fi
- if [ "1" == "${R_UDP[$N]}" ]
+ if [ -z "${R_UDP[$N]}" -a "1" == "${R_UDP[$N]}" ]
then
ip netns exec ${ROUTERS[$N]} iptables -t nat -A PREROUTING -p udp -d $GLOBAL_GROUP.$N --dport 60002 -j DNAT --to $LOCAL_GROUP.1
ip netns exec ${ROUTERS[$N]} iptables -A FORWARD -d $LOCAL_GROUP.1 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT