Document toolboxDocument toolbox

Fixed MAC adress

In some cases, licensed software requires the use of a fixed MAC address of the device on which it is installed. A specific case of this is the TeamViewer software, which requires a fixed MAC address to generate session IDs. This requirement has a direct impact on users, as the ID changes when the MAC address changes. This makes it difficult or even impossible to access devices via TeamViewer.

The MAC address (Media Access Control) is a unique identifier assigned to each network device. It is used to identify devices in a network and to enable the exchange of data. In TeamViewer, the MAC address is used to generate a unique session ID that is required for remote access and communication between the host and client device.

By binding the session ID to the MAC address, TeamViewer ensures that the connection between the devices is established correctly. However, if the MAC address of the host device changes, whether due to a hardware modification or other reasons, the session ID becomes invalid. As a result, users will no longer be able to access their devices via TeamViewer, as the software will no longer be able to identify the devices correctly.

To solve the problem of changing MAC address after each boot of Revolution Pi and assign a fixed MAC address to the interfaces "pileft" and "piright", you can manually edit the file "/boot/config.txt" in Raspbian for Revolution Pi. This file contains configuration settings for the system and allows you to adjust various parameters. The following script helps to adjust the values in config.txt.

Here is a brief guide on how a user can create and make an executable shell script (.sh):

  1. Open a terminal application on your Revolution Pi or connect via SSH.

  2. Navigate to the desired directory where you want to create the script using the cd <directory path> command. For example:

    cd /home/pi/
  3. Create a new empty file with your desired name and the ".sh" file extension using a text editor of your choice. For example:

    nano static_pibridge_mac.sh
  4. Copy the script code into Nano text editor.

    #!/bin/bash if [[ $(id -u) != 0 ]]; then echo "usage: sudo $(basename $0)" exit 1 fi pibridge_static_mac() { interface=$1 if [[ $interface != "pileft" && $interface != "piright" ]]; then echo 2>&1 "interface is not a PiBridge interface: ${interface}" exit 3 elif [[ ! -e /sys/class/net/${interface} ]]; then echo 2>&1 "warning: network interface does not exists: ${interface}" fi mac=$(ip l show $interface | grep ether | xargs | cut -f 2 -d ' ' | sed -e 's/://g') mac_hi=${mac:0:8} mac_lo=${mac:8:12} grep -q dtparam=${interface}_mac_hi /boot/config.txt || echo "dtparam=${interface}_mac_hi=0x$mac_hi" >> /boot/config.txt grep -q dtparam=${interface}_mac_lo /boot/config.txt || echo "dtparam=${interface}_mac_lo=0x$mac_lo" >> /boot/config.txt } pibridge_static_mac pileft pibridge_static_mac piright
  5. Save the script by pressing "Ctrl + X", followed by "Y" to save the file and "Enter" to exit the Nano text editor.

  6. Enter the following command to make the script executable:

    This grants the script execution permission.

  7. To run the script, enter the following command:

    This will start the script and execute the code.