The MaaXBoard has a randomly assigned Wi-Fi MAC address. For most of our testing, this randomly assigned MAC address will be perfectly usable for our purposes. But if we want to be able to reliably SSH in to our MaaXBoard over Wi-Fi, then we need a stable Wi-Fi MAC address so that our network router can assign the same IP address ever time the MaaXBoard connects to the network. It is possible for us to change the Wi-Fi MAC address for the remainder of time that the MaaXBoard is powered. Please note that the address change will not persist across power cycles so make sure to change the address immediately after the board completes a reboot.
I will demonstrate three methods that you can use to change the Wi-Fi MAC address on the MaaXBoard.
This training assumes that you are using the Debian Linux Out of Box Image.
For instructions on how to program the Debian Linux Out of Box Image to a MicroSD for use by the MaaXBoard, please follow the Hackster Training "Getting Started with MaaXBoard" by Monica Houston
Gain access to the shell of the MaaXBoardThere are at least three methods to do this:
- The GUI terminal with USB keyboard, USB mouse, and a HCMI monitor.
- SSH (Secure SHell)
- Console TTL to USB adapter
I will demonstrate the SSH method from my Ubuntu host computer
I already know that my MaaXBoard was assigned IP address 192.168.1.64 by my network router as it was connected to the network over Ethernet
SSH to the MaaXBoard
$ ssh root@192.168.1.64
The password is avnet
The remainder of these instructions are to be performed within the MaaXBoard shell.
Log in to your MaaXBoard and access the terminal.
Type this command to check what the Wi-Fi MAC address is.
root@maaxboard:~# ifconfig wlan0
The first two lines of the response look like this on my board. Note that the wlan0 MAC value will be randomly assigned with each board reboot so you will see a different value than I have listed here.
wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 1e:69:7f:a2:9b:50 txqueuelen 1000 (Ethernet)
Now we are going to try three different methods to change the Wi-Fi MAC address.
Method 1 - Using ifconfigUse ifconfig to change the "ether" address
root@maaxboard:~# ifconfig wlan0 down hw ether AA:00:00:00:AA:00
Now check our work
root@maaxboard:~# ifconfig wlan0
This is the expected result
wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether aa:00:00:00:aa:00 txqueuelen 1000 (Ethernet)
Method 2 - Using ipUse ip to specify the address
root@maaxboard:~# ip link set dev wlan0 address AA:00:00:00:AA:22
Now check our work
root@maaxboard:~# ifconfig wlan0
This is the expected result
wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether aa:00:00:00:aa:22 txqueuelen 1000 (Ethernet)
Method 3 - Using macchangerFirst we must install macchanger from the Debian repository
root@maaxboard:~# apt install macchanger
You will see Apt go through the necessary steps to install macchanger and its dependencies.
Use macchanger to specify the address
root@maaxboard:~# macchanger -m AA:00:00:00:AA:44 wlan0
This is the expected result
Current MAC: aa:00:00:00:aa:22 (DIGITAL EQUIPMENT CORPORATION)
Permanent MAC: 80:91:33:fb:04:75 (unknown)
New MAC: aa:00:00:00:aa:44 (DIGITAL EQUIPMENT CORPORATION)
Now check our work
root@maaxboard:~# ifconfig wlan0
This is the expected result
wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether aa:00:00:00:aa:44 txqueuelen 1000 (Ethernet)
ConclusionNow that you have three methods to specify the Wi-Fi MAC address, you can script the process so that the MaaXBoard always boots with the same Wi-Fi MAC address, enabling you to easily SSH to the board.
Comments