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