70f18cb257bf31116da93a07ec7ec0d221a307e7
[openwrt/openwrt.git] / target / linux / brcm63xx / base-files / etc / uci-defaults / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2012 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/brcm63xx.sh
12
13 ucidef_set_interface_loopback
14
15 case "$(brcm63xx_board_name)" in
16
17 cvg834g |\
18 rta770bw |\
19 rta770w |\
20 spw303v |\
21 spw500v)
22 ucidef_set_interface_lan "eth0"
23 ;;
24
25 ar1004g |\
26 bcm96338gw |\
27 bcm96338w |\
28 cpva642 |\
29 ct-5365 |\
30 ct-536p_5621t |\
31 ct-6373 |\
32 dg834g_v4 |\
33 dsl-2640b-b |\
34 dsl-2640u |\
35 fast2604 |\
36 rta1320 |\
37 v2110)
38 ucidef_set_interface_lan "eth0"
39 ucidef_add_switch "eth0" "1" "1"
40 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
41 ;;
42
43 agpf-s0 |\
44 bcm96348gw |\
45 bcm96348gw-10 |\
46 bcm96348gw-11 |\
47 bcm96358vw |\
48 bcm96358vw2 |\
49 cpva502p |\
50 dg834gt |\
51 dmv-s0 |\
52 dsl-2650u |\
53 dv-201amr |\
54 f5d7633 |\
55 fast2404 |\
56 magic |\
57 rg100a |\
58 rta1025W |\
59 td-w8900gb |\
60 usr9108 |\
61 v2500v_bb)
62 ucidef_set_interfaces_lan_wan "eth1" "eth0"
63 ucidef_add_switch "eth1" "1" "1"
64 ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5"
65 ;;
66
67 dsl-274xb-c |\
68 hg553 |\
69 hg556a_* |\
70 homehub2a)
71 ucidef_set_interface_lan "eth0.1"
72 ucidef_add_switch "eth0" "1" "1"
73 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5t"
74 ;;
75
76 dva-g3810bn |\
77 hg520 |\
78 neufbox4)
79 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
80 ucidef_add_switch "eth1" "1" "1"
81 ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5t"
82 ;;
83
84 a4001n1 |\
85 a4001n |\
86 ar-5381u |\
87 ar-5387un |\
88 bcm963281tan |\
89 bcm96328avng |\
90 bcm96368mvngr |\
91 dsl-274xb-f |\
92 dsl-275xb-d |\
93 fast2504n |\
94 fast2704v2 |\
95 hg655b |\
96 p870hw-51a_v2 |\
97 r5010un_v2 |\
98 vr-3025un |\
99 vr-3025u |\
100 vr-3026e)
101 ucidef_set_interface_lan "eth0.1"
102 ucidef_add_switch "eth0" "1" "1"
103 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t"
104 ;;
105
106 bcm96368mvwg)
107 ucidef_set_interface_lan "eth0.1"
108 ucidef_add_switch "eth0" "1" "1"
109 ucidef_add_switch_vlan "eth0" "1" "1 2 4 5 8t"
110 ;;
111
112 wap-5813n)
113 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
114 ucidef_add_switch "eth0" "1" "1"
115 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 5t"
116 ucidef_add_switch_vlan "eth0" "2" "4 5t"
117 ;;
118
119 fast2704n |\
120 dgnd3700v1_dgnd3800b)
121 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
122 ucidef_add_switch "eth0" "1" "1"
123 ucidef_add_switch_vlan "eth0" "1" "1 2 3 4 8t"
124 ucidef_add_switch_vlan "eth0" "2" "0 8t"
125 ;;
126
127 neufbox6)
128 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
129 ucidef_add_switch "switch0" "1" "1"
130 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
131 ucidef_add_switch_vlan "switch0" "2" "0 9t"
132 ;;
133
134 vg50)
135 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
136 ucidef_add_switch "switch0" "1" "1"
137 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 8t"
138 ucidef_add_switch_vlan "switch0" "2" "4 8t"
139 ;;
140
141 bcm963268bu_p300)
142 ucidef_set_interface_lan "eth0.1"
143 ucidef_add_switch "switch0" "1" "1"
144 ucidef_add_switch_vlan "switch0" "1" "0 3 4 5 6 7 8t"
145 ;;
146
147 *)
148 ucidef_set_interfaces_lan_wan "eth1" "eth0"
149 ;;
150
151 esac
152
153 uci commit network
154
155 exit 0