Skip to content

Commit

Permalink
use -legacy variant of iptables
Browse files Browse the repository at this point in the history
  • Loading branch information
toralf committed Aug 3, 2024
1 parent 6501e28 commit bda63cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
8 changes: 1 addition & 7 deletions ipv4-rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,7 @@ export PATH=/usr/sbin:/usr/bin:/sbin/:/bin

umask 066

if type iptables-legacy 1>/dev/null; then
ipt="iptables-legacy"
elif type iptables 1>/dev/null; then
ipt="iptables"
else
echo "can't find iptables executable" >&1
fi
ipt="iptables-legacy"
trustlist="tor-trust" # Tor authorities and snowflake servers
jobs=$((1 + $(nproc) / 2)) # parallel jobs of adding ips to an ipset
prefix=32 # any ipv4 address of this CIDR block is considered to belong to the same source/owner
Expand Down
8 changes: 1 addition & 7 deletions ipv6-rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,7 @@ export PATH=/usr/sbin:/usr/bin:/sbin/:/bin

umask 066

if type ip6tables-legacy 1>/dev/null; then
ipt="ip6tables-legacy"
elif type ip6tables 1>/dev/null; then
ipt="ip6tables"
else
echo "can't find ip6tables executable" >&1
fi
ipt="ip6tables-legacy"
trustlist="tor-trust6" # Tor authorities and snowflake servers
jobs=$((1 + $(nproc) / 2)) # parallel jobs of adding ips to an ipset
prefix=80 # any ipv6 address of this CIDR block is considered to belong to the same source/owner
Expand Down
4 changes: 2 additions & 2 deletions metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function printMetricsIptables() {
local tables4
local tables6

tables4=$(iptables -nvx -L INPUT -t filter) || return 1
tables6=$(ip6tables -nvx -L INPUT -t filter) || return 1
tables4=$(iptables-legacy -nvx -L INPUT -t filter) || return 1
tables6=$(ip6tables-legacy -nvx -L INPUT -t filter) || return 1

var="torutils_dropped_state_packets"
echo -e "# HELP $var Total number of dropped packets due to wrong TCP state\n# TYPE $var gauge"
Expand Down

0 comments on commit bda63cf

Please sign in to comment.