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
|
|
@ -150,6 +150,14 @@ if [ "$(uci -q get firewall.gre_tunnel)" = "" ]; then
|
|||
commit firewall
|
||||
EOF
|
||||
fi
|
||||
if [ "$(uci -q get firewall.ttl)" = "" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set firewall.ttl=include
|
||||
set firewall.ttl.path=/etc/firewall.ttl
|
||||
set firewall.ttl.reload=1
|
||||
commit firewall
|
||||
EOF
|
||||
fi
|
||||
if [ "$(uci -q get firewall.fwlantovpn)" = "" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set firewall.zone_lan.auto_helper='0'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue