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