From eb87da4feb233cc90a6261223d064db408e87f77 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Mon, 14 Mar 2022 20:57:38 +0100 Subject: [PATCH 1/2] Add network modems configuration for RUTX12 --- .../files/etc/uci-defaults/1920-omr-network | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/openmptcprouter/files/etc/uci-defaults/1920-omr-network b/openmptcprouter/files/etc/uci-defaults/1920-omr-network index c8be3490a..18726e3f0 100755 --- a/openmptcprouter/files/etc/uci-defaults/1920-omr-network +++ b/openmptcprouter/files/etc/uci-defaults/1920-omr-network @@ -306,6 +306,54 @@ sed -i 's/omrip/oip/g' /etc/config/* uci -q delete network.loopback.ifname uci -q set network.loopback.device='lo' +local board=$(board_name) +if [ "$board" = "teltonika,rutx" ] && [ -f /sbin/mnf_info ] && [ "$(mnf_info -n)" = "RUTX1200XXXX" ]; then + uci -q batch <<-EOF + set network.modem1=interface + set network.modem1.proto='modemmanager' + set network.modem1.apn='' + set network.modem1.auth='none' + set network.modem1.iptype='ipv4v6' + set network.modem1.addlatency='0' + set network.modem1.force_link='1' + set network.modem1.device='/sys/devices/platform/soc/60f8800.usb2/6000000.dwc3/xhci-hcd.1.auto/usb3/3-1' + set network.wan_modem1=interface + set network.wan_modem1.proto='dhcp' + set network.wan_modem1.device='wwan0' + set network.wan_modem1.force_link='1' + set network.wan_modem1.multipath='on' + set network.wan_modem1.addlatency='0' + set network.wan_modem1.hostname='*' + set network.wan_modem1.defaultroute='0' + set network.wan_modem1.peerdns='0' + set network.wan_modem1.ip4table=wan + commit network + add_list firewall.@zone[1].network='wan_modem1' + commit firewall + set network.modem2=interface + set network.modem2.proto='modemmanager' + set network.modem2.apn='' + set network.modem2.auth='none' + set network.modem2.iptype='ipv4v6' + set network.modem2.addlatency='0' + set network.modem2.force_link='1' + set network.modem2.device='/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.2' + set network.wan_modem2=interface + set network.wan_modem2.proto='dhcp' + set network.wan_modem2.device='wwan1' + set network.wan_modem2.force_link='1' + set network.wan_modem2.multipath='on' + set network.wan_modem2.addlatency='0' + set network.wan_modem2.hostname='*' + set network.wan_modem2.defaultroute='0' + set network.wan_modem2.peerdns='0' + set network.wan_modem2.ip4table=wan + commit network + add_list firewall.@zone[1].network='wan_modem2' + commit firewall + EOF +fi + uci -q commit macvlan uci -q commit network rm -f /tmp/luci-indexcache From a4d9f6dd39fa9bfa7e761085405bc64cafe1eedf Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 16 Mar 2022 20:54:34 +0100 Subject: [PATCH 2/2] Fix status page when proto is modemmanager --- luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter index a06035f7f..f8ac6eca0 100755 --- a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter +++ b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter @@ -1160,7 +1160,7 @@ function interfaces_status() --end duplicateif = false - if ifname ~= "" and ifname ~= nil and not (section["device"] ~= nil and section["device"]:match("^@.*")) then + if ifname ~= "" and ifname ~= nil and not (section["device"] ~= nil and section["device"]:match("^@.*")) and (proto == "static" or proto == "dhcp") then if allintf[ifname] then connectivity = "ERROR" duplicateif = true