mirror of https://github.com/aredn/aredn.git
193 lines
5.9 KiB
Diff
193 lines
5.9 KiB
Diff
Index: openwrt/package/base-files/files/lib/functions/uci-defaults.sh
|
|
===================================================================
|
|
--- openwrt.orig/package/base-files/files/lib/functions/uci-defaults.sh
|
|
+++ openwrt/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
|
|
Index: openwrt/package/base-files/files/bin/config_generate
|
|
===================================================================
|
|
--- openwrt.orig/package/base-files/files/bin/config_generate
|
|
+++ openwrt/package/base-files/files/bin/config_generate
|
|
@@ -151,10 +151,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
|
|
Index: openwrt/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
===================================================================
|
|
--- openwrt.orig/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
+++ openwrt/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|\
|
|
@@ -99,6 +101,7 @@ ar71xx_setup_interfaces()
|
|
mr900|\
|
|
mr900v2|\
|
|
mynet-rext|\
|
|
+ nanostation-m-xw|\
|
|
pqi-air-pen|\
|
|
rb-411|\
|
|
rb-411u|\
|
|
@@ -153,7 +156,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|\
|
|
@@ -172,7 +177,6 @@ ar71xx_setup_interfaces()
|
|
pb42|\
|
|
pb44|\
|
|
rb-951ui-2hnd|\
|
|
- rb-952ui-5ac2nd|\
|
|
routerstation|\
|
|
tl-wr710n|\
|
|
tl-wr720n-v3|\
|
|
@@ -180,15 +184,24 @@ ar71xx_setup_interfaces()
|
|
tl-wr810n-v2|\
|
|
wpe72|\
|
|
wrtnode2q)
|
|
- ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
+ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
|
|
+ ucidef_set_interface_raw "wifi" "wlan0" "static"
|
|
+ ucidef_set_interface_raw "dtdlink" "eth0.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"
|
|
+ ucidef_add_switch "switch0" \
|
|
+ "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"
|
|
ucidef_add_switch "switch0" \
|
|
- "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
|
+ "0@eth1" "4:lan:1" "3:lan:2" "2:lan:3" "1t:unused" "1t:dtdlink"
|
|
;;
|
|
all0258n|\
|
|
all0315n|\
|
|
@@ -198,7 +211,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" \
|
|
@@ -213,8 +228,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|\
|
|
@@ -294,11 +310,13 @@ ar71xx_setup_interfaces()
|
|
cpe510|\
|
|
wbs210|\
|
|
wbs510)
|
|
+ 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"
|
|
;;
|
|
@@ -450,10 +468,6 @@ ar71xx_setup_interfaces()
|
|
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"
|
|
;;
|
|
@@ -463,9 +477,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"
|
|
@@ -566,8 +581,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
|
|
}
|