br0 question


Recommended Posts

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.

  • Like 1
Link to comment
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):

image.thumb.png.9208214d1517de5f38a9de59d238b0e4.png

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

image.thumb.png.a90f34432755cc23b85c95b3080253dc.png

 

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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.