This commit is contained in:
ling 2024-05-13 23:06:48 +08:00
parent 418a35a011
commit e50b4b3e97
6 changed files with 27 additions and 3 deletions

View File

@ -26,6 +26,11 @@ o = s:option(Flag, "manual_configuration", font_red..bold_on..translate("Manual
o.rmempty = false
o.description = translate("Enable the manual configuration of modem information").." "..font_red..bold_on.. translate("(After enable, the automatic scanning and configuration function for modem information will be disabled)")..bold_off..font_off
-- 启用网络接口别名
o = s:option(Flag, "network_interface_alias", translate("Network Interface Alias"))
o.rmempty = false
o.description = translate("Enable network interfaces with alias names")
-- 配置模组信息
s = m:section(TypedSection, "modem-device", translate("Modem Config"))
s.anonymous = true

View File

@ -586,6 +586,12 @@ msgstr "启用手动配置模组信息"
msgid "(After enable, the automatic scanning and configuration function for modem information will be disabled)"
msgstr "(启用后将禁用自动扫描并配置模组信息功能)"
msgid "Network Interface Alias"
msgstr "网络接口别名"
msgid "Enable network interfaces with alias names"
msgstr "启用网络接口为别名形式"
msgid "Not null"
msgstr "不能为空"

View File

@ -586,6 +586,12 @@ msgstr "启用手动配置模组信息"
msgid "(After enable, the automatic scanning and configuration function for modem information will be disabled)"
msgstr "(启用后将禁用自动扫描并配置模组信息功能)"
msgid "Network Interface Alias"
msgstr "网络接口别名"
msgid "Enable network interfaces with alias names"
msgstr "启用网络接口为别名形式"
msgid "Not null"
msgstr "不能为空"

View File

@ -2,4 +2,5 @@
config global 'global'
option enable_dial '1'
option modem_number '0'
option manual_configuration '0'
option manual_configuration '0'
option network_interface_alias '1'

View File

@ -177,8 +177,13 @@ set_ipv4v6_interface()
#设置IPV4网络接口
set_ipv4_interface "${ipv4_interface_name}" "${network_interface}"
#设置IPV6网络接口别名
set_ipv6_interface "${ipv6_interface_name}" "@${ipv4_interface_name}"
#设置IPV6网络接口
local network_interface_alias=$(uci -q get modem.@global[0].network_interface_alias)
case $pdp_type in
"0") set_ipv6_interface "${ipv6_interface_name}" "${network_interface}" ;;
"1") set_ipv6_interface "${ipv6_interface_name}" "@${ipv4_interface_name}" ;; #别名
esac
}
#设置网络接口

View File

@ -6,6 +6,7 @@ uci -q get modem.global >/dev/null || uci -q batch <<-EOF >/dev/null
set modem.@global[0].enable_dial=1
set modem.@global[0].modem_number=0
set modem.@global[0].manual_configuration=0
set modem.@global[0].network_interface_alias=1
commit modem
EOF