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