Troubleshooting
Marketplace Troubleshooting

MAC Address Issues for Docker Containers

6min

Docker engine will generate a new MAC address each time a container is created. If you install Litmus Edge in Docker, the license depends on the MAC address. If the container is recreated and gets a new MAC address, the license will not work.

Solution

If you need to re-install Litmus Edge, don't delete the original container. Instead, stop it using the command: docker stop <container name or id>. Then, continue installing the new container.

If the original container is deleted, see the steps below to configure the new container with the same MAC address.

Step 1: Run Docker Container

In the command below, Docker Alpine is used.

docker run --name=alpine -dit alpine /bin/ash

Review the following descriptions of the parameters in the command.

  • --name: container name
  • -d: Run container in background and print container ID
  • -i: Keep STDIN open even if not attached
  • -t: Allocate a pseudo-TTY
  • alpine: alpine linux distribution
  • /bin/bash: run bash on container

Learn more about docker container run.

Step 2: Get MAC Address of Container

Use the following command to view and copy the MAC address of the container.

docker inspect alpine |grep MacAddress|tr -d ' ,"'|sort -u

If you get this error from above command: 'grep' is not recognized as an internal or external command, use the command below:

docker inspect -f '{{.NetworkSettings.MacAddress}}' alpine

Expect an output like this: MacAddress:02:42:0a:1e:32:02

Copy the MAC address part 02:42:0a:1e:32:02

Step 3: Recreate Container

Use the following command to recreate the Litmus Edge container. Replace the MAC address with your specific address information.

The use of the option --mac-address is to specify the old mac address.

docker run --name=alpine -dit --mac-address 02:42:0a:1e:32:02 alpine /bin/ash

Step 4: Verify MAC Address

Use the command in Step 2 to verify that the correct MAC address is being used by the new container.