2022-04-24 16:14:10 -06:00
|
|
|
--- a/package/base-files/files/lib/functions/uci-defaults.sh
|
|
|
|
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
|
2020-01-22 18:37:27 -07:00
|
|
|
@@ -153,7 +153,7 @@ _ucidef_finish_switch_roles() {
|
2018-05-02 23:07:55 -06:00
|
|
|
|
|
|
|
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
|
2022-04-24 16:14:10 -06:00
|
|
|
--- a/package/base-files/files/bin/config_generate
|
|
|
|
+++ b/package/base-files/files/bin/config_generate
|
2020-01-22 18:37:27 -07:00
|
|
|
@@ -165,10 +165,11 @@ generate_switch_vlans_ports() {
|
2018-05-02 23:07:55 -06:00
|
|
|
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
|
2022-04-24 16:14:10 -06:00
|
|
|
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
|
|
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
|
2018-09-01 17:39:19 -06:00
|
|
|
@@ -12,8 +12,9 @@ ar71xx_setup_interfaces()
|
|
|
|
|
2018-05-02 23:07:55 -06:00
|
|
|
case "$board" in
|
|
|
|
airgatewaypro)
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
- "0@eth0" "4:lan" "5:wan"
|
|
|
|
+ "0@eth0" "4:lan" "5t:wan" "5t:dtdlink"
|
|
|
|
;;
|
|
|
|
airrouter|\
|
|
|
|
ap121|\
|
2020-01-22 18:37:27 -07:00
|
|
|
@@ -55,9 +56,10 @@ ar71xx_setup_interfaces()
|
2018-05-02 23:07:55 -06:00
|
|
|
whr-hp-gn|\
|
|
|
|
wzr-hp-ag300h|\
|
|
|
|
zbt-we1526)
|
|
|
|
- ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
|
|
|
|
+ ucidef_set_interface_wan "eth1"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
- "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
2018-08-09 17:46:37 -06:00
|
|
|
+ "0@eth0" "4:lan:1" "3:lan:2" "2:lan:3" "1t:unused" "1t:dtdlink"
|
2018-05-02 23:07:55 -06:00
|
|
|
;;
|
|
|
|
alfa-ap120c|\
|
|
|
|
all0305|\
|
2019-02-06 18:45:09 -07:00
|
|
|
@@ -101,6 +103,7 @@ ar71xx_setup_interfaces()
|
2018-11-14 19:31:12 -07:00
|
|
|
mr900|\
|
|
|
|
mr900v2|\
|
|
|
|
mynet-rext|\
|
|
|
|
+ nanostation-m-xw|\
|
|
|
|
pqi-air-pen|\
|
|
|
|
rb-411|\
|
|
|
|
rb-411u|\
|
2020-01-22 18:37:27 -07:00
|
|
|
@@ -160,7 +163,9 @@ ar71xx_setup_interfaces()
|
2018-05-02 23:07:55 -06:00
|
|
|
wifi-pineapple-nano|\
|
|
|
|
wndap360|\
|
|
|
|
wp543)
|
|
|
|
- ucidef_set_interface_lan "eth0"
|
2018-09-01 17:39:19 -06:00
|
|
|
+ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
|
|
|
+ ucidef_set_interface "dtdlink" ifname "eth0.2" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
;;
|
|
|
|
a40|\
|
|
|
|
a60|\
|
2020-01-22 18:37:27 -07:00
|
|
|
@@ -186,6 +191,8 @@ ar71xx_setup_interfaces()
|
2018-05-02 23:07:55 -06:00
|
|
|
wpe72|\
|
|
|
|
wrtnode2q)
|
2019-04-30 19:55:09 -06:00
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
|
|
|
+ ucidef_set_interface "dtdlink" ifname "eth1.2" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
;;
|
|
|
|
all0258n|\
|
|
|
|
all0315n|\
|
2020-01-22 18:37:27 -07:00
|
|
|
@@ -194,7 +201,9 @@ ar71xx_setup_interfaces()
|
2018-05-02 23:07:55 -06:00
|
|
|
ja76pf2|\
|
|
|
|
rocket-m-ti|\
|
|
|
|
ubnt-unifi-outdoor)
|
|
|
|
- ucidef_set_interface_lan "eth0 eth1"
|
|
|
|
+ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
|
|
|
+ ucidef_set_interface "dtdlink" ifname "eth0.2" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
;;
|
|
|
|
wzr-hp-g300nh2)
|
|
|
|
ucidef_add_switch "switch0" \
|
2020-01-22 18:37:27 -07:00
|
|
|
@@ -209,8 +218,9 @@ ar71xx_setup_interfaces()
|
2018-09-01 17:39:19 -06:00
|
|
|
rb-962uigs-5hact2hnt|\
|
2018-05-02 23:07:55 -06:00
|
|
|
wlr8100|\
|
|
|
|
wzr-hp-g450h)
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
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|\
|
2022-04-24 16:14:10 -06:00
|
|
|
@@ -250,12 +260,18 @@ ar71xx_setup_interfaces()
|
2020-01-22 18:37:27 -07:00
|
|
|
rb-750-r2|\
|
|
|
|
rb-750p-pbr2|\
|
|
|
|
rb-750up-r2|\
|
|
|
|
- rb-951ui-2nd|\
|
|
|
|
- rb-952ui-5ac2nd)
|
|
|
|
- ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
|
|
|
|
+ rb-951ui-2nd)
|
|
|
|
+ ucidef_set_interface_wan "eth0"
|
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
|
|
|
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 "wifi" ifname "wlan1" protocol "static"
|
|
|
|
+ ucidef_add_switch "switch0" \
|
|
|
|
+ "0@eth1" "4:lan:1" "3:lan:2" "2:lan:3" "1t:unused" "1t:dtdlink"
|
|
|
|
+ ;;
|
|
|
|
archer-c58-v1|\
|
|
|
|
archer-c59-v1|\
|
|
|
|
archer-c59-v2|\
|
2022-04-24 16:14:10 -06:00
|
|
|
@@ -299,11 +315,13 @@ ar71xx_setup_interfaces()
|
2018-05-02 23:07:55 -06:00
|
|
|
wbs210|\
|
2019-11-20 19:43:12 -07:00
|
|
|
wbs510|\
|
|
|
|
wbs510-v2)
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
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"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
2018-09-01 17:39:19 -06:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
|
|
|
|
;;
|
2022-04-24 16:14:10 -06:00
|
|
|
@@ -455,9 +473,10 @@ 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"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan1" protocol "static"
|
2019-05-26 16:27:49 -06:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
- "0@eth1" "1:lan" "2:lan"
|
|
|
|
+ "0@eth1" "1:lan" "2t:unused" "2t:dtdlink"
|
|
|
|
;;
|
2020-01-22 18:37:27 -07:00
|
|
|
gl-ar750s)
|
2018-11-14 19:31:12 -07:00
|
|
|
ucidef_add_switch "switch0" \
|
2022-04-24 16:14:10 -06:00
|
|
|
@@ -481,9 +500,10 @@ ar71xx_setup_interfaces()
|
2018-05-02 23:07:55 -06:00
|
|
|
"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"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
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"
|
2022-04-24 16:14:10 -06:00
|
|
|
@@ -595,8 +615,16 @@ ar71xx_setup_interfaces()
|
2018-12-02 18:52:48 -07:00
|
|
|
ucidef_add_switch "switch0" \
|
2020-01-22 18:37:27 -07:00
|
|
|
"0@eth1" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
|
2018-05-02 23:07:55 -06:00
|
|
|
;;
|
2018-12-02 18:52:48 -07:00
|
|
|
+ nanostation-m)
|
|
|
|
+ ucidef_set_interface_lan "eth0 eth1"
|
|
|
|
+ ucidef_set_interface_wan "eth0.1 eth1.1"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "dtdlink" ifname "eth0.2 eth1.2" protocol "static"
|
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
2018-12-02 18:52:48 -07:00
|
|
|
+ ;;
|
2018-05-02 23:07:55 -06:00
|
|
|
*)
|
|
|
|
- ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
+ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
|
2020-01-22 18:37:27 -07:00
|
|
|
+ ucidef_set_interface "dtdlink" ifname "eth0.2" protocol "static"
|
2018-05-02 23:07:55 -06:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|