Otherwise Docker could assign any IP in the subnet which would not work for the controller.Īt this point everything works, except that I cannot connect to the controller from the workstation that hosts Docker. Pretty much the same as in the initial post in this thread but using the macvlan created by Docker and setting an IP for docker to use for the controller. Docker does not use an external DHCP service so the subnet assigned to Docker needs to be excluded from use by the unifi DHCP server.ĭocker run -rm -init -network unifinet -ip 192.168.110.226 -e TZ=America/Pacific -e RUNAS_UID0=false -e UNIFI_UID=$uUID -e UNIFI_GID=$uGID -v $PWD/unifi-vol :/unifi:Z -v $PWD/run:/var/run/unifi:Z -name unifi jacobalberty/unifi:latest The ip-range tells Docker to use IPs in that subnet and the -aux-address tells Docker to not use that IP for reasons which will be clear in step 3 below. This creates the macvlan in the same subnet used for the unifi network here on the ranch.
I reserved the last 30 hosts in the range for use with the macvlans (yes there are 2). DHCP in the USG is configured to issue ip addresses in the. Important note: macvlans are supported by Docker only on linux. The steps taken below are set in this context - the unifi controller hosted in docker on a workstation on the same subnet as the USG, Unifi switches, and Access Points. Docker is running on my home workstation (fedora 29) at the moment. Longer answer: I run the Unifi Controller in Docker using Jacob's excellent Docker implementation. Unifi Cloud Access now displays a routable IP on the ranch subnet instead of a private docker IP. Short answer: macvlan is indeed a solution and solved a couple of other vexing problems such as (re)adopting devices after changing the network subnet the devices are on or adding a USG to the system. Unifi Cloud Access displays the public IP for the controller not the docker IP. version 3 -ĭocker run -rm -init -p 8080:8080 -p 8443:8443 -p 3478:3478/udp -p 6789:6789/tcp -p 10001:10001/udp -e TZ=America/Pacific -e RUNAS_UID0=false -e UNIFI_UID=$uUID -e UNIFI_GID=$uGID -v $PWD/unifi-vol:/unifi:Z -v $PWD/run:/var/run/unifi:Z -name unifi jacobalberty/unifi:latest What do you expect to happen?
Note that the :Z postfix on the volume mounts is for correct selinux configuration. Latest What complete docker command or docker-compose.yml do you use to launch the container (omitting sensitive values)? Is there a setting I can use that will enable the controller to send the correct IP?įedora 29 with 29 What tag are you using The IP displayed at Unifi Cloud Access is 172.17.0.2 which almost certainly the docker container IP and not the IP for the fedora system hosting docker and this controller. I have the controller registered with the Unifi Cloud Access. Thank you for providing the Unifi controller as a docker container. I have been using unifi-docker for quite some time with few if any issues not of my own making.