forked from aredn/aredn_ar71xx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path708-define-aredn-networks.patch
190 lines (186 loc) · 6.18 KB
/
708-define-aredn-networks.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
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
@@ -153,7 +153,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
@@ -165,10 +165,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 "wifi" ifname "wlan0" protocol "static"
ucidef_add_switch "switch0" \
- "0@eth0" "4:lan" "5:wan"
+ "0@eth0" "4:lan" "5t:wan" "5t:dtdlink"
;;
airrouter|\
ap121|\
@@ -55,9 +56,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 "wifi" ifname "wlan0" protocol "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|\
@@ -160,7 +163,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 "wifi" ifname "wlan0" protocol "static"
+ ucidef_set_interface "dtdlink" ifname "eth0.2" protocol "static"
;;
a40|\
a60|\
@@ -186,6 +191,8 @@ ar71xx_setup_interfaces()
wpe72|\
wrtnode2q)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
+ ucidef_set_interface "dtdlink" ifname "eth1.2" protocol "static"
;;
all0258n|\
all0315n|\
@@ -194,7 +201,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 "wifi" ifname "wlan0" protocol "static"
+ ucidef_set_interface "dtdlink" ifname "eth0.2" protocol "static"
;;
wzr-hp-g300nh2)
ucidef_add_switch "switch0" \
@@ -209,8 +218,9 @@ ar71xx_setup_interfaces()
rb-962uigs-5hact2hnt|\
wlr8100|\
wzr-hp-g450h)
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "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|\
@@ -248,12 +258,18 @@ ar71xx_setup_interfaces()
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|\
@@ -303,11 +319,13 @@ ar71xx_setup_interfaces()
wbs210|\
wbs510|\
wbs510-v2)
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "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 "wifi" ifname "wlan0" protocol "static"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
;;
@@ -459,9 +477,10 @@ ar71xx_setup_interfaces()
;;
gl-ar750|\
rb-435g)
- ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+ ucidef_set_interface_wan "eth0"
+ ucidef_set_interface "wifi" ifname "wlan1" protocol "static"
ucidef_add_switch "switch0" \
- "0@eth1" "1:lan" "2:lan"
+ "0@eth1" "1:lan" "2t:unused" "2t:dtdlink"
;;
gl-ar750s)
ucidef_add_switch "switch0" \
@@ -485,9 +504,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 "wifi" ifname "wlan0" protocol "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"
@@ -599,8 +619,16 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth1" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
;;
+ nanostation-m)
+ ucidef_set_interface_lan "eth0 eth1"
+ ucidef_set_interface_wan "eth0.1 eth1.1"
+ ucidef_set_interface "dtdlink" ifname "eth0.2 eth1.2" protocol "static"
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
+ ;;
*)
- ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ ucidef_set_interface "wifi" ifname "wlan0" protocol "static"
+ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
+ ucidef_set_interface "dtdlink" ifname "eth0.2" protocol "static"
;;
esac
}