use correct mac address for lan
[openwrt.git] / target / linux / package / openwrt / files / network.overrides.brcm
1 # NVRAM overrides
2 #
3 # This file handles the NVRAM quirks of various hardware.
4 # THIS FILE IS NOT A REPLACEMENT FOR NVRAM
5
6 # Load sysconf defaults
7 [ -f /etc/sysconf ] && . /etc/sysconf
8
9 # linksys bug; remove when not using static configuration for lan
10 lan_proto="static"
11
12 remap () {
13 for type in lan wifi wan pppoe
14 do
15 for s in '' s
16 do
17 eval ${type}_ifname$s=\"$(nvram get ${type}_ifname$s|sed s/$1/$2/g)\"
18 done
19 done
20 }
21
22 # hacks for wrt54g 1.x hardware
23 [ "$(nvram get boardnum)" = "42" \
24 -a "$(nvram get boardtype)" = "bcm94710dev" ] && {
25 debug "### wrt54g 1.x hack ###"
26 vlan1hwname="et0"
27 vlan2hwname="et0"
28 FAILSAFE_ifnames="vlan1 vlan2 eth2"
29 remap eth0 vlan2
30 remap eth1 vlan1
31 }
32
33 # hacks for asus wl-500g deluxe
34 [ "$(nvram get boardtype)" = "bcm95365r" \
35 -a "$(nvram get boardnum)" = "45" ] && {
36 debug "### wl-500g deluxe hacks ###"
37 vlan0hwname="et0"
38 vlan1hwname="et0"
39 FAILSAFE_ifnames="vlan0 eth1"
40 remap eth0.1 vlan0
41 remap eth0 vlan1
42 }
43
44 # hacks for asus wl-300g
45 [ "$(nvram get productid)" = "WL300g" ] && {
46 debug "### wl-300g hacks ###"
47 lan_ifnames="eth0 eth2"
48 wan_ifname="none"
49 }
50
51 # hacks for wap54g hardware
52 [ "$(nvram get boardnum)" = "2" \
53 -o "$(nvram get boardnum)" = "1024" ] && {
54 debug "### wap54g hack ###"
55 wan_ifname="none"
56 FAILSAFE_ifnames="eth0 eth1"
57 }
58
59 # hacks for buffalo wla2-g54l
60 [ "$(nvram get boardnum)" = "00" \
61 -a "$(nvram get product_name)" = "Product_name" \
62 -o "$(nvram get product_name)" = "WLA2-G54L" ] && {
63 debug "### wla2-g54l hacks ###"
64 wan_ifname="none"
65 lan_ifnames="vlan0"
66 }
67
68 # hack for asus wl-500g hardware
69 [ "$(nvram get boardnum)" = "asusX" \
70 -a "$(nvram get boardtype)" = "bcm94710dev" ] && {
71 FAILSAFE_ifnames="eth0 eth2"
72 }
73
74 # defaults if lan_ifname is missing
75 [ -z "$(nvram get lan_ifname)" ] && {
76 lan_ifname="br0"
77 lan_ifnames=${FAILSAFE_ifnames:-"vlan0 vlan2 eth1 eth2 eth3"}
78 }
79
80 # defaults if wan_ifname is missing
81 [ -z "$(nvram get wan_ifname)" ] && {
82 wan_ifname="vlan1"
83 wan_proto="dhcp"
84 }
85
86 DEFAULT_lan_ipaddr=${BR2_SYSCONF_FAILSAFE_IP:-"192.168.1.1"}
87 DEFAULT_lan_netmask=${BR2_SYSCONF_FAILSAFE_NETMASK:-"255.255.255.0"}
88 DEFAULT_lan_hwaddr=${BR2_SYSCONF_FAILSAFE_MAC:-"00:0B:AD:0A:DD:00"}
89
90 # failsafe if reset is held
91 [ "$FAILSAFE" = "true" ] && {
92 echo "### YOU ARE IN FAILSAFE MODE ####"
93 lan_ifname="br0"
94 lan_ifnames=${FAILSAFE_ifnames:-"vlan0 vlan1 eth1 eth2 eth3"}
95 lan_ipaddr=$DEFAULT_lan_ipaddr
96 lan_netmask=$DEFAULT_lan_netmask
97 lan_hwaddr=$DEFAULT_lan_hwaddr
98 wan_ifname="none"
99 wifi_ifname="none"
100 }
This page took 0.046677 seconds and 5 git commands to generate.