Last active
September 20, 2017 06:55
-
-
Save alexesDev/2888fd9dd2ea548712d91ff3ac25cd65 to your computer and use it in GitHub Desktop.
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/bash | |
ADDR=$1 | |
echo $ADDR | |
firewall-cmd --permanent --zone=drop --add-rich-rule=" | |
rule family='ipv4' | |
source address=${ADDR} | |
port protocol='tcp' port='2377' accept" | |
firewall-cmd --permanent --zone=drop --add-rich-rule=" | |
rule family='ipv4' | |
source address=${ADDR} | |
port protocol='tcp' port='7946' accept" | |
firewall-cmd --permanent --zone=drop --add-rich-rule=" | |
rule family='ipv4' | |
source address=${ADDR} | |
port protocol='udp' port='7946' accept" | |
firewall-cmd --permanent --zone=drop --add-rich-rule=" | |
rule family='ipv4' | |
source address=${ADDR} | |
port protocol='udp' port='4789' accept" |
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/bash | |
ADDR=$1 | |
echo $ADDR | |
iptables -I INPUT -p tcp -s $ADDR --dport 2377 -j ACCEPT | |
iptables -I INPUT -p tcp -s $ADDR --dport 7946 -j ACCEPT | |
iptables -I INPUT -p udp -s $ADDR --dport 7946 -j ACCEPT | |
iptables -I INPUT -p udp -s $ADDR --dport 4789 -j ACCEPT |
Author
alexesDev
commented
Sep 20, 2017
•
firewall-cmd --list-all | grep 'rule fam' | xargs -L 1 -I{} -- firewall-cmd --permanent --zone=drop --remove-rich-rule='{}'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment