I have a custom version of CENTOS that I'm importing into Hyper-V on a Windows Server. Whenever I import it however, the mac addresses of eth1 and eth2 are now different. So they get incremented to eth3 and eth4.
I've written a script that can detect when this happens and edit the
/etc/udev/rules.d/70-persistent-net-rules file so that it reverts to eth1 and eth2 after a reboot.
But a better way of doing this, I think, would be to find the new mac addresses early at boot, then edit my
/etc/udev/rules.d/70-persistent-net-rules file before udev loads at all. That way it'll boot with the recommended settings.
Static mac addresses are not an option for this.
Is there a way for me to get the new mac addresses before they're assigned? Also is there a way to predict which eth they're going to be assigned to?