Skip to content

Commit

Permalink
Add sndbuf and rcvbuf setting support to resolve slow UDP
Browse files Browse the repository at this point in the history
  • Loading branch information
Moshchev, Alex committed Oct 30, 2024
1 parent 58059bc commit 817dec5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions openvpn-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 817dec5

Please sign in to comment.