
In this guide, we’ll show how to install the macchanger program on major Linux distros and then use the macchanger command to change the MAC address of a network interface either to a random value or some specific number. There are both legitimate and shady reasons for why a Linux user may find the need to change a MAC address.

On Linux systems, one of the easiest ways to do this is with the macchanger command line program. However, it’s still possible to change or “spoof” a MAC address temporarily. Unlike an IP address, which is temporary and can be changed easily, MAC addresses are hardcoded into a network interface from the manufacturer. The router will know which device it has assigned an IP address to by referring to the MAC address. One of the most common examples would be in the case of DHCP, where a router assigns an IP address to a network interface automatically. It’s used by many system programs and protocols in order to identify a network interface. Hwaddress ether xx:xx:xx:xx:xx:xx #fixed mac addressĪddress x.x.x.A Media Access Control (MAC) address is a unique number that gets assigned to every network interface, including Ethernet and wireless. MACADDR=a0:36:9f:0f:b1:70 #Assigning fixed mac addressīONDING_OPTS="mode=active-backup primary=eno1 miimon=100" # cat /etc/sysconfig/network-scripts/ifcfg-bond0 # cat /etc/sysconfig/network-scripts/ifcfg-eno2 #Redhat/Centos # cat /etc/sysconfig/network-scripts/ifcfg-eno1 Here is sample interface and bond file config, MACADDR may solve your issue. How do I prevent this MAC address generation and tell networkd to just use one from the slaves? Files For other kind of netdevs, if this option is not set, then MAC address is generated based on the interface name and the machine-id(5).

If this option is not set, "vlan" devices inherit the MAC address of the physical interface.

Please specify it in "" section of the corresponding work(5) file. For "tun" or "tap" devices, setting MACAddress= in the "" section is not supported. This breaks DHCP, and doesn't follow the expectation set by the Linux kernel bonding documentation that states that the bond interface will take the MAC address of one of its slaves.Īccording to the networkd documentation, the issue appears to be this: When I add the config files below into /etc/systemd/network and restart systemd-networkd, I find that the MAC addresses of bond0, eth0 and eth2 have all been changed to a single, locally administered address.
