Created
July 11, 2017 18:40
-
-
Save funkjedi/88c31179d455b9c6edb2b31b9564ede1 to your computer and use it in GitHub Desktop.
Remove UFW chains
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 | |
for ufw in `iptables -L | grep 'Chain ufw' | awk '{ print $2 }'`; do iptables -F $ufw; done | |
for ufw in `iptables -L | grep 'Chain ufw' | awk '{ print $2 }'`; do | |
iptables -D INPUT -j $ufw | |
iptables -D FORWARD -j $ufw | |
iptables -D OUTPUT -j $ufw | |
done | |
for ufw in `iptables -L | grep 'Chain ufw' | awk '{ print $2 }'`; do iptables -X $ufw; done |
Helped me a lot ! Thx mate !
If you delete some rules e.g. iptables -D INPUT -j $ufw
how do I get UFW to remember the changes on reboot? What command do I send to UFW?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. Helped me, cause I wanted to clean up.