diff --git a/hostmngr/files/scripts/hosts_acl.sh b/hostmngr/files/scripts/hosts_acl.sh index b2a9aeeb9..89c4eb237 100755 --- a/hostmngr/files/scripts/hosts_acl.sh +++ b/hostmngr/files/scripts/hosts_acl.sh @@ -277,11 +277,15 @@ touch $ACL_FILE echo "iptables -w -F hosts_forward" >> $ACL_FILE echo "ip6tables -w -F hosts_forward" >> $ACL_FILE -hosts_forward=$(iptables -t filter --list | grep hosts_forward) -if [ -z "$hosts_forward" ]; then +hosts_ipv4_forward=$(iptables -t filter --list -n | grep hosts_forward) +if [ -z "$hosts_ipv4_forward" ]; then echo "iptables -w -t filter -N hosts_forward" >> $ACL_FILE ret=$? [ $ret -eq 0 ] && echo "iptables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE +fi + +hosts_ipv6_forward=$(ip6tables -t filter --list -n | grep hosts_forward) +if [ -z "$hosts_ipv6_forward" ]; then echo "ip6tables -w -t filter -N hosts_forward" >> $ACL_FILE ret=$? [ $ret -eq 0 ] && echo "ip6tables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE