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.

How to setup IPs for dockers?

Featured Replies

I've not had any luck finding a guide on how to do this.

 

Can anyone point me to where I can learn about how to do this?  I'm running 6.4.0-rc9f.

 

thanks

david

  • Replies 55
  • Views 17.1k
  • Created
  • Last Reply
  • Author

I had seen this, but I thought that there was official support in 6.4.  Is that the official support?

 

thanks

david

With unRAID version 6.4 you just edit the docker container and choose a custom network, e.g. br0, as network type.

 

Optionally you can set a fixed IP address to the container, which must be within the subnet assigned to the interface (e.g. br0).

 

docker-ip-address.thumb.png.95af05171aaee73bd4100a859bbfc241.png

  • Author

I only see Bridge, Host and none. I don't see br0 as an option.  Is there something else I need to do?

 

I do have bridging enabled with eth0 as a member of br0 in network settings.  Is that incorrect?

 

thanks

 

Try stopping and restarting the Docker service (see settings page). Upon starting the Docker service it should find all available networks  (br0 in your case) and make them available in the dropdown list for the container.

 

Have you created any custom (macvlan) networks manually in the past? If so, these need to be deleted as they will interfere with the automatic creation in unRAID 6.4.

 

  • Author

Do I need to set this up?

 

image.png.8de1cd4edccee6d629610e798be29cb6.png

  • Author

Start/stopping didn't make br0 appear.  I did fill out the custom netork for br0 as well, but it didn't help either.

The optional DHCP pool is used to defined a range of IP addresses for automatic assignment to containers in case a container is not given a fixed address. The range define here should not overlap which the IP range handed out by the regular DHCP server (usually your router) on the network.

 

When a DHCP pool is given, the network (br0) should also appear in the dropdown list.

What is the output of this command:

docker network ls

 

  • Author

 docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
fea497e4c33d        bridge              bridge              local
1e175f9bfa99        host                host                local
23bed2402df6        none                null                local
 

It looks like creation of the custom network under docker is not successful.

 

What is the result of this command:

docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=br0 br0

 

@bonienl, are you still able to create docker networks or would that command you just listed interfere with 6.4 creating networks via the GUI as you mentioned earlier?

The command I listed is the same command which will be automatically executed when the docker service is started.

 

Somehow network creation fails for lovingHDTV and I like that seen confirmed. Usually it means you need to delete the docker image and recreate the containers.

 

  • Author

Sorry it took so long, just got back from a business trip.

 

When I run it I get:

 

docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=br0 br0
Error response from daemon: network dm-614e9ebdde75 is already using parent interface br0


 

Right, docker has the interface already internally assigned. Unfortunately there is (or I don't know) a way to release the interface other then deleting the docker image and recreate the containers. This sounds drastic, but recreation of containers is a simple and fast thing to do by selecting the already present templates after the new docker image has been created.

 

While any containers using the docker network to be deleted are stopped, just issue

docker network rm dm-614e9ebdde75

to nuke the offending docker network.

Edited by ken-ji

3 hours ago, ken-ji said:

to nuke the offending docker network.

 

Thanks, makes life a lot easier :)

 

  • Author

Earlier I had replaced my cache and copied the img file over.  That caused unRaid to complain that it was old and needed to be recreated.  So I took this opportunity to recreate it.

 

I can now see the br0 as an option.

 

thanks

  • 2 weeks later...
On 11/5/2017 at 10:59 AM, ken-ji said:

While any containers using the docker network to be deleted are stopped, just issue


docker network rm dm-614e9ebdde75

to nuke the offending docker network.

 

I tested that but it doesn't work (docker tells the network is not existing and can't be deleted).

 

You'll need the sledgehammer approach :)  The following works:

rm /var/lib/docker/network/files/local-kv.db
/etc/rc.d/rc.docker restart

First the docker network file is deleted (it removes all known docker networks)

Next restart docker and networks are recreated, including the macvlan networks.

That's one ugly sledgehammer. :D

 

Odd though that the rm command don't work. I've used it recently to rebuild a few networks which switching parent interfaces.

  • 2 months later...

I have previously been using pipeworks to assign unique IP's to a few dockers, I thought I would move to the new inbuilt option, it works fine talking to the new docker from my network, but those dockers are not able to see the host, or any other dockers on the host.

 

my subnet is 192.168.0.0/24 and I am just entering the ip like 192.168.0.245.

 

Another question, is the MAC address that gets assigned to a docker in this fashion static, if I wanted to use DHCP?

 

Am I missing something?

Hey,

im able to assign an IP to my docker container but I'm not able to ping any IP addresses on my local network from inside of the container. 

Does anyone has an idea?

Edited by Diggewuff

@Wob76

The limitation that prevents talking to the host is by design and the only way around it is to have either two or more network interfaces or to have VLANs in your network

see this for more details (This is the manual way for 6.3 not the automated way for 6.4)

@Diggewuff

Can you show us your network settings for docker?

 

 

@ken-ji Thanks for the details, I guess I could look at setting up a VLAN, seems like an odd choice to be able to put a device on a LAN, but not have it talk to other device on the LAN (Host or otherwise). For the moment I'll just stick with pipeworks, it has been plodding along nicely for some time now.

@bonienl Was wondering if I could get some help with this. Server has a quad NIC, and I'd like to take one of those and use it for one specific container, leaving the rest as they are (at least for now). I set the eth1 interface up with a static IP, and I'm able to choose that interface in the container template. When I start the container I am able to ping it locally just fine, but it cannot reach the internet. I've been all over the forums looking for an answer, and I'm sure its just me missing something, but any help would be appreciated.

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.