Created
October 17, 2024 09:06
-
-
Save parsibox/557a8e914637d9665f036466a3d5dec8 to your computer and use it in GitHub Desktop.
iptables remove duplicated rule
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
/sbin/iptables-save | awk '/^COMMIT$/ { delete x; }; !x[$0]++' > /tmp/iptables.conf | |
/sbin/iptables -F | |
/sbin/iptables-restore < /tmp/iptables.conf | |
/sbin/iptables-save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment