├── .gitattributes ├── 10-monitor-mtu.sh ├── 11-change-mtu.sh └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /10-monitor-mtu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /mnt/data/11-change-mtu.sh & -------------------------------------------------------------------------------- /11-change-mtu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | function check_mtu { 3 | ip link list | grep -E 'br.:|br..:' | grep 'mtu 9216' > /dev/null; 4 | } 5 | while true; do 6 | if check_mtu; then 7 | echo "MTU is configured" > /dev/null 8 | else 9 | echo "Reconfiguring MTU" > /dev/null 10 | interfaces=$(ip link list | grep -i switch | sed 's/^[^:]*://g; s/:.*//; s/@switch0.*//') 11 | sfp=$(ip link list | grep -i eth10 | sed 's/^[^:]*://g; s/:.*//; s/@eth10.*//') 12 | for interface in $interfaces 13 | do 14 | ip link set dev $interface mtu 9216 15 | done 16 | for sfp in $sfp 17 | do 18 | ip link set dev $sfp mtu 9216 19 | done 20 | fi 21 | sleep 5 22 | done 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UDMP Monitor MTU 2 | 3 | # Ubiquiti has added this as a part of the 1.12.13 EA firmware. This repository is now archived 4 | 5 | UDMP Monitor MTU is a shell script that checks all VLAN interfaces and LAN SFP+ ports on the UDM Pro and sets them to 9216. This allows for intervlan routing to take place without being fragmented. This runs every 5 seconds but can be modified if you change the sleep values in the script. 6 | 7 | ## Pre-Requisites 8 | UDMP has to have the Boot script installed from this repo https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script 9 | 10 | 11 | ## Installation 12 | 13 | 1. Place the 10-monitor-mtu.sh in /mnt/data/on_boot.d/ folder and mark it as executable 14 | 2. Place the 11-change-mtu.sh in the /mnt/data folder and mark it as exectable 15 | 16 | ```bash 17 | chmod +x /mnt/data/on_boot.d/10-monitor-mtu.sh 18 | chmod +x /mnt/data/11-change-mtu.sh 19 | ``` 20 | 21 | ## Contributing 22 | Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. 23 | 24 | Please make sure to update tests as appropriate. 25 | 26 | ## License 27 | [MIT](https://choosealicense.com/licenses/mit/) 28 | --------------------------------------------------------------------------------