red: change mac address of nas0 device.
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 1 Mar 2014 15:01:11 +0000 (16:01 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sat, 1 Mar 2014 15:01:11 +0000 (16:01 +0100)
Traverse Technology has reported that ppp over atm-bridge is not working
because there is a bogus mac address at the virtual nas0 device.

src/initscripts/init.d/networking/red

index 28df551..b09737e 100644 (file)
@@ -175,6 +175,14 @@ case "${1}" in
                                boot_mesg "Createing ATM-Bridge as $PPP_NIC ..."
                                br2684ctl -c0 -e${ENCAP} -a0.${VPI}.${VCI} >/dev/null 2>&1 &
                                sleep 1
+
+                               # use user-defined or green mac address for nas0
+                               if [ -n "$MAC" ]; then
+                                       ip link set dev nas0 address ${MAC}
+                               else
+                                       ip link set dev nas0 address $(cat /sys/class/net/green0/address)
+                               fi
+
                                if [ "$TYPE" == "pppoeatm" ]; then
                                        TYPE="pppoe"
                                fi