Auto creation of spoofed MAC address for an interface

Started by gary87sense, March 23, 2025, 06:23:31 PM

Previous topic - Next topic
Hi,

I'm new to OPNsense, bit of an odd question I suppose.....Is it possible to add a randomized spoofed MAC address to the WAN interface in OPNsense? I'm looking for this to happen once on the first boot of OPNsense, then it remains the same indefinetly for the existence of the OPNsense instance.

Just to give some background as to why I need this...I'm creating a lab in eve ng virtualization platform and I want to be able to clone the lab so I can have multiple "throwaway" instances of the same lab to work in simultaneously . The issue is the WAN interface on the labs will have the same MAC address from eve ng on the multiple OPNsense nodes. I'd like it that on initial boot up a new MAC is generated for the WAN interfaces so multiples nodes can run and each get a different IP address via DHCP. The WAN interfaces are all connected to the same L2 network upstream so identical MACs are of course a problem. Thanks in advance.

In EVE-ng you can define NIC MAC addresses... So, you can assign one OPNsense MAC to be AA:BB:AA:CC:AA:AA and have another AA:BB:AA:CC:AA:BB etc...