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