Skip to content

Commit 708d5fa

Browse files
authored
feat(ns-plug): added custom MTU support (#1311)
1 parent 2615948 commit 708d5fa

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

packages/ns-plug/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ uci commit rsyslog
5353
rm -f /usr/share/ns-plug/client.conf
5454
```
5555

56+
### MTU management
57+
58+
In some cases the VPN connection may not work properly due to MTU issues.
59+
You can custom set the MTU values by:
60+
```
61+
uci set ns-plug.config.tun_mtu=<value>
62+
uci set ns-plug.config.mssfix=<value>
63+
uci commit ns-plug
64+
reload_config
65+
```
66+
5667
## Machine registration
5768

5869
To register a machine:

packages/ns-plug/files/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ config main 'config'
77
option backup_url 'https://backupd.nethesis.it'
88
option repository_url 'https://updates.nethsecurity.nethserver.org'
99
option channel ''
10+
option tun_mtu ''
11+
option mssfix ''

packages/ns-plug/files/ns-plug

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ auth-nocache
136136
verb 3
137137
EOF
138138

139+
tun_mtu="$(uci -q get ${UCI_CONF}.config.tun_mtu)"
140+
mssfix="$(uci -q get ${UCI_CONF}.config.mssfix)"
141+
if [ -n "${tun_mtu}" ] && [ -n "${mssfix}" ]; then
142+
echo "tun-mtu ${tun_mtu}" >> ${CONFIG_FILE}
143+
echo "mssfix ${mssfix}" >> ${CONFIG_FILE}
144+
else
145+
echo "mtu-test" >> ${CONFIG_FILE}
146+
fi
147+
139148
# Configure rsyslog to send to promtail
140149
uci set rsyslog.promtail=forwarder
141150
uci set rsyslog.promtail.source=*.*

packages/ns-plug/files/ns-plug.init

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ service_triggers()
3232
{
3333
procd_add_reload_trigger "ns-plug"
3434
}
35+
36+
reload_service()
37+
{
38+
stop
39+
start
40+
}

0 commit comments

Comments
 (0)