Newbie needs help w/ script: assign specific MAC address

Hi all
I’m a newbie that is running docker on my QNAP. I slowly built out my install script through google and trial and error. I noticed that the container obtains a new MAC address every restart. Unfortunately, once installed, docker doesn’t let me make changes in the UI. Does anyone know how to specify the Mac address while you are installing? What do I need to add to my script?

Thanks so much for you help!

docker run --restart always -d \
--name=CrashplanPro \
-e USER_ID=0 \
-e GROUP_ID=0 \
-p 5800:5800 \
-p 5900:5900 \
-e TZ=America/New_York \
-e CRASHPLAN_SRV_MAX_MEM=5120m \
-v /share/CACHEDEV1_DATA/Virtualize/Containers/appdata/crashplan-pro/config:/config:rw \
-v /share/CACHEDEV1_DATA:/storage:rw \
-v /share/CE_CACHEDEV5_DATA/Boy-09/CP_Archive.01.2014-11.2021:/storage/CP_Archive/01.2014-11.2021:rw \
-v /share/CE_CACHEDEV5_DATA/Boy-09/CP_Archive.01.2014-10.2021:/storage/CP_Archive/01.2014-10.2021:rw \
-v /share/CE_CACHEDEV5_DATA/Boy-09/CP_Archive.12.2021:/storage/CP_Archive/12.2021:rw \
jlesage/crashplan-pro

You can find it in the official documentation for docker run, in the network-settings section:

You need to add this (of course with your valid mac instead) to your docker run command:
--mac-address="12:34:56:78:9a:bc"

Hi Mayay,

Thanks so much for your quick reply! Doesn’t seems like I inserted it correctly. I am new so I might have messed up the syntax.


docker run  --restart always -d \
	--mac-address="the Mac address here” \
	--name=CrashplanPro \
	-e USER_ID=0 \
	-e GROUP_ID=0 \
	-p 5800:5800 \
	-p 5900:5900 \
	-e TZ=America/New_York \
	-e CRASHPLAN_SRV_MAX_MEM=5120m \
	-v /share/CACHEDEV1_DATA/Virtualize/Containers/appdata/crashplan-pro/config:/config:rw \
	-v /share/CACHEDEV1_DATA:/storage:rw \
	-v /share/CE_CACHEDEV5_DATA/Boy-09/CP_Archive.01.2014-11.2021:/storage/CP_Archive/01.2014-11.2021:rw \
	-v /share/CE_CACHEDEV5_DATA/Boy-09/CP_Archive.01.2014-10.2021:/storage/CP_Archive/01.2014-10.2021:rw \
	-v /share/CE_CACHEDEV5_DATA/Boy-09/CP_Archive.12.2021:/storage/CP_Archive/12.2021:rw \
	jlesage/crashplan-pro

Apart from the double quotes, everything looks good to me. Make sure to replace them with double quotes you actually type on your keyboard.

Thanks again Metin, it was the quotes. You truly were taking to a newbie. Unfortunately it did not work with QNAP’s docker, still did not assign a Mac address. I found a work around on reddit for my fellow NAPers. If you go to your container storage area in your qnap volume, and go to Container-Station-Data/lib/docker/containers - find your container folder (a very long hashed folder name for each container) - inside you’ll find a qnap.json file. In this file locate the Network section (It might be easier to copy/paste into a JSON parser site). In there you need a new KEY:VALUE (string+string) like this: “mac_addr” : “xx:xx:xx:xx:xx:xx”. If you don’t know how json is formatted, you need to add a comma for each key/value pair.