Use netplan mac setting only with systemd-networkd

This commit is contained in:
Igor Pecovnik 2024-06-23 09:30:17 +02:00 committed by Igor
parent b41d055e96
commit 7b33243c27

View File

@ -37,6 +37,12 @@ generate_random_mac ()
# Set a fixed random MAC for each Ethernet interface
set_fixed_mac ()
{
# we use random mac routine only with sytemd-network.
if ! grep 'renderer: networkd' /etc/netplan/*.yaml >/dev/null; then
exit 0
fi
local netplan_config_file="/etc/netplan/20-eth-fixed-mac.yaml"
# Initialize a new Netplan config file