Verify if the container has been assigned to the network in the container section of the JSON config. And for user generated bridge networks you can define a subnet pool to pick from (assuming the user does not manually specify a subnet). docker run -dit -network unifinet -name UnifiController jacobalberty/unifi For the default bridge (called 'bridge'), you can specify BIP (I believe that's Bridge IP make sure it's a host IP, not a network IP) in the daemon.json file. It will grab the latest image respectively the latest Unifi Controller version available from Docker Hub. While you define the image (-name UnifiController jacobalberty/unifi) assign the freshly created macvlan (-network unifinet) to the container (UnifiController). In my case unifinet.Ĭheck with docker network ls if the macvlan has been properly created. the -o parent is your network interface you want to attach your macvlan.Limiting the IP range: use -ip-range to scope the possible IPs to lease.Īvoiding certain IPs: The -aux-address marks my Synology host, which should never ever battle for that IP address (It's marked in the unifi controller's DHCP service as a fixed IP anyways). Continue with step 2 before you're wasting time to find that out. Some network gateways/controllers have set promiscuous mode by default. For Unifi controllers, do a SSH to your gateway and set: ifconfig promisc This will create a virtual adapter, that is allowed to lease an IP address from the subnet defined.įor the virtual adapter one must enable promiscuous mode in the network. If not in the GUI, how can I accomplish it over SSH/Bash?.Why can I not assign a fixed IP to the container in the GUI?.Because if I'm able to set an individual IP, why should it allow to map host ports (to container ports)? The GUI suggests to map the host ports with "auto" to the container ports, which indicates me that I do NOT understand completly the network concept of Docker.I assigned it to a new unifi-controller container instance.I created my own network in the Synology Docker GUI (with the subnet 192.168.2.0/23 and gateway 192.168.2.1).
I guess that is a cinch to deal with for most in here. Thus it would be much easier to assign that unifi container with it's own designated IP -> 192.168.2.2 (than changing all the ports).
That blocks though multiple ports I need for other services (in the future). The container of the unifi controller runs properly if I attach it to the network of the host (not the default bridge). History: I fetched the unifi controller image from Docker Hub to my Synology Docker host. Objective: Assign fixed IP address to Docker container (Unifi Controller instance).