kirkwood: drop port-based VLAN setup
[openwrt/staging/chunkeey.git] / target / linux / kirkwood / base-files / etc / uci-defaults / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2012-2014 OpenWrt.org
4 #
5
6 [ -e /etc/config/network ] && exit 0
7
8 touch /etc/config/network
9
10 set_lan_dhcp() {
11 local ifname=$1
12 uci batch <<EOF
13 set network.lan='interface'
14 set network.lan.ifname='$ifname'
15 set network.lan.proto='dhcp'
16 set network.lan6='interface'
17 set network.lan6.ifname='@lan'
18 set network.lan6.proto='dhcpv6'
19 set network.lan6.reqprefix='no'
20 EOF
21 }
22
23 . /lib/functions/uci-defaults.sh
24 . /lib/kirkwood.sh
25
26 board=$(kirkwood_board_name)
27
28 ucidef_set_interface_loopback
29
30 case "$board" in
31 "dockstar")
32 set_lan_dhcp "eth0"
33 ;;
34 "iconnect")
35 set_lan_dhcp "eth0"
36 ;;
37 "ib62x0")
38 set_lan_dhcp "eth0"
39 ;;
40 "pogo_e02")
41 set_lan_dhcp "eth0"
42 ;;
43 "ea3500")
44 ucidef_set_interfaces_lan_wan "eth0" "eth1"
45 ucidef_add_switch "switch0" "1" "1"
46 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5"
47 ucidef_add_switch_vlan "switch0" "2" "4 6"
48 ;;
49 "ea4500")
50 ucidef_set_interfaces_lan_wan "eth0" "eth1"
51 ucidef_add_switch "switch0" "1" "1"
52 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5"
53 ucidef_add_switch_vlan "switch0" "2" "4 6"
54 ;;
55 "guruplug-server-plus")
56 set_lan_dhcp "eth0" "eth1"
57 ;;
58 "sheevaplug" | \
59 "sheevaplug-esata")
60 set_lan_dhcp "eth0"
61 ;;
62 *)
63 ucidef_set_interface_lan "eth0"
64 ;;
65 esac
66
67 uci commit network
68
69 exit 0