August 12, 20214 yr I have a docker container that I’m setting up (locast2plex) on br0. I want to reserve a static IP for it on my pfsense router but I’m unsure how to get the MAC used for this docker? Edited August 12, 20214 yr by wgstarks
August 12, 20214 yr Community Expert To do this, get the container ID for your docker docker container ls Then use this ID, for example ID: b88b6ee9cf09 docker inspect b88b6ee9cf09 MAC address will be listed right near the end of the output, and will start with 02:42:c0 Note if you change the IP assignment in docker, the mac will change. You can force a static mac in docker, but docker doesn't check if mac is unique, so use this as a last resort.
August 12, 20214 yr Author Thanks. I can’t imagine a scenario where I would want to change the IP after I configure the docker.
August 16, 20214 yr On 8/12/2021 at 10:26 AM, wgstarks said: I have a docker container that I’m setting up (locast2plex) on br0. I want to reserve a static IP for it on my pfsense router but I’m unsure how to get the MAC used for this docker? Docker containers don't actually get their IP from the network DHCP server. the docker engine assigns them in order based on the pool you've set in the network config. Its your job to configure it so that the range will be outside of your DHCP pool (or have a way to ensure they will never conflict) Here's my docker networks (w/VLAN): The network is constrained to get IPs from 192.168.2.128-192.168.2.255 (my DHCP range is outside that range) If you want each container to have a static IP, you can use just set the desired IP in the container settings On 8/14/2021 at 3:52 AM, wgstarks said: Can I run multiple docker/vm’s on br0? You can connect as many containers or VMs as you want to the network interface, just take care to avoid dynamic IP assignment collision between the containers and the DHCP server.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.