Created
November 16, 2023 18:41
-
-
Save kindejak/139820ab59a88245a7c5b0449e970da8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| ## save existing rules | |
| sudo iptables-save > ~/iptables-rules | |
| ## modify rules, remove drop and reject lines | |
| grep -v "DROP" iptables-rules > tmpfile && mv tmpfile iptables-rules-mod | |
| grep -v "REJECT" iptables-rules-mod > tmpfile && mv tmpfile iptables-rules-mod | |
| ## apply the modifications | |
| sudo iptables-restore < ~/iptables-rules-mod | |
| ## check | |
| sudo iptables -L | |
| ## save the changes | |
| sudo netfilter-persistent save | |
| sudo systemctl restart iptables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment