ipq806x: add db149 support to OpenWrt init scripts
[openwrt.git] / target / linux / ipq806x / base-files / etc / uci-defaults / network
1 #!/bin/sh
2 #
3 # Copyright (c) 2015 The Linux Foundation. All rights reserved.
4 # Copyright (C) 2011 OpenWrt.org
5 #
6
7 [ -e /etc/config/network ] && exit 0
8
9 touch /etc/config/network
10
11 . /lib/functions/uci-defaults.sh
12 . /lib/ipq806x.sh
13
14 ucidef_set_interface_loopback
15
16 board=$(ipq806x_board_name)
17
18 case "$board" in
19 ap148)
20         ucidef_set_interfaces_lan_wan "eth1" "eth0"
21         ucidef_add_switch "switch0" "1" "1"
22         ucidef_add_switch_vlan "switch0" "1" "6 1 2 3 4"
23         ucidef_add_switch_vlan "switch0" "2" "0 5"
24         ;;
25 db149)
26         ucidef_set_interfaces_lan_wan "eth1 eth2 eth3" "eth0"
27         ucidef_add_switch "switch0" "1" "1"
28         ucidef_add_switch_vlan "switch0" "1" "6 1 2 3 4"
29         ucidef_add_switch_vlan "switch0" "2" "0 5"
30         ;;
31 *)
32         echo "Unsupported hardware. Network interfaces not intialized"
33         ;;
34 esac
35
36 uci commit network
37
38 exit 0