Changing MAC address temporarily inside LUbuntu or LInux instance

2

I'm aware of how to change a MAC address in VMWare using the configuration dialog from within the program (or by modifying the vmx/cfg properties file). However, for the purposes of building a networking lab for students to use in investigating the changing of MAC addresses, I would like the students to use a mechanism like the following to change the MAC address:

sudo ifconfig ens33 down sudo ifconfig ens33 hw ether 02:03:04:05:06:07 sudo ifconfig ens33 up

This does not work for me Do I need to create a rule under udev or use some other mechanism? Thanks.

Michael Robbeloth

Posted 2018-08-17T20:31:41.857

Reputation: 41

Answers

1

Hit Ctrl + alt + T on the keyboard from the lubuntu desktop.

Check your interface names with ifconfig

When you know the name of the interface you want to change:

Ifconfig eth0 down
Ifconfig eth0 hw ether 11:22:33:44:55:66
Ifconfig eth0 up

Depending on your setup you may have to put sudo before these commands.

You can also change it in the network settings gui for the adapter.

Note: the drivers of the nic must support this feature, if it doesn't then the commands will have no effect.

Tim_Stewart

Posted 2018-08-17T20:31:41.857

Reputation: 3 983