ar71xx: add preliminary support for Mikrotik RB2011L
[openwrt/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 ucidef_set_interface_lan "eth0 eth1"
22 ;;
23
24 db120 |\
25 rb-2011l)
26 ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
27 ucidef_add_switch "eth0" "1" "1"
28 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
29 ucidef_add_switch_vlan "eth0" "2" "0t 1"
30 ucidef_add_switch "eth1" "1" "1"
31 ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5"
32 ;;
33
34 dir-825-b1|\
35 dir-825-b1-openwrt|\
36 dir-825-b1-tostock|\
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-450)
57 ucidef_set_interfaces_lan_wan "eth1" "eth0"
58 ucidef_add_switch "eth1" "1" "1"
59 ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 5"
60 ;;
61
62 rb-450g |\
63 routerstation-pro)
64 ucidef_set_interfaces_lan_wan "eth1" "eth0"
65 ucidef_add_switch "switch0" "1" "1"
66 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
67 ;;
68
69 ap136 |\
70 rb-750gl |\
71 rb-751g |\
72 wzr-hp-g450h)
73 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
74 ucidef_add_switch "switch0" "1" "1"
75 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
76 ucidef_add_switch_vlan "switch0" "2" "0t 1"
77 ;;
78
79 rb-493g)
80 ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
81 ucidef_add_switch "switch0" "1" "1"
82 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
83 ucidef_add_switch "switch1" "1" "1"
84 ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
85 ucidef_add_switch_vlan "switch1" "2" "0t 5"
86 ;;
87
88 wzr-hp-g300nh2 |\
89 pb92 |\
90 ap113)
91 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
92 ucidef_add_switch "eth0" "1" "1"
93 ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5"
94 ucidef_add_switch_vlan "eth0" "2" "0t 2"
95 ;;
96
97 tl-wdr4300|\
98 tl-wr1041n-v2)
99 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
100 ucidef_add_switch "eth0" "1" "1"
101 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
102 ucidef_add_switch_vlan "eth0" "2" "0t 1"
103 ;;
104
105 tl-wr1043nd)
106 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
107 ucidef_add_switch "rtl8366rb" "1" "1"
108 ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
109 ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
110 ;;
111
112 tl-wr2543n)
113 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
114 ucidef_add_switch "switch0" "1" "1"
115 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
116 ucidef_add_switch_vlan "switch0" "2" "0 9t"
117 ;;
118
119 tl-wr841n-v1|\
120 tl-wr941nd)
121 ucidef_set_interface_raw "eth" "eth0"
122 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
123 ;;
124
125 wrt160nl)
126 ucidef_set_interfaces_lan_wan "eth0" "eth1"
127 ucidef_add_switch "eth0" "1" "1"
128 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
129 ;;
130
131 wzr-hp-g300nh)
132 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
133 ucidef_add_switch "switch0" "1" "1"
134 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
135 ;;
136
137 all0305 |\
138 aw-nr580 |\
139 bullet-m |\
140 eap7660d |\
141 ew-dorin |\
142 rb-411 |\
143 tl-mr11u |\
144 tl-mr3020 |\
145 tl-wa901nd |\
146 tl-wa901nd-v2 |\
147 tl-wr703n |\
148 wp543)
149 ucidef_set_interface_lan "eth0"
150 ;;
151
152 alfa-ap96 |\
153 alfa-nx |\
154 ap83 |\
155 jwap003 |\
156 pb42 |\
157 pb44 |\
158 routerstation|\
159 wpe72)
160 ucidef_set_interfaces_lan_wan "eth1" "eth0"
161 ;;
162
163 ap121 |\
164 ap121-mini |\
165 ap96 |\
166 airrouter |\
167 dir-600-a1 |\
168 dir-615-c1 |\
169 dir-615-e4 |\
170 ja76pf |\
171 rb-750 |\
172 rb-751 |\
173 tew-632brp |\
174 tew-712br |\
175 tl-mr3220 |\
176 tl-mr3420 |\
177 tl-wr741nd |\
178 tl-wr741nd-v4 |\
179 tl-wr841n-v7 |\
180 whr-g301n |\
181 whr-hp-g300n |\
182 whr-hp-gn |\
183 wzr-hp-ag300h)
184 ucidef_set_interfaces_lan_wan "eth0" "eth1"
185 ucidef_add_switch "eth0" "1" "1"
186 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
187 ;;
188
189 wzr-hp-g450h)
190 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
191 ucidef_add_switch "eth0" "1" "1"
192 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
193 ucidef_add_switch_vlan "eth0" "2" "0t 1"
194 ;;
195
196 ew-dorin-router)
197 ucidef_set_interfaces_lan_wan "eth0" "eth1"
198 ucidef_add_switch "eth0" "1" "1"
199 ucidef_add_switch_vlan "eth0" "1" "0 2 3"
200 ;;
201
202 *)
203 ucidef_set_interfaces_lan_wan "eth0" "eth1"
204 ;;
205 esac
206
207 uci commit network
208
209 exit 0