a53e2860add02fa3144f57966774be3318f1880e
[openwrt/openwrt.git] / target / linux / ipq40xx / base-files / etc / board.d / 02_network
1 #!/bin/sh
2 #
3 # Copyright (c) 2015 The Linux Foundation. All rights reserved.
4 # Copyright (c) 2011-2015 OpenWrt.org
5 #
6
7 . /lib/functions/uci-defaults.sh
8 . /lib/functions/system.sh
9
10 board_config_update
11
12 board=$(board_name)
13
14 case "$board" in
15 asus,rt-ac58u)
16 CI_UBIPART=UBI_DEV
17 wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486)
18 lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102)
19 ucidef_set_interfaces_lan_wan "eth0" "eth1"
20 ucidef_add_switch "switch0" \
21 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
22 ucidef_set_interface_macaddr "lan" "$lan_mac_addr"
23 ucidef_set_interface_macaddr "wan" "$wan_mac_addr"
24 ;;
25 avm,fritzbox-4040)
26 ucidef_set_interfaces_lan_wan "eth0" "eth1"
27 ucidef_add_switch "switch0" \
28 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
29 ;;
30 compex,wpj428)
31 ucidef_set_interface_lan "eth0 eth1"
32 ;;
33 glinet,gl-b1300)
34 ucidef_set_interfaces_lan_wan "eth0" "eth1"
35 ucidef_add_switch "switch0" \
36 "0u@eth0" "3:lan" "4:lan"
37 ;;
38 openmesh,a42)
39 ucidef_set_interfaces_lan_wan "eth1" "eth0"
40 ;;
41
42 meraki,mr33)
43 ucidef_set_interface_lan "eth0"
44 ;;
45 *)
46 echo "Unsupported hardware. Network interfaces not intialized"
47 ;;
48 esac
49
50 board_config_flush
51
52 exit 0