From a03847acbb705c5787a73f24b7c1eba7f8d96267 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Sep 2020 22:03:50 +0200 Subject: [PATCH] Fix network for r2s --- .../files/etc/uci-defaults/1920-omr-network | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/openmptcprouter/files/etc/uci-defaults/1920-omr-network b/openmptcprouter/files/etc/uci-defaults/1920-omr-network index 5b44f393f..1d7c7e017 100755 --- a/openmptcprouter/files/etc/uci-defaults/1920-omr-network +++ b/openmptcprouter/files/etc/uci-defaults/1920-omr-network @@ -80,7 +80,9 @@ if [ "$(uci -q show network.lan | grep multipath)" != "" ]; then fi lanif="eth0" -if [ -d /sys/class/net/lan0 -o -n "$(ip link | grep ' lan0')" ] && [ -d /sys/class/net/wan -o -n "$(ip link | grep ' wan@')" -o -n "$(ip link | grep ' wan:')" ]; then +if [ "$(grep rockchip /etc/os-release)" != "" ]; then + lanif="eth1" +elif [ -d /sys/class/net/lan0 -o -n "$(ip link | grep ' lan0')" ] && [ -d /sys/class/net/wan -o -n "$(ip link | grep ' wan@')" -o -n "$(ip link | grep ' wan:')" ]; then lanif="wan" elif [ -d /sys/class/net/lan1 -o -n "$(ip link | grep ' lan1')" ] && [ -d /sys/class/net/wan -o -n "$(ip link | grep ' wan@')" -o -n "$(ip link | grep ' wan:')" ]; then lanif="wan" @@ -121,6 +123,7 @@ elif [ ! -d /sys/class/net/eth1 ] && [ -d /sys/class/net/eth0 ]; then lanif="eth0" fi uci -q batch <<-EOF +delete network.lan.type set network.lan=interface set network.lan.proto=static set network.lan.ipaddr=192.168.100.1 @@ -162,12 +165,16 @@ if ! grep -s -q "lan" /etc/iproute2/rt_tables; then fi uci -q set network.lan.ip4table='lan' - #uci -q set "network.lan.ip6assign=64" # Create WAN interfaces if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get network.wan1.multipath)" ]; then - if [ "$(swconfig list 2>&1 | grep switch0)" != "" ]; then + if [ "$(grep rockchip /etc/os-release)" != "" ]; then + _setup_wan_interface wan1 eth0 master macvlan + _setup_wan_interface wan2 eth0 on macvlan + _setup_macvlan wan1 + _setup_macvlan wan2 + elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ]; then _setup_wan_interface wan1 eth0.1 master _setup_wan_interface wan2 eth0.2 on _setup_wan_interface wan3 eth0.3 on