#!/bin/bash
set -x
systemctl restart firewalld
systemctl show firewalld -p ActiveState
firewall-cmd --state
firewall-cmd --permanent --new-ipset=set_ipv4 --type 'hash:ip'
# correct rule is:                           ipv4 filter OUTPUT 10 -m set --match-set set_ipv4 dst -p tcp --dport 4210 -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 15 -m set --match-set set_ipv4 -p tcp --dport 4215 -j ACCEPT
systemctl restart firewalld
systemctl show firewalld -p ActiveState
firewall-cmd --state
rm -f /etc/firewalld/direct.xml /etc/firewalld/ipsets/set_ipv4.xml
