Created
July 25, 2024 12:33
-
-
Save shaposhnikoff/e433cafb170d8c06c2c8e6c20ae8694a to your computer and use it in GitHub Desktop.
pi-star preparation to normal work
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 | |
# Flush all rules | |
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -t raw -F | |
iptables -t raw -X | |
# Set default policies to accept | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT | |
iptables -P OUTPUT ACCEPT | |
# Save the flushed rules | |
iptables-save > /etc/iptables/rules.v4 | |
# Unload netfilter modules | |
modprobe -r iptable_filter | |
modprobe -r iptable_nat | |
modprobe -r iptable_mangle | |
modprobe -r iptable_raw | |
modprobe -r nf_conntrack | |
modprobe -r nf_conntrack_ipv4 | |
modprobe -r x_tables | |
echo "Iptables flushed and disabled. Modules unloaded." | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment