mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add ttl setting support
This commit is contained in:
parent
ac8c81718b
commit
806bc40980
2 changed files with 22 additions and 0 deletions
14
openmptcprouter/files/etc/firewall.ttl
Normal file
14
openmptcprouter/files/etc/firewall.ttl
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
_set_ttl() {
|
||||
device=$(uci -q get network.$1.name)
|
||||
ttl=$(uci -q get network.$1.ttl)
|
||||
if [ -n "$ttl" ] && [ -z "$(iptables-save | grep TTL | grep $device)" ]; then
|
||||
iptables -w -t mangle -I POSTROUTING -o $device -j TTL --ttl-set $ttl 2>&1 >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach _set_ttl device
|
Loading…
Add table
Add a link
Reference in a new issue