mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Detect and set best MTU, set some settings before status page
This commit is contained in:
parent
5cd9511df6
commit
910c6f5ee9
7 changed files with 88 additions and 19 deletions
17
openmptcprouter/files/bin/omr-mtu
Executable file
17
openmptcprouter/files/bin/omr-mtu
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
PKT_SIZE=1472
|
||||
INTERFACE="$1"
|
||||
HOSTNAME="$2"
|
||||
|
||||
count=$(ping -q -w 1 -M do -c 1 -s $PKT_SIZE -I $INTERFACE $HOSTNAME | grep -cE 'Message too long|100% packet loss')
|
||||
|
||||
while [ $count -eq 1 ]; do
|
||||
PKT_SIZE=$((PKT_SIZE - 1))
|
||||
if [ "$PKT_SIZE" -lt "1200" ]; then
|
||||
exit 0
|
||||
fi
|
||||
count=$(ping -q -w 1 -M do -c 1 -s $PKT_SIZE -I $INTERFACE $HOSTNAME | grep -cE 'Message too long|100% packet loss')
|
||||
done
|
||||
|
||||
printf "$((PKT_SIZE + 28))"
|
Loading…
Add table
Add a link
Reference in a new issue