block outgoing traffic matching string

sudo iptables -I OUTPUT -p tcp --dport 443 -m string --string "" --algo kmp -j DROP
sudo iptables -I INPUT -p tcp --dport 443 -m string --string "" --algo kmp -j REJECT

list all iptable rules with linenumbers

sudo iptables -L --line-numbers

delete specific iptable rule on linenumber and Chain

sudo iptables -D OUTPUT 1

Allow established connections

sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

Allow connections from subnet to certain port

iptables -I INPUT -p tcp -s --dport 6556 -j ACCEPT