WHAT YOU WILL LEARN?
1- Setting MAC Addresses from Script File
2- Setting MAC Addresses from Text Editor
ENVIRONMENT
Hardware: MILBOARD-XV
OS: Jetpack 5.0.2
In this blog-post, we will set static MAC addresses for all Ethernet interface on MILBOARD-XV. On MILBOARD-XV, each Ethernet interface get new MAC and IP addresses for each reboot. To avoid this problem, we will set static MAC addresses for them and keep the IP addresses are working as expected (For each reboot, the IP address will not change until DHCP server gives another IP address).
You can set static MAC address for each one with script file or manually by using a text editor. If you want to do it with script file, please continue to the following step. If you want to do it manually, please continue to the next section (Setting MAC Addresses from Text Editor),
[Option-1] Setting MAC Addresses from Script File
First, check the Ethernet interfaces with the following command below:
ifconfig
As you can see that there are 5 Ethernet interfaces on MILBOARD-XV. Each one has its own MAC address (the "ether" parameter from "ifconfig") and IP address (the "inet" parameter from "ifconfig").
To set static MAC address for each interface, you need to download and extract the script file from here.
Then, type the following command for 5 Ethernet interfaces:
sudo ./jetson_set_mac_address.sh eth0 eth1 eth2 eth3 eth4
If you do not get any problems on that, you will receive "Done." message from it.
Afterwards, you can reboot your system. After the Jetson powered up, you can check the MAC and IP addresses for each Ethernet interface.
ifconfig
As you can see that the MAC and IP addresses are the same.
[Option-2] Setting MAC Addresses from Text Editor
First, check the Ethernet interfaces with the following command below:
ifconfig
Type the following command below for opening the nv.sh file (We used gedit to modify the file. You can use another text editors as well.):
sudo gedit /etc/systemd/nv.sh
After the text file opened, you need to add static MAC address configuration for each Ethernet interface. The integrated command structure look like this:
ifconfig {NETWORK_INTERFACE} down
ifconfig {NETWORK_INTERFACE} hw ether {MAC_ADDRESS}
ifconfig {NETWORK_INTERFACE} up
On our side, we typed the following commands in it:
#MAC address patch for network interfaces
ifconfig eth0 down
ifconfig eth0 hw ether ea:8c:12:97:87:33
ifconfig eth0 up
ifconfig eth1 down
ifconfig eth1 hw ether 82:23:0d:eb:b9:a9
ifconfig eth1 up
ifconfig eth2 down
ifconfig eth2 hw ether ae:7e:0c:fe:c9:1e
ifconfig eth2 up
ifconfig eth3 down
ifconfig eth3 hw ether b2:78:ce:97:b7:5d
ifconfig eth3 up
ifconfig eth4 down
ifconfig eth4 hw ether 48:b0:2d:18:4f:7a
ifconfig eth4 up
Then, save the file and exit from the text editor.
Afterwards, you can reboot your system. After the Jetson powered up, you can check the MAC and IP addresses for each Ethernet interface.
ifconfig
As you can see that the MAC and IP addresses are the same.
Thank you for reading our blog post.