Created
May 30, 2019 19:51
-
-
Save howardjones/11eabfb9ea1497a9d6b64368bda80059 to your computer and use it in GitHub Desktop.
Allow intra-zone traffic with firewalld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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