aredn/patches/708-define-aredn-networks.p...

197 lines
5.8 KiB
Diff
Raw Normal View History

--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -162,7 +162,7 @@ _ucidef_finish_switch_roles() {
if [ ${need_tag:-0} -eq 1 -o ${want_untag:-0} -ne 1 ]; then
num="${num}t"
- device="${device}.${index}"
+ device="${device}.$((index - 1))"
fi
json_select roles
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -161,10 +161,11 @@ generate_switch_vlans_ports() {
json_get_vars ports
json_select ..
+ vlan_num=$((role - 1))
uci -q batch <<-EOF
add network switch_vlan
set network.@switch_vlan[-1].device='$switch'
- set network.@switch_vlan[-1].vlan='$role'
+ set network.@switch_vlan[-1].vlan='$vlan_num'
set network.@switch_vlan[-1].ports='$ports'
EOF
done
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -12,8 +12,9 @@ ar71xx_setup_interfaces()
case "$board" in
airgatewaypro)
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
ucidef_add_switch "switch0" \
- "0@eth0" "4:lan" "5:wan"
+ "0@eth0" "4:lan" "5t:wan" "5t:dtdlink"
;;
airrouter|\
ap121|\
@@ -57,9 +58,10 @@ ar71xx_setup_interfaces()
whr-hp-gn|\
wzr-hp-ag300h|\
zbt-we1526)
- ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+ ucidef_set_interface_wan "eth1"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
ucidef_add_switch "switch0" \
- "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
+ "0@eth0" "4:lan:1" "3:lan:2" "2:lan:3" "1t:unused" "1t:dtdlink"
;;
alfa-ap120c|\
all0305|\
@@ -101,6 +103,7 @@ ar71xx_setup_interfaces()
mr900|\
mr900v2|\
mynet-rext|\
+ nanostation-m-xw|\
pqi-air-pen|\
rb-411|\
rb-411u|\
@@ -157,7 +160,9 @@ ar71xx_setup_interfaces()
wifi-pineapple-nano|\
wndap360|\
wp543)
- ucidef_set_interface_lan "eth0"
+ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
+ ucidef_set_interface_raw "dtdlink" "eth0.2" "static"
;;
a40|\
a60|\
@@ -176,7 +181,6 @@ ar71xx_setup_interfaces()
pb42|\
pb44|\
rb-951ui-2hnd|\
- rb-952ui-5ac2nd|\
routerstation|\
tl-wr710n|\
tl-wr720n-v3|\
@@ -185,14 +189,23 @@ ar71xx_setup_interfaces()
wpe72|\
wrtnode2q)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
+ ucidef_set_interface_raw "dtdlink" "eth1.2" "static"
;;
rb-750-r2|\
rb-750p-pbr2|\
rb-750up-r2|\
rb-951ui-2nd)
- ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+ ucidef_set_interface_wan "eth0"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
2019-05-26 16:27:49 -06:00
ucidef_add_switch "switch0" \
- "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
+ "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4t:unused" "4t:dtdlink"
+ ;;
+ rb-952ui-5ac2nd)
+ ucidef_set_interface_wan "eth0"
+ ucidef_set_interface_raw "wifi" "wlan1" "static"
2019-05-26 16:27:49 -06:00
+ ucidef_add_switch "switch0" \
+ "0@eth1" "4:lan:1" "3:lan:2" "2:lan:3" "1t:unused" "1t:dtdlink"
;;
all0258n|\
all0315n|\
@@ -202,7 +215,9 @@ ar71xx_setup_interfaces()
ja76pf2|\
rocket-m-ti|\
ubnt-unifi-outdoor)
- ucidef_set_interface_lan "eth0 eth1"
+ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
+ ucidef_set_interface_raw "dtdlink" "eth0.2" "static"
;;
wzr-hp-g300nh2)
ucidef_add_switch "switch0" \
@@ -217,8 +232,9 @@ ar71xx_setup_interfaces()
rb-962uigs-5hact2hnt|\
wlr8100|\
wzr-hp-g450h)
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
ucidef_add_switch "switch0" \
- "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
+ "0@eth0" "2:lan" "3:lan" "4:lan" "1:wan" "5t:dtdlink"
;;
ap135-020|\
ap136-020|\
@@ -301,11 +317,13 @@ ar71xx_setup_interfaces()
wbs210|\
wbs510|\
wbs510-v2)
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
ucidef_add_switch "switch0" \
- "0@eth0" "5:lan" "4:wan"
+ "0@eth0" "5:lan" "4t:wan" "4t:dtdlink"
;;
cr3000)
ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
;;
@@ -448,19 +466,16 @@ ar71xx_setup_interfaces()
2019-05-26 16:27:49 -06:00
;;
gl-ar750|\
rb-435g)
- ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+ ucidef_set_interface_wan "eth0"
+ ucidef_set_interface_raw "wifi" "wlan1" "static"
ucidef_add_switch "switch0" \
- "0@eth1" "1:lan" "2:lan"
+ "0@eth1" "1:lan" "2t:unused" "2t:dtdlink"
;;
jwap230)
ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "5:wan" "6@eth1"
;;
- nanostation-m-xw)
- ucidef_add_switch "switch0" \
- "0@eth0" "5:lan" "1:wan"
- ;;
onion-omega)
ucidef_set_interface_lan "wlan0"
;;
@@ -470,9 +485,10 @@ ar71xx_setup_interfaces()
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
;;
routerstation-pro)
- ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+ ucidef_set_interface_wan "eth0"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
ucidef_add_switch "switch0" \
- "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
+ "0@eth1" "2:lan:3" "3:lan:2" "4t:unused" "4t:dtdlink"
;;
rb-493g)
ucidef_set_interfaces_lan_wan "eth0.1 eth1.1" "eth1.2"
@@ -573,8 +589,16 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
;;
+ nanostation-m)
+ ucidef_set_interface_lan "eth0 eth1"
+ ucidef_set_interface_wan "eth0.1 eth1.1"
+ ucidef_set_interface_raw "dtdlink" "eth0.2 eth1.2" "static"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
+ ;;
*)
- ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
+ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
+ ucidef_set_interface_raw "dtdlink" "eth0.2" "static"
;;
esac
}