From 817dec5033bcc0a8a07e41c66c94d8ba0f5e2318 Mon Sep 17 00:00:00 2001 From: "Moshchev, Alex" Date: Tue, 29 Oct 2024 11:34:13 +0300 Subject: [PATCH] Add sndbuf and rcvbuf setting support to resolve slow UDP --- openvpn-install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openvpn-install.sh b/openvpn-install.sh index b9932d7..4bfb546 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -917,6 +917,8 @@ tls-version-min 1.2 tls-cipher $CC_CIPHER client-config-dir /etc/openvpn/ccd status /var/log/openvpn/status.log +#silence repeating messages +mute 20 verb 3" >>/etc/openvpn/server.conf # Create client-config-dir dir @@ -1030,6 +1032,10 @@ RemainAfterExit=yes [Install] WantedBy=multi-user.target" >/etc/systemd/system/iptables-openvpn.service + # resolve slow UDP traffic + sysctl -w net.core.rmem_max=${SRV_BUFF_SIZE_MAX:-8388608} # 8Mb + sysctl -w net.core.rmem_default=${SRV_BUFF_SIZE_DEFAULT:-262144} #256k + # Enable service and apply rules systemctl daemon-reload systemctl enable iptables-openvpn @@ -1064,6 +1070,9 @@ tls-version-min 1.2 tls-cipher $CC_CIPHER ignore-unknown-option block-outside-dns setenv opt block-outside-dns # Prevent Windows 10 DNS leak +mute 20 #silence repeating messages +sndbuf ${CLIENT_BUFF_SIZE:-262144} #Set the TCP/UDP socket send buffer size. Defaults to operating system default. +rcvbuf ${CLIENT_BUFF_SIZE:-262144} #Set the TCP/UDP socket receive buffer size. Defaults to operating system default. verb 3" >>/etc/openvpn/client-template.txt if [[ $COMPRESSION_ENABLED == "y" ]]; then