1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Various fix for IPv6, disable Shadowsocks for IPv6 with ss-redir

This commit is contained in:
Ycarus 2019-01-13 11:10:05 +01:00
parent 0ef3754412
commit 5b10fe3bd5
8 changed files with 58 additions and 15 deletions

View file

@ -178,6 +178,33 @@ function wizard_add()
local downloadspeed = luci.http.formvalue("cbid.sqm.%s.download" % intf) or "0"
local uploadspeed = luci.http.formvalue("cbid.sqm.%s.upload" % intf) or "0"
if ucic:get("qos",intf) == "" then
ucic:set("qos",intf,"interface")
ucic:set("qos",intf,"classgroup","Default")
ucic:set("qos",intf,"enabled","0")
ucic:set("qos",intf,"upload","4000")
ucic:set("qos",intf,"download","100000")
end
if ucic:get("sqm",intf) == "" then
local defif = ucic:get("network",intf .. "_dev","ifname") or ""
if defif == "" then
defif = ucic:get("network",intf,"ifname") or ""
end
ucic:set("sqm",intf,"queue")
ucic:set("sqm",intf,"interface",defif)
ucic:set("sqm",intf,"qdisc","fq_codel")
ucic:set("sqm",intf,"script","simple.qos")
ucic:set("sqm",intf,"qdisc_advanced","0")
ucic:set("sqm",intf,"linklayer","none")
ucic:set("sqm",intf,"enabled","0")
ucic:set("sqm",intf,"debug_logging","0")
ucic:set("sqm",intf,"verbosity","5")
ucic:set("sqm",intf,"download","0")
ucic:set("sqm",intf,"upload","0")
end
if downloadspeed ~= "0" and uploadspeed ~= "0" then
ucic:set("sqm",intf,"download",downloadspeed)
ucic:set("sqm",intf,"upload",uploadspeed)

View file

@ -41,6 +41,7 @@ set_ipv6_state() {
else
uci -q set shadowsocks-libev.hi.local_address="::"
fi
uci -q commit shadowsocks-libev
uci -q commit dhcp
#if [ "$disable_ipv6" == "1" ]; then
# /etc/init.d/odhcpd stop >/dev/null 2>&1
@ -76,9 +77,10 @@ start_service() {
done
}
config_get disable_ipv6 settings disable_ipv6 "0"
if [ "$(sysctl net.ipv6.conf.all.disable_ipv6 | tr -d '\n')" != "$disable_ipv6" ]; then
if [ "$(uci -q get firewall.@defaults[0].disable_ipv6)" != "$disable_ipv6" ]; then
set_ipv6_state $disable_ipv6
fi
# remove sysctl already defined in /etc/sysctl.d/
sed -i -e '/tcp_fin_timeout/d' -e '/tcp_keepalive_time/d' -e '/nf_conntrack_max/d' -e '/tcp_syn_retries/d' /etc/sysctl.conf
sed -i -e '/tcp_fin_timeout/d' -e '/tcp_keepalive_time/d' -e '/nf_conntrack_max/d' -e '/tcp_syn_retries/d' /etc/sysctl.d/10-default.conf