wgstarks Posted August 12, 2021 Share Posted August 12, 2021 (edited) 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, 2021 by wgstarks Quote Link to comment
tjb_altf4 Posted August 12, 2021 Share Posted August 12, 2021 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. 1 Quote Link to comment
wgstarks Posted August 12, 2021 Author Share Posted August 12, 2021 Thanks. I can’t imagine a scenario where I would want to change the IP after I configure the docker. Quote Link to comment
wgstarks Posted August 13, 2021 Author Share Posted August 13, 2021 Can I run multiple docker/vm’s on br0? Quote Link to comment
ken-ji Posted August 16, 2021 Share Posted August 16, 2021 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. Quote Link to comment
Recommended Posts
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.