e4e3566c9d558241b37ba7cfc1ef109d123d97d8
[openwrt.git] / target / linux / mpc85xx / base-files / etc / uci-defaults / 02_network
1 #!/bin/sh
2 # Copyright (C) 2014 OpenWrt.org
3
4 [ -e /etc/config/network ] && exit 0
5
6 touch /etc/config/network
7
8 . /lib/functions/uci-defaults.sh
9 . /lib/mpc85xx.sh
10 . /lib/functions.sh
11 . /lib/functions/system.sh
12
13 ucidef_set_interface_loopback
14
15 board=$(mpc85xx_board_name)
16
17 case "$board" in
18 tl-wdr4900-v1)
19         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
20         ucidef_add_switch "switch0" "1" "1"
21         ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
22         ucidef_add_switch_vlan "switch0" "2" "0t 1"
23         ucidef_set_interface_macaddr lan "$(mtd_get_mac_binary config 338)"
24         ucidef_set_interface_macaddr wan "$(mtd_get_mac_binary config 344)"
25         ;;
26 *)
27         ucidef_set_interfaces_lan_wan "eth0" "eth1"
28         ;;
29 esac
30
31 uci commit network
32
33 exit 0