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