Root/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
8touch /etc/config/network
9
10. /lib/functions/uci-defaults.sh
11. /lib/ar71xx.sh
12
13ucidef_set_interface_loopback
14
15board=$(ar71xx_board_name)
16
17case "$board" in
18all0258n)
19    ucidef_set_interface_lan "eth0 eth1"
20    ;;
21
22db120)
23    ucidef_set_interfaces_lan_wan "eth1" "eth0"
24    ucidef_add_switch "switch0" "1" "1"
25    ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
26    ;;
27
28dir-825-b1|\
29tew-673gru)
30    ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
31    ucidef_add_switch "rtl8366s" "1" "1"
32    ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t"
33    ;;
34
35nbg460n_550n_550nh)
36    ucidef_set_interfaces_lan_wan "eth0" "eth1"
37    ucidef_add_switch "rtl8366s" "1" "1"
38    ucidef_add_switch_vlan "rtl8366s" "0" "0 1 2 3 5"
39    ;;
40
41rb-433 |\
42rb-433u)
43    ucidef_set_interfaces_lan_wan "eth1" "eth0"
44    ucidef_add_switch "switch0" "1" "1"
45    ucidef_add_switch_vlan "switch0" "1" "1 2 5"
46    ;;
47
48rb-450)
49    ucidef_set_interfaces_lan_wan "eth1" "eth0"
50    ucidef_add_switch "eth1" "1" "1"
51    ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 5"
52    ;;
53
54rb-450g |\
55routerstation-pro)
56    ucidef_set_interfaces_lan_wan "eth1" "eth0"
57    ucidef_add_switch "switch0" "1" "1"
58    ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
59    ;;
60
61rb-493g)
62    ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
63    ucidef_add_switch "switch0" "1" "1"
64    ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
65    ucidef_add_switch "switch1" "1" "1"
66    ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
67    ucidef_add_switch_vlan "switch1" "2" "0t 5"
68    ;;
69
70wzr-hp-g300nh2 |\
71pb92 |\
72ap113)
73    ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
74    ucidef_add_switch "eth0" "1" "1"
75    ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5"
76    ucidef_add_switch_vlan "eth0" "2" "0t 2"
77    ;;
78
79tl-wr1043nd)
80    ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
81    ucidef_add_switch "rtl8366rb" "1" "1"
82    ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
83    ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
84    ;;
85
86tl-wr2543n)
87    ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
88    ucidef_add_switch "switch0" "1" "1"
89    ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
90    ucidef_add_switch_vlan "switch0" "2" "0 9t"
91    ;;
92
93tl-wr841n-v1|\
94tl-wr941nd)
95    ucidef_set_interface_raw "eth" "eth0"
96    ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
97    ;;
98
99wrt160nl)
100    ucidef_set_interfaces_lan_wan "eth0" "eth1"
101    ucidef_add_switch "eth0" "1" "1"
102    ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
103    ;;
104
105wzr-hp-g300nh)
106    ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
107    ucidef_add_switch "switch0" "1" "1"
108    ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
109    ;;
110
111aw-nr580 |\
112bullet-m |\
113eap7660d |\
114rb-411 |\
115tl-mr11u |\
116tl-mr3020 |\
117tl-wa901nd |\
118tl-wa901nd-v2 |\
119tl-wr703n |\
120wp543)
121    ucidef_set_interface_lan "eth0"
122    ;;
123
124alfa-ap96 |\
125alfa-nx |\
126ap83 |\
127jwap003 |\
128pb42 |\
129pb44 |\
130routerstation|\
131wpe72)
132    ucidef_set_interfaces_lan_wan "eth1" "eth0"
133    ;;
134
135ap121 |\
136ap121-mini |\
137ap96 |\
138airrouter |\
139dir-600-a1 |\
140dir-615-c1 |\
141dir-615-e4 |\
142ja76pf |\
143rb-750 |\
144tew-632brp |\
145tl-mr3220 |\
146tl-mr3420 |\
147tl-wr741nd |\
148tl-wr741nd-v4 |\
149tl-wr841n-v7 |\
150whr-g301n |\
151whr-hp-g300n |\
152whr-hp-gn |\
153wzr-hp-ag300h)
154    ucidef_set_interfaces_lan_wan "eth0" "eth1"
155    ucidef_add_switch "eth0" "1" "1"
156    ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
157    ;;
158
159wzr-hp-g450h)
160    ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
161    ucidef_add_switch "eth0" "1" "1"
162    ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
163    ucidef_add_switch_vlan "eth0" "2" "0t 1"
164    ;;
165
166*)
167    ucidef_set_interfaces_lan_wan "eth0" "eth1"
168    ;;
169esac
170
171uci commit network
172
173exit 0
174

Archive Download this file



interactive