You are not logged in.
Pages: 1
had to replace my motherboard yesterday and as a result the computer's MAC address changed.
as a result of the MAC change the computer could no longer connect to the LAN. ifup would fail as the DHCP broadcast failed. digging around i 'found' the file /etc/udev/rules.d/70-persistent-net.rules where the MAC was hardcoded. manually editing this file, replacing the old MAC with the new MAC, then rebooting fixed the problem.
in the 70-persistent-net.rues file is mentions that it was generated by /lib/udev/write_net_rules. found a mention in stack-exchange (i know, i know) that it was possible to re-generate this file with this command-line
# export INTERFACE=eth0; export MATCHADDR="xx:xx:xx:xx:xx:xx"; /lib/udev/write_net_rules
did not try this as a manual edit worked, but it left me curious. what is the recommended way to update this file when the MAC changes?
Offline
Interesting.. can also be set from the base network stanza.. either of the two eth0 iface option examples below should work.
# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
hwaddress ether 11:22:33:44:55:66
pre-up ip link set dev eth0 address 11:22:33:44:55:66Regards
Offline
That /etc/network/interface block would be used to assign the MAC address, wherease the UDEV rule is a condition to only apply for the given MAC address.
Another way to change that udev rules file is by removing it and reboot.
Offline
Another way to change that udev rules file is by removing it and reboot.
This has been my course of action every time I've been in this situation (a lot of them).
Offline
Pages: 1