mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-09 02:43:53 +08:00
luci-app-sfe/luci-app-flowoffload: add Fullcone NAT control
This commit is contained in:
parent
58331a606f
commit
a0f865eb5f
@ -26,6 +26,11 @@ hw.rmempty = true
|
|||||||
hw.description = translate("Enable Hardware NAT (depends on hw capability like MTK 762x)")
|
hw.description = translate("Enable Hardware NAT (depends on hw capability like MTK 762x)")
|
||||||
hw:depends("flow_offloading", 1)
|
hw:depends("flow_offloading", 1)
|
||||||
|
|
||||||
|
fc = s:option(Flag, "fullcone_nat", translate("Fullcone NAT"))
|
||||||
|
fc.default = 1
|
||||||
|
fc.rmempty = true
|
||||||
|
fc.description = translate("Enable Fullcone NAT")
|
||||||
|
|
||||||
bbr = s:option(Flag, "bbr", translate("Enable BBR"))
|
bbr = s:option(Flag, "bbr", translate("Enable BBR"))
|
||||||
bbr.default = 0
|
bbr.default = 0
|
||||||
bbr.rmempty = false
|
bbr.rmempty = false
|
||||||
|
@ -22,6 +22,9 @@ msgstr "开启 Flow Offloading 转发加速. (降低CPU占用 / 增强路由转
|
|||||||
msgid "Enable Hardware NAT (depends on hw capability like MTK 762x)"
|
msgid "Enable Hardware NAT (depends on hw capability like MTK 762x)"
|
||||||
msgstr "启用硬件HWNAT加速(依赖特定的硬件,例如 MTK 762x 系列)"
|
msgstr "启用硬件HWNAT加速(依赖特定的硬件,例如 MTK 762x 系列)"
|
||||||
|
|
||||||
|
msgid "Enable Fullcone NAT"
|
||||||
|
msgstr "启用 Fullcone NAT"
|
||||||
|
|
||||||
msgid "Enable BBR"
|
msgid "Enable BBR"
|
||||||
msgstr "启用 BBR"
|
msgstr "启用 BBR"
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config flow
|
config flow
|
||||||
option flow_offloading '0'
|
option flow_offloading '0'
|
||||||
option flow_offloading_hw '0'
|
option flow_offloading_hw '0'
|
||||||
|
option fullcone_nat '1'
|
||||||
option bbr '0'
|
option bbr '0'
|
||||||
option dns '0'
|
option dns '0'
|
||||||
option dnscache_enable '1'
|
option dnscache_enable '1'
|
||||||
|
@ -255,6 +255,7 @@ start_service(){
|
|||||||
|
|
||||||
uci set firewall.@defaults[0].flow_offloading=$(uci get flowoffload.@flow[0].flow_offloading)
|
uci set firewall.@defaults[0].flow_offloading=$(uci get flowoffload.@flow[0].flow_offloading)
|
||||||
uci set firewall.@defaults[0].flow_offloading_hw=$(uci get flowoffload.@flow[0].flow_offloading_hw)
|
uci set firewall.@defaults[0].flow_offloading_hw=$(uci get flowoffload.@flow[0].flow_offloading_hw)
|
||||||
|
uci set firewall.@defaults[0].fullcone=$(uci get flowoffload.@flow[0].fullcone_nat)
|
||||||
uci commit firewall
|
uci commit firewall
|
||||||
if [ "$DNSMASQ_RESTART" = N ]; then
|
if [ "$DNSMASQ_RESTART" = N ]; then
|
||||||
/etc/init.d/dnsmasq restart && echo "DNSMASQ change"
|
/etc/init.d/dnsmasq restart && echo "DNSMASQ change"
|
||||||
|
@ -20,6 +20,11 @@ enable.default = 0
|
|||||||
enable.rmempty = false
|
enable.rmempty = false
|
||||||
enable.description = translate("Enable Fast Path offloading for connections. (decrease cpu load / increase routing throughput)")
|
enable.description = translate("Enable Fast Path offloading for connections. (decrease cpu load / increase routing throughput)")
|
||||||
|
|
||||||
|
fc = s:option(Flag, "fullcone_nat", translate("Fullcone NAT"))
|
||||||
|
fc.default = 1
|
||||||
|
fc.rmempty = false
|
||||||
|
fc.description = translate("Enable Fullcone NAT")
|
||||||
|
|
||||||
wifi = s:option(Flag, "wifi", translate("Bridge Acceleration"))
|
wifi = s:option(Flag, "wifi", translate("Bridge Acceleration"))
|
||||||
wifi.default = 0
|
wifi.default = 0
|
||||||
wifi.rmempty = false
|
wifi.rmempty = false
|
||||||
|
@ -22,6 +22,9 @@ msgstr "启用 SFE Fast Path 加速"
|
|||||||
msgid "Enable Fast Path offloading for connections. (decrease cpu load / increase routing throughput)"
|
msgid "Enable Fast Path offloading for connections. (decrease cpu load / increase routing throughput)"
|
||||||
msgstr "开启 Fast Path 转发加速. (降低CPU占用 / 增强路由转发性能,和多WAN或者QOS功能可能会冲突)"
|
msgstr "开启 Fast Path 转发加速. (降低CPU占用 / 增强路由转发性能,和多WAN或者QOS功能可能会冲突)"
|
||||||
|
|
||||||
|
msgid "Enable Fullcone NAT"
|
||||||
|
msgstr "开启 Fullcone NAT"
|
||||||
|
|
||||||
msgid "Bridge Acceleration"
|
msgid "Bridge Acceleration"
|
||||||
msgstr "桥接加速"
|
msgstr "桥接加速"
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
config sfe
|
config sfe
|
||||||
option enabled '0'
|
option enabled '0'
|
||||||
|
option fullcone_nat '1'
|
||||||
option ipv6 '0'
|
option ipv6 '0'
|
||||||
option wifi '0'
|
option wifi '0'
|
||||||
option bbr '0'
|
option bbr '0'
|
||||||
|
@ -275,8 +275,12 @@ start_service() {
|
|||||||
sysctl -w net.ipv4.tcp_congestion_control=cubic
|
sysctl -w net.ipv4.tcp_congestion_control=cubic
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
uci set firewall.@defaults[0].fullcone=$(uci get sfe@sfe[0].fullcone_nat)
|
||||||
|
uci commit firewall
|
||||||
|
|
||||||
if [ "$DNSMASQ_RESTART" = N ]; then
|
if [ "$DNSMASQ_RESTART" = N ]; then
|
||||||
/etc/init.d/dnsmasq restart
|
/etc/init.d/dnsmasq restart
|
||||||
|
/etc/init.d/firewall restart
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,6 +292,7 @@ stop_service(){
|
|||||||
kill -9 $(ps | grep dnscache-while.sh | grep -v "grep" | awk '{print $1}') >/dev/null 2>&1
|
kill -9 $(ps | grep dnscache-while.sh | grep -v "grep" | awk '{print $1}') >/dev/null 2>&1
|
||||||
if [ "$DNSMASQ_RESTART" = N ]; then
|
if [ "$DNSMASQ_RESTART" = N ]; then
|
||||||
/etc/init.d/dnsmasq restart
|
/etc/init.d/dnsmasq restart
|
||||||
|
/etc/init.d/firewall restart
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,4 +301,5 @@ restart(){
|
|||||||
stop
|
stop
|
||||||
start
|
start
|
||||||
/etc/init.d/dnsmasq restart && echo "DNSMASQ restart"
|
/etc/init.d/dnsmasq restart && echo "DNSMASQ restart"
|
||||||
|
/etc/init.d/firewall restart
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user