Switch to nft interface by default
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
# Flush iptables (Code from archlinux)
|
||||
iptables=ip$1tables
|
||||
if ! type -p "$iptables" &>/dev/null; then
|
||||
echo "error: invalid argument"
|
||||
exit 1
|
||||
#!/bin/sh
|
||||
# Usage: iptables-flush [-6]
|
||||
|
||||
iptables=/usr/sbin/iptables
|
||||
tables="filter mangle raw"
|
||||
|
||||
if [ "$1" = "-6" ]; then
|
||||
iptables=/usr/bin/ip6tables
|
||||
else
|
||||
# Only ipv4 has a nat table
|
||||
tables="$tables nat"
|
||||
fi
|
||||
|
||||
while read -r table; do
|
||||
tables+=("/usr/share/iptables/empty-$table.rules")
|
||||
done <"/proc/net/ip$1_tables_names"
|
||||
for table in ${tables}; do
|
||||
$iptables -t "$table" -F
|
||||
$iptables -t "$table" -X
|
||||
done
|
||||
|
||||
if (( ${#tables[*]} )); then
|
||||
cat "${tables[@]}" | "$iptables-restore"
|
||||
fi
|
||||
for chain in INPUT FORWARD OUTPUT; do
|
||||
$iptables -P "$chain" ACCEPT
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user