Changing the MAC

Is it possible to use this for a tap device? I’m using openvpn with tap and the br0 gets mac from tap, so i had to do this thing in rc.local. But i need a specific mac on br0.

I think you’ve mistyped the command I gave.
When you type
cat /etc/sysconfig/network-scripts/ifcfg-eth0
you should see a line
MACADDR=12:34:56:78:90:ab

Isn’t it HWADDR=12:34:56:78:90:ab?

No, it’d be MACADDR.

My output of your command:

[root@nethserver /]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
BRIDGE=br0
DEVICE=eth0
HWADDR=90:1B:0E:1A:96:D3
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
USERCTL=no

No MACADDR :thinking:

Do you mean that i need to modify the script in a way that HWADDR is deleted and MACADDR is added instead

According to the RedHat manual, on a plain RedHat (and CentOS), yes, but don’t do it on NethServer, as the HWADDR is used internally by some components, if I’m not mistaken.

This is it!!!
For those who would later on search in the network for the similar issue and get stacked here :slight_smile:

i modified the script by using
vi /etc/sysconfig/netwokr-scripts/ifcfg-eth0 - would open up the script file
press - INSERT on the keyboard to enter into edditing mode
delete HWADDR line
add MACADDR with a new MAC addr
pres ESC to exit the eddition mode
type in :w and ENTER to save the file

reboot

DONE

i thried also with having both HWADDR and MACADDR available but it did not work

Guys would the absence of HWADDR brake another functionality ?

To me personal i face up such issue with changing the MAC several times also in other systems. pfSense for example has the feature available via GUI. I think it is pretty comfortable

Is not it reasonable and thinkable to get it implemented here as well?

Yes, I’d like to have this feature.

1 Like

Thanks a lot for the support guys. You really rock

1 Like

@filippo_carletti thanks for the command above. it works fine with a bridge-adapter. I could delete the lines in rc.local. To set the mac via database is much smarter :grin: and works even if updates restart the adapters, because my solution had the disadvantage that it only worked when the machine rebooted. If an update or something else restarted the adapters i had the problem of changing mac on br0 again. So thanks again, you solved Nik’s problem and mine in one!