Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save howardjones/11eabfb9ea1497a9d6b64368bda80059 to your computer and use it in GitHub Desktop.
Save howardjones/11eabfb9ea1497a9d6b64368bda80059 to your computer and use it in GitHub Desktop.
Allow intra-zone traffic with firewalld
#!/bin/sh
interfaces=$(firewall-cmd --info-zone=internal | grep interfaces | cut -d' ' -f 4-)
for a in $interfaces; do
for b in $interfaces; do
if [ $a != $b ]; then
echo "$a to $b"
firewall-cmd --permanent --direct --add-rule ipv4 filter FWDI_internal_allow 0 -o $a -i $b -j ACCEPT
echo "$b to $a"
firewall-cmd --permanent --direct --add-rule ipv4 filter FWDI_internal_allow 0 -o $b -i $a -j ACCEPT
fi
done
done
firewall-cmd --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment