Linux – How to change the MAC of outgoing ARP requests

arplinux

Is it possible to change the source MAC of all the outgoing ARP requests to a specific MAC instead of using the interface MAC in linux?

Is there a way to do this from the ARP tables?

Best Answer

Yes, this can be achieved by adding rules by arptables.

Use this rule:

arptables -A OUT --source-hw xx:xx:xx:xx:xx:xx -j mangle --mangle-hw-s yy:yy:yy:yy:yy:yy

You may also add more filtering options if you need example interface, subnet etc.

For more information, refer to the man page.

Related Question