From d190d23831dae1a77075557f2ff6e0c713d747d5 Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Mon, 11 Oct 2021 17:08:46 +0200 Subject: fixed unset port forwarding variable bug in netjail script, fixed end cmd without shutdown bug, smaller fixes --- src/testing/netjail_start_v2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/testing/netjail_start_v2.sh') 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 -- cgit v1.2.3