Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

IP address assignment to Docker containers

Featured Replies

Yea.. the syntax for the CIDR is smart as well, but just to make sure we are on the same page, since I removed the bridge, the docker engine was unable to add the network since one already existed.  Maybe add instructions on removing the docker image file when/if that happens?

  • Replies 63
  • Views 20.9k
  • Created
  • Last Reply

this is an interesting post, glad you guys are finding bugs, however this whole thread i cant help but read br0 as bro. as in what's up bro...

 

 

carry on.

I really like the new feature to assign IP addresses to individual dockers.  I've been playing with this for a few days and have some questions / ideas:

  1. In 6.3.5, if I switch the docker editor to Advanced View, it "sticks" until I change it back.  In 6.4 rc2, the editor always loads in Basic View. Was this change intentional?
     
  2. I noticed that when you select a Network Type of "br0", changing the port has no effect. And you also can't assign multiple dockers to the same IP. Does this imply that containers on br0 have full access to the network similar to "Host" mode?  
     
  3. A potential enhancement idea would be to prevent users from changing a port setting when the Network Type doesn't allow it.
     
  4. Another idea would be when you are working a standard /24 subnet, only give users the option to input the final octet of an ip address rather than allowing/making them input the whole thing. 
     
  5. In the "Network Type" dropdown (Bridge/Host/None/br0), br0 is rather unfriendly. Perhaps we could add a prefix to the display such as "Network: br0"?
42 minutes ago, ljm42 said:

I really like the new feature to assign IP addresses to individual dockers.  I've been playing with this for a few days and have some questions / ideas:

  1. In 6.3.5, if I switch the docker editor to Advanced View, it "sticks" until I change it back.  In 6.4 rc2, the editor always loads in Basic View. Was this change intentional?
     
  2. I noticed that when you select a Network Type of "br0", changing the port has no effect. And you also can't assign multiple dockers to the same IP. Does this imply that containers on br0 have full access to the network similar to "Host" mode?  
     
  3. A potential enhancement idea would be to prevent users from changing a port setting when the Network Type doesn't allow it.
     
  4. Another idea would be when you are working a standard /24 subnet, only give users the option to input the final octet of an ip address rather than allowing/making them input the whole thing. 
     
  5. In the "Network Type" dropdown (Bridge/Host/None/br0), br0 is rather unfriendly. Perhaps we could add a prefix to the display such as "Network: br0"?

I would add

 

6. Ability to view assigned IP addresses of dockers from the dockerMan page.

FYI.  You can also go into the Advanced View of the container add "--mac-address 02:42:0a:0a:00:66" to the Extra parameters and will keep a consistent MAC address across rebuilds.  Helpful if you have a Unifi controller and want everything labeled right, or to use DHCP reservations in your router.

4 hours ago, ljm42 said:

I really like the new feature to assign IP addresses to individual dockers.  I've been playing with this for a few days and have some questions / ideas:

  1. In 6.3.5, if I switch the docker editor to Advanced View, it "sticks" until I change it back.  In 6.4 rc2, the editor always loads in Basic View. Was this change intentional?
     
  2. I noticed that when you select a Network Type of "br0", changing the port has no effect. And you also can't assign multiple dockers to the same IP. Does this imply that containers on br0 have full access to the network similar to "Host" mode?  
     
  3. A potential enhancement idea would be to prevent users from changing a port setting when the Network Type doesn't allow it.
     
  4. Another idea would be when you are working a standard /24 subnet, only give users the option to input the final octet of an ip address rather than allowing/making them input the whole thing. 
     
  5. In the "Network Type" dropdown (Bridge/Host/None/br0), br0 is rather unfriendly. Perhaps we could add a prefix to the display such as "Network: br0"?

1. Maybe a regression error, need to test and verify

2. macvlan works similar to host mode, but allows individual IP addresses for the containers

3. this is already in place, do you have an example?

4. nice thought but we loose flexibility, subnet may be different size or do you mean switch view when /24?

5. not sure what to prefix, still open for ideas

6. View assigned IP addresses is doable, put it on my list

1. Thanks for checking!

 

2. A little bummed, was hoping for more of "bridge mode on a different ip". But it is still a nice feature :)

 

3.  Try this:
- Add the LSIO PlexPy container.
- Stay in bridge mode, change "Host Port 1" from 8181 to to 8182 and the run command sends "-p 8182:8181/tcp" as I would expect.
- Change it back to 8181, no problems.
- Change to host mode and the run command sends "TCP_PORT_8181"="8181". Not sure what that means?
- Change port from 8181 to 8182 (I was suggesting this option could be disabled or even hidden when in host mode) and it sends "TCP_PORT_8182"="8182". Not sure why both sides change to 8182?
- Change back to bridge mode and now it sends "-p 8182:8182/tcp". Unfortunately both the host and container ports are now 8182 so the docker doesn't work.

 

4. I was thinking that if the network uses a standard /24 subnet it could display the first three octets and only the fourth would be editable. Basically just trying to make things easier/obvious for the user.

 

If the network is more complex than a /24, the user should know what they are doing so just leave the whole thing freeform.

 

5. I was thinking the prefix would be "Network:" so it would display as "Network:br0"

 

6. Thanks for adding that smdion! It should have been on my list :)

2 hours ago, smdion said:

FYI.  You can also go into the Advanced View of the container add "--mac-address 02:42:0a:0a:00:66" to the Extra parameters and will keep a consistent MAC address across rebuilds.  Helpful if you have a Unifi controller and want everything labeled right, or to use DHCP reservations in your router.

 

Hmm... I don't think this is exactly right. As far as I can tell, docker assigns the IP addresses itself, not the router's dhcp server. I say this because my router is set to give out addresses in the 192.168.10.100-225 range. But when the docker pool was left at the default setting (192.168.10.0/24), my test docker was assigned 192.168.10.2. That tells me docker picked the lowest (hopefully unused) ip in the pool, with no input from the dhcp server.

34 minutes ago, ljm42 said:

1. Thanks for checking!

 

2. A little bummed, was hoping for more of "bridge mode on a different ip". But it is still a nice feature :)

 

3.  Try this:
- Add the LSIO PlexPy container.
- Stay in bridge mode, change "Host Port 1" from 8181 to to 8182 and the run command sends "-p 8182:8181/tcp" as I would expect.
- Change it back to 8181, no problems.
- Change to host mode and the run command sends "TCP_PORT_8181"="8181". Not sure what that means?
- Change port from 8181 to 8182 (I was suggesting this option could be disabled or even hidden when in host mode) and it sends "TCP_PORT_8182"="8182". Not sure why both sides change to 8182?
- Change back to bridge mode and now it sends "-p 8182:8182/tcp". Unfortunately both the host and container ports are now 8182 so the docker doesn't work.

 

4. I was thinking that if the network uses a standard /24 subnet it could display the first three octets and only the fourth would be editable. Basically just trying to make things easier/obvious for the user.

 

If the network is more complex than a /24, the user should know what they are doing so just leave the whole thing freeform.

 

5. I was thinking the prefix would be "Network:" so it would display as "Network:br0"

 

6. Thanks for adding that smdion! It should have been on my list :)

 

Regarding 3 it has always been the case that if you change from bridge to host the ports becomes variables in the run command. I never bothered to report it as it isn't really doing any harm. 

10 hours ago, smdion said:

FYI.  You can also go into the Advanced View of the container add "--mac-address 02:42:0a:0a:00:66" to the Extra parameters and will keep a consistent MAC address across rebuilds.  Helpful if you have a Unifi controller and want everything labeled right, or to use DHCP reservations in your router.

I do have a Unifi Controller so I am interested in this - but what do you mean "labeled right"?  Do you meant that it will automatically be labeled as "Docker Container" by default or something like that?  You would likely want to then go in to the Unifi web UI and rename it anyhow to something like "Unifi Docker Container".  Or do you mean something else?  And why did you choose a MAC starting with 02:42:0a - why not use 00:1C:CF which is assigned to LIMETEK :D (according to OUI).

9 hours ago, ljm42 said:

 

Hmm... I don't think this is exactly right. As far as I can tell, docker assigns the IP addresses itself, not the router's dhcp server. I say this because my router is set to give out addresses in the 192.168.10.100-225 range. But when the docker pool was left at the default setting (192.168.10.0/24), my test docker was assigned 192.168.10.2. That tells me docker picked the lowest (hopefully unused) ip in the pool, with no input from the dhcp server.

 

Yea.. you are right, was an additional thought I had before going to bed, should have thought it through more.

 

1 hour ago, wayner said:

I do have a Unifi Controller so I am interested in this - but what do you mean "labeled right"?  Do you meant that it will automatically be labeled as "Docker Container" by default or something like that?  You would likely want to then go in to the Unifi web UI and rename it anyhow to something like "Unifi Docker Container".  Or do you mean something else?  And why did you choose a MAC starting with 02:42:0a - why not use 00:1C:CF which is assigned to LIMETEK :D (according to OUI).

 

02:42:0a was the mac that was assigned when I built the container, I should change it :)  And yea. I just meant adding an alias in the Controller.

  • 2 weeks later...
On 6/7/2017 at 11:09 PM, ljm42 said:

1. In 6.3.5, if I switch the docker editor to Advanced View, it "sticks" until I change it back.  In 6.4 rc2 rc4, the editor always loads in Basic View. Was this change intentional?

 

3.  Try this:
- Add the LSIO PlexPy container.
- Stay in bridge mode, change "Host Port 1" from 8181 to to 8182 and the run command sends "-p 8182:8181/tcp" as I would expect.
- Change it back to 8181, no problems.
- Change to host mode and the run command sends "TCP_PORT_8181"="8181". Not sure what that means?
- Change port from 8181 to 8182 (I was suggesting this option could be disabled or even hidden when in host mode) and it sends "TCP_PORT_8182"="8182". Not sure why both sides change to 8182?
- Change back to bridge mode and now it sends "-p 8182:8182/tcp". Unfortunately both the host and container ports are now 8182 so the docker doesn't work.

 

4. I was thinking that if the network uses a standard /24 subnet it could display the first three octets and only the fourth would be editable. Basically just trying to make things easier/obvious for the user.

 

If the network is more complex than a /24, the user should know what they are doing so just leave the whole thing freeform.

 

5. I was thinking the prefix would be "Network:" so it would display as "Network:br0".  "Custom:br0" could work too.

 

6. Ability to view assigned IP addresses of dockers from the dockerMan page.

 

There has been a lot of great discussion on a lot of threads, wondering if these ideas were lost if the mix?

  • 2 years later...

All of my dockers are now using "172.16.x.x" addresses (no idea where that came from), and none can see the internet, but I can see them all from the LAN (ie, I can log into sab at 192.168.0.5:8085 but sab can't connect to the internet).

 

I just rebooted my server after switching UPS's.... Before this all dockers were 192.168.0.5..........  They are all set to "bridge"

 

Edited by tucansam

  • 11 months later...

ohhhh dear,

 

i read this thread to give my plex docker a static IPv6.

i put a MAC address to extra parameter like smdion mentioned. (i copy & paste his command)

the result was an error, i hit done an then 😱 my plex container dissappear.

how can i fix it an delete this MAC line from the extra parameter???

It looks like this:

1809756317_Bildschirmfoto2020-08-21um12_58_28.thumb.png.e043ac67e9a017cb4c2687383808bf95.png

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.