ports in pair

This commit is contained in:
2023-05-15 06:50:22 +00:00
parent 46fde8a19f
commit 18c275bf73

View File

@@ -354,6 +354,10 @@ COUNT_SOURCE_PORT=$(set |grep SOURCE_PORT |wc -l)
COUNT_TARGET_IP=$(set |grep TARGET_IP |wc -l)
COUNT_TARGET_PORT=$(set |grep TARGET_PORT |wc -l)
# SOURCE AND TARGET PORTS ARE IN PAIRS
if [ "$COUNT_SOURCE_PORT" == "$COUNT_TARGET_PORT" ]; then PAIRS="1";
else PAIRS="0";
if [ "$COUNT_SOURCE_IP" == 0 ] ; then COUNT_SOURCE_IP=1 ; fi
for source_ip_index in $(seq 1 $COUNT_SOURCE_IP) ; do
if set |grep SOURCE_IP_ ; then
@@ -378,6 +382,11 @@ for source_ip_index in $(seq 1 $COUNT_SOURCE_IP) ; do
TARGET_PORT=$(eval "echo \${"TARGET_PORT_$target_port_index"}")
fi
# if case of pairs if indexes doesn't match then omit routing
if [ "$PAIRS" == "1"] && [ "$source_port_index" != "$target_port_index" ] ; then
continue;
fi;
#############################
# NSENTER Specific settings #