3 # Copyright (c) 2015 The Linux Foundation. All rights reserved.
4 # Copyright (c) 2011-2015 OpenWrt.org
7 .
/lib
/functions
/uci-defaults.sh
8 .
/lib
/functions
/system.sh
16 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
20 wan_mac_addr
=$
(mtd_get_mac_binary_ubi Factory
20486)
21 lan_mac_addr
=$
(mtd_get_mac_binary_ubi Factory
4102)
22 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
23 ucidef_add_switch
"switch0" \
24 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
25 ucidef_set_interface_macaddr
"lan" "$lan_mac_addr"
26 ucidef_set_interface_macaddr
"wan" "$wan_mac_addr"
29 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
30 ucidef_add_switch
"switch0" \
31 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
34 ucidef_set_interface_lan
"eth0 eth1"
41 ucidef_set_interface_lan
"eth0"
44 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
45 ucidef_add_switch
"switch0" \
46 "0u@eth0" "3:lan" "4:lan"
49 wan_mac_addr
=$
(mtd_get_mac_ascii devinfo hw_mac_addr
)
50 lan_mac_addr
=$
(macaddr_add $
(mtd_get_mac_ascii devinfo hw_mac_addr
) +1)
51 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
52 ucidef_add_switch
"switch0" \
53 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
54 ucidef_set_interface_macaddr
"wan" "$wan_mac_addr"
55 ucidef_set_interface_macaddr
"lan" "$lan_mac_addr"
59 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
62 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
63 ucidef_add_switch
"switch0" \
64 "0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
67 echo "Unsupported hardware. Network interfaces not intialized"