ar71xx: add user-space support for the RB435G board
[openwrt.git] / target / linux / ar71xx / base-files / etc / uci-defaults / network
1 #!/bin/sh
2 #
3 # Copyright (C) 2011 OpenWrt.org
4 #
5
6 [ -e /etc/config/network ] && exit 0
7
8 touch /etc/config/network
9
10 . /lib/functions/uci-defaults.sh
11 . /lib/ar71xx.sh
12
13 ucidef_set_interface_loopback
14
15 board=$(ar71xx_board_name)
16
17 case "$board" in
18 all0315n |\
19 all0258n |\
20 ja76pf2|\
21 ubnt-unifi-outdoor)
22         ucidef_set_interface_lan "eth0 eth1"
23         ;;
24
25 db120 |\
26 rb-2011l | \
27 rb-2011uas-2hnd)
28         ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
29         ucidef_add_switch "eth0" "1" "1"
30         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
31         ucidef_add_switch_vlan "eth0" "2" "0t 1"
32         ucidef_add_switch "eth1" "1" "1"
33         ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5"
34         ;;
35
36 dir-825-b1|\
37 tew-673gru)
38         ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
39         ucidef_add_switch "rtl8366s" "1" "1"
40         ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t"
41         ;;
42
43 nbg460n_550n_550nh)
44         ucidef_set_interfaces_lan_wan "eth0" "eth1"
45         ucidef_add_switch "rtl8366s" "1" "1"
46         ucidef_add_switch_vlan "rtl8366s" "0" "0 1 2 3 5"
47         ;;
48
49 rb-433 |\
50 rb-433u)
51         ucidef_set_interfaces_lan_wan "eth1" "eth0"
52         ucidef_add_switch "switch0" "1" "1"
53         ucidef_add_switch_vlan "switch0" "1" "1 2 5"
54         ;;
55
56 rb-435g)
57         ucidef_set_interfaces_lan_wan "eth1" "eth0"
58         ucidef_add_switch "switch0" "1" "1"
59         ucidef_add_switch_vlan "switch0" "1" "0 1 2"
60         ;;
61
62 rb-450)
63         ucidef_set_interfaces_lan_wan "eth1" "eth0"
64         ucidef_add_switch "eth1" "1" "1"
65         ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 5"
66         ;;
67
68 rb-450g |\
69 routerstation-pro)
70         ucidef_set_interfaces_lan_wan "eth1" "eth0"
71         ucidef_add_switch "switch0" "1" "1"
72         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
73         ;;
74
75 ap136 |\
76 rb-750gl |\
77 rb-751g |\
78 wzr-hp-g450h)
79         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
80         ucidef_add_switch "switch0" "1" "1"
81         ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
82         ucidef_add_switch_vlan "switch0" "2" "0t 1"
83         ;;
84
85 rb-493g)
86         ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
87         ucidef_add_switch "switch0" "1" "1"
88         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
89         ucidef_add_switch "switch1" "1" "1"
90         ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
91         ucidef_add_switch_vlan "switch1" "2" "0t 5"
92         ;;
93
94 wzr-hp-g300nh2 |\
95 pb92 |\
96 ap113)
97         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
98         ucidef_add_switch "eth0" "1" "1"
99         ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5"
100         ucidef_add_switch_vlan "eth0" "2" "0t 2"
101         ;;
102
103 tl-wdr4300|\
104 tl-wr1041n-v2)
105         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
106         ucidef_add_switch "eth0" "1" "1"
107         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
108         ucidef_add_switch_vlan "eth0" "2" "0t 1"
109         ;;
110
111 tl-wr1043nd)
112         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
113         ucidef_add_switch "rtl8366rb" "1" "1"
114         ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
115         ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
116         ;;
117
118 tl-wr2543n)
119         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
120         ucidef_add_switch "switch0" "1" "1"
121         ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
122         ucidef_add_switch_vlan "switch0" "2" "0 9t"
123         ;;
124
125 tl-wr841n-v1|\
126 tl-wr941nd)
127         ucidef_set_interface_raw "eth" "eth0"
128         ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
129         ;;
130
131 tl-wr841n-v8)
132         ucidef_set_interfaces_lan_wan "eth1" "eth0"
133         ucidef_add_switch "switch0" "1" "1"
134         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
135         ;;
136
137 wrt160nl)
138         ucidef_set_interfaces_lan_wan "eth0" "eth1"
139         ucidef_add_switch "eth0" "1" "1"
140         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
141         ;;
142
143 wzr-hp-g300nh)
144         ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
145         ucidef_add_switch "switch0" "1" "1"
146         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
147         ;;
148
149 all0305 |\
150 aw-nr580 |\
151 bullet-m |\
152 cap4200ag |\
153 eap7660d |\
154 mr600 |\
155 rb-411 |\
156 tl-mr11u |\
157 tl-mr3020 |\
158 tl-mr3040 |\
159 tl-wa901nd |\
160 tl-wa901nd-v2 |\
161 tl-wr703n |\
162 wp543)
163         ucidef_set_interface_lan "eth0"
164         ;;
165
166 alfa-ap96 |\
167 alfa-nx |\
168 ap83 |\
169 jwap003 |\
170 pb42 |\
171 pb44 |\
172 routerstation|\
173 wpe72)
174         ucidef_set_interfaces_lan_wan "eth1" "eth0"
175         ;;
176
177 ap121 |\
178 ap121-mini |\
179 ap96 |\
180 airrouter |\
181 dir-600-a1 |\
182 dir-615-c1 |\
183 dir-615-e4 |\
184 ja76pf |\
185 rb-750 |\
186 rb-751 |\
187 tew-632brp |\
188 tew-712br |\
189 tl-mr3220 |\
190 tl-mr3420 |\
191 tl-wr741nd |\
192 tl-wr741nd-v4 |\
193 tl-wr841n-v7 |\
194 whr-g301n |\
195 whr-hp-g300n |\
196 whr-hp-gn |\
197 wzr-hp-ag300h)
198         ucidef_set_interfaces_lan_wan "eth0" "eth1"
199         ucidef_add_switch "eth0" "1" "1"
200         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
201         ;;
202
203 wzr-hp-g450h)
204         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
205         ucidef_add_switch "eth0" "1" "1"
206         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
207         ucidef_add_switch_vlan "eth0" "2" "0t 1"
208         ;;
209
210 ew-dorin)
211         ucidef_set_interface_lan "eth0"
212         ucidef_add_switch "eth0" "1" "1"
213         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3"
214         ;;
215
216 ew-dorin-router)
217         ucidef_set_interfaces_lan_wan "eth0" "eth1"
218         ucidef_add_switch "eth0" "1" "1"
219         ucidef_add_switch_vlan "eth0" "1" "0 2 3"
220         ;;
221
222 *)
223         ucidef_set_interfaces_lan_wan "eth0" "eth1"
224         ;;
225 esac
226
227 uci commit network
228
229 exit 0