From f05bf31083d07b282d97ba6e8f4c40860e2a3638 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sun, 20 Nov 2022 15:05:02 -0600 Subject: [PATCH] Improve sysctl settings - For enabling TCP BBR congestion control, add a check to make sure tcp_congestion_control exists. --- openvpn-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index b1dbd62..7ca2a4e 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -424,7 +424,8 @@ update_sysctl() { || { /bin/rm -f "$conf_opt"; touch "$conf_opt"; } # Enable TCP BBR congestion control if kernel version >= 4.20 if modprobe -q tcp_bbr \ - && printf '%s\n%s' "4.20" "$(uname -r)" | sort -C -V; then + && printf '%s\n%s' "4.20" "$(uname -r)" | sort -C -V \ + && [ -f /proc/sys/net/ipv4/tcp_congestion_control ]; then cat >> "$conf_opt" <<'EOF' net.core.default_qdisc = fq net.ipv4.tcp_congestion_control = bbr