ar71xx: ew-dorin: added router firmware generation
[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 ew-dorin |\
137 rb-411 |\
138 tl-mr11u |\
139 tl-mr3020 |\
140 tl-wa901nd |\
141 tl-wa901nd-v2 |\
142 tl-wr703n |\
143 wp543)
144         ucidef_set_interface_lan "eth0"
145         ;;
146
147 alfa-ap96 |\
148 alfa-nx |\
149 ap83 |\
150 jwap003 |\
151 pb42 |\
152 pb44 |\
153 routerstation|\
154 wpe72)
155         ucidef_set_interfaces_lan_wan "eth1" "eth0"
156         ;;
157
158 ap121 |\
159 ap121-mini |\
160 ap96 |\
161 airrouter |\
162 dir-600-a1 |\
163 dir-615-c1 |\
164 dir-615-e4 |\
165 ja76pf |\
166 rb-750 |\
167 rb-751 |\
168 tew-632brp |\
169 tl-mr3220 |\
170 tl-mr3420 |\
171 tl-wr741nd |\
172 tl-wr741nd-v4 |\
173 tl-wr841n-v7 |\
174 whr-g301n |\
175 whr-hp-g300n |\
176 whr-hp-gn |\
177 wzr-hp-ag300h)
178         ucidef_set_interfaces_lan_wan "eth0" "eth1"
179         ucidef_add_switch "eth0" "1" "1"
180         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
181         ;;
182
183 wzr-hp-g450h)
184         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
185         ucidef_add_switch "eth0" "1" "1"
186         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
187         ucidef_add_switch_vlan "eth0" "2" "0t 1"
188         ;;
189
190 ew-dorin-router)
191         ucidef_set_interfaces_lan_wan "eth0" "eth1"
192         ucidef_add_switch "eth0" "1" "1"
193         ucidef_add_switch_vlan "eth0" "1" "0 2 3"
194         ;;
195
196 *)
197         ucidef_set_interfaces_lan_wan "eth0" "eth1"
198         ;;
199 esac
200
201 uci commit network
202
203 exit 0