diff --git a/dsvpn/files/init b/dsvpn/files/init index 250c409df..1d78ed4be 100755 --- a/dsvpn/files/init +++ b/dsvpn/files/init @@ -49,7 +49,7 @@ start_instance() { key="" if [ "$(uci -q get network.omrvpn)" != "" ] && [ "$(uci -q get network.omrvpn)" != "$dev" ]; then - uci -q set network.omrvpn.ifname=$dev + uci -q set network.omrvpn.device=$dev uci -q commit fi diff --git a/glorytun-udp/init b/glorytun-udp/init index e9f7caf7c..f5086024f 100755 --- a/glorytun-udp/init +++ b/glorytun-udp/init @@ -50,7 +50,7 @@ start_instance() { key="" if [ "$(uci -q get network.omrvpn)" != "" ]; then - uci -q set network.omrvpn.ifname=$dev + uci -q set network.omrvpn.device=$dev uci -q commit fi diff --git a/glorytun/init b/glorytun/init index f5b868323..3d549f0aa 100755 --- a/glorytun/init +++ b/glorytun/init @@ -59,7 +59,7 @@ start_instance() { key="" if [ "$(uci -q get network.omrvpn)" != "" ]; then - uci -q set network.omrvpn.ifname=${dev} + uci -q set network.omrvpn.device=${dev} uci -q commit network fi _log "starting ${PROG_NAME} ${1} instance $*" diff --git a/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun b/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun index 9d0f93d85..e78973fe0 100644 --- a/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun +++ b/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun @@ -15,7 +15,7 @@ if [ "$(uci -q get network.glorytun)" = "" ] && [ "$(uci -q get network.omrvpn)" uci -q batch <<-EOF >/dev/null delete network.glorytun set network.glorytun=interface - set network.glorytun.ifname=tun0 + set network.glorytun.device=tun0 set network.glorytun.proto=dhcp set network.glorytun.ip4table=vpn set network.glorytun.multipath=off @@ -48,6 +48,7 @@ if [ "$(uci -q show firewall | grep Allow-All-LAN-to-VPN)" = "" ]; then set firewall.@rule[-1].name='Allow-All-LAN-to-VPN' set firewall.@rule[-1].dest='vpn' set firewall.@rule[-1].src='lan' + set firewall.@rule[-1].proto='all' commit firewall EOF fi diff --git a/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp b/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp index dbecf5b5b..ebe335318 100644 --- a/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp +++ b/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp @@ -11,7 +11,7 @@ if [ "$(uci -q get network.glorytun-udp)" = "" ] && [ "$(uci -q get network.omrv uci -q batch <<-EOF >/dev/null delete network.glorytun-udp set network.glorytun-udp=interface - set network.glorytun-udp.ifname=tun0 + set network.glorytun-udp.device=tun0 set network.glorytun-udp.proto=dhcp set network.glorytun-udp.ip4table=vpn set network.glorytun-udp.multipath=off diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 3d243b210..cca82d950 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -26,7 +26,11 @@ end function interface_from_device(dev) for _, iface in ipairs(net:get_networks()) do local ifacen = iface:name() - local ifacename = ucic:get("network",ifacen,"ifname") + local ifacename = "" + ifacename = ucic:get("network",ifacen,"device") + if ifacename == "" then + ifacename = ucic:get("network",ifacen,"ifname") + end if ifacename == dev then return ifacen end @@ -113,7 +117,10 @@ function wizard_add() end) local defif = "eth0" if add_interface_ifname == "" then - local defif1 = ucic:get("network","wan1_dev","ifname") or "" + local defif1 = ucic:get("network","wan1_dev","device") or "" + if defif1 == "" then + defif1 = ucic:get("network","wan1_dev","ifname") or "" + end if defif1 ~= "" then defif = defif1 end @@ -126,17 +133,29 @@ function wizard_add() if ointf ~= "" then if ucic:get("network",ointf,"type") == "" then ucic:set("network",ointf,"type","macvlan") + ucic:set("network",ointf,"device",ointf) + ucic:set("network",ointf .. "_dev","device") + ucic:set("network",ointf .. "_dev","type","macvlan") + ucic:set("network",ointf .. "_dev","mode","vepa") + ucic:set("network",ointf .. "_dev","ifname",defif) + ucic:set("network",ointf .. "_dev","name",ointf) end wanif = "wan" .. i end ucic:set("network","wan" .. i,"interface") - ucic:set("network","wan" .. i,"ifname",defif) + ucic:set("network","wan" .. i,"device",defif) ucic:set("network","wan" .. i,"proto","static") ucic:set("openmptcprouter","wan" .. i,"interface") if ointf ~= "" then ucic:set("network","wan" .. i,"type","macvlan") + ucic:set("network","wan" .. i,"device","wan" .. i) ucic:set("network","wan" .. i,"masterintf",defif) + ucic:set("network","wan" .. i .. "_dev","device") + ucic:set("network","wan" .. i .. "_dev","type","macvlan") + ucic:set("network","wan" .. i .. "_dev","mode","vepa") + ucic:set("network","wan" .. i .. "_dev","ifname",defif) + ucic:set("network","wan" .. i .. "_dev","name","wan" .. i) end ucic:set("network","wan" .. i,"ip4table","wan") if multipath_master then @@ -197,7 +216,10 @@ function wizard_add() local delete_intf = luci.http.formvaluetable("delete") or "" if delete_intf ~= "" then for intf, _ in pairs(delete_intf) do - local defif = ucic:get("network",intf,"ifname") + local defif = ucic:get("network",intf,"ifname") or "" + if defif == "" then + defif = ucic:get("network",intf,"ifname") + end ucic:delete("network",intf) if ucic:get("network",intf .. "_dev") ~= "" then ucic:delete("network",intf .. "_dev") @@ -262,9 +284,14 @@ function wizard_add() end if typeintf == "macvlan" and masterintf ~= "" then ucic:set("network",intf,"type","macvlan") + ucic:set("network",intf .. "_dev","device") + ucic:set("network",intf .. "_dev","type","macvlan") + ucic:set("network",intf .. "_dev","ifname",masterinf) + ucic:set("network",intf .. "_dev","mode","vepa") + ucic:set("network",intf .. "_dev","name",intf) ucic:set("network",intf,"masterintf",masterintf) elseif typeintf == "" and ifname ~= "" and (proto == "static" or proto == "dhcp" or proto == "dhcpv6") then - ucic:set("network",intf,"ifname",ifname) + ucic:set("network",intf,"device",ifname) elseif typeintf == "" and device ~= "" and proto == "ncm" then ucic:set("network",intf,"device",device_ncm) elseif typeintf == "" and device ~= "" and proto == "qmi" then @@ -342,7 +369,10 @@ function wizard_add() if not ucic:get("sqm",intf) ~= "" then local defif = get_device(intf) if defif == "" then - defif = ucic:get("network",intf,"ifname") or "" + defif = ucic:get("network",intf,"device") or "" + if defif == "" then + defif = ucic:get("network",intf,"ifname") or "" + end end ucic:set("sqm",intf,"queue") ucic:set("sqm",intf,"interface",defif) @@ -442,7 +472,7 @@ function wizard_add() ucic:set("network","omrvpn","proto","bonding") end if vpn_intf ~= "" then - ucic:set("network","omrvpn","ifname",vpn_intf) + ucic:set("network","omrvpn","device",vpn_intf) ucic:set("sqm","omrvpn","interface",vpn_intf) ucic:save("network") ucic:commit("network") @@ -894,7 +924,7 @@ function wizard_add() -- Restart all menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter" if gostatus == true then - luci.sys.call("/etc/init.d/macvlan restart >/dev/null 2>/dev/null") + --luci.sys.call("/etc/init.d/macvlan restart >/dev/null 2>/dev/null") luci.sys.call("(env -i /bin/ubus call network reload) >/dev/null 2>/dev/null") luci.sys.call("ip addr flush dev tun0 >/dev/null 2>/dev/null") luci.sys.call("/etc/init.d/omr-tracker stop >/dev/null 2>/dev/null") diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 9c39c3c33..c6db8b9e5 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -473,7 +473,7 @@ if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*") or ifacea:match("^bond.*")) and device_notvirtual(ifacea) then if uci:get("network",ifname,"proto") ~= "macvlan" then %> - + <% else %> @@ -483,9 +483,9 @@ end end if uci:get("network",ifname,"proto") ~= "macvlan" then - if iffind == 0 and uci:get("network",ifname,"ifname") ~= nil then + if iffind == 0 and uci:get("network",ifname,"device") ~= nil then %> - + <% end else @@ -616,7 +616,7 @@