ar71xx: add support for the TP-Link TL-WR1041N v2 board
[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-wr1041n-v2)
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 2 3 4 5"
96 ucidef_add_switch_vlan "eth0" "2" "0t 1"
97 ;;
98
99 tl-wr1043nd)
100 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
101 ucidef_add_switch "rtl8366rb" "1" "1"
102 ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
103 ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
104 ;;
105
106 tl-wr2543n)
107 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
108 ucidef_add_switch "switch0" "1" "1"
109 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
110 ucidef_add_switch_vlan "switch0" "2" "0 9t"
111 ;;
112
113 tl-wr841n-v1|\
114 tl-wr941nd)
115 ucidef_set_interface_raw "eth" "eth0"
116 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
117 ;;
118
119 wrt160nl)
120 ucidef_set_interfaces_lan_wan "eth0" "eth1"
121 ucidef_add_switch "eth0" "1" "1"
122 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
123 ;;
124
125 wzr-hp-g300nh)
126 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
127 ucidef_add_switch "switch0" "1" "1"
128 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
129 ;;
130
131 aw-nr580 |\
132 bullet-m |\
133 eap7660d |\
134 rb-411 |\
135 tl-mr11u |\
136 tl-mr3020 |\
137 tl-wa901nd |\
138 tl-wa901nd-v2 |\
139 tl-wr703n |\
140 wp543)
141 ucidef_set_interface_lan "eth0"
142 ;;
143
144 alfa-ap96 |\
145 alfa-nx |\
146 ap83 |\
147 jwap003 |\
148 pb42 |\
149 pb44 |\
150 routerstation|\
151 wpe72)
152 ucidef_set_interfaces_lan_wan "eth1" "eth0"
153 ;;
154
155 ap121 |\
156 ap121-mini |\
157 ap96 |\
158 airrouter |\
159 dir-600-a1 |\
160 dir-615-c1 |\
161 dir-615-e4 |\
162 ja76pf |\
163 rb-750 |\
164 rb-751 |\
165 tew-632brp |\
166 tl-mr3220 |\
167 tl-mr3420 |\
168 tl-wr741nd |\
169 tl-wr741nd-v4 |\
170 tl-wr841n-v7 |\
171 whr-g301n |\
172 whr-hp-g300n |\
173 whr-hp-gn |\
174 wzr-hp-ag300h)
175 ucidef_set_interfaces_lan_wan "eth0" "eth1"
176 ucidef_add_switch "eth0" "1" "1"
177 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
178 ;;
179
180 wzr-hp-g450h)
181 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
182 ucidef_add_switch "eth0" "1" "1"
183 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
184 ucidef_add_switch_vlan "eth0" "2" "0t 1"
185 ;;
186
187 *)
188 ucidef_set_interfaces_lan_wan "eth0" "eth1"
189 ;;
190 esac
191
192 uci commit network
193
194 exit 0