Spoof MAC address of VLAN interface on IOS

cisco-catalystcisco-iosmac addressvirtual

Is there a way to change the MAC address of VLAN interfaces (switched virtual interfaces) on IOS? I would like to configure the MAC address of a Catalyst switch. Because all VLAN interfaces derive their MAC addresses from the base MAC (show version | include Base) and the Switch(config-if)# mac-address command is missing in the context of a VLAN interface, I cannot get the desired configuration.

I'm open to any workaround, no matter how obscure.

Best Answer

A quick google search turns up the doc "Supported Platforms for Unique MAC Address Configuration on VLAN or L3 Interfaces for Catalyst Switches" which learns us that both the default behaviour as well as the potential to change the MAC address, are very different depending on the switch model (and in some cases, depending on the IOS version).

So, look up your model there but I think it is safe to assume that if Switch(config-if)# mac-address does not work, changing the MAC address is not supported on that platform.

Potential workaround

If "standby mac-address" is supported on your platform, you can configure HSRP with a virtual IP address linked to a virtual MAC. In other words if you currently have

interface vlan 2
  ip address 10.0.0.1 255.255.255.0

Then you can change this to e.g. :

interface vlan 2
  ip address 10.0.0.254 255.255.255.0
  standby 1 mac-address 1234.dead.beef
  standby 1 ip 10.0.0.1

Where 10.0.0.254 is a previously unused address. Since I'm not sure of the reason for your request, it may or may not be important to note that an ARP request for 10.0.0.254 will still reveal the switch's BIA (burnt-in address) so if you're doing this e.g. to avoid fingerprinting, it may not be optimal.