Please some help about with correctly configuring "bridge" settings for docker image

  • Dear all, this is my first post and I'd like to thank everyone in this forum and in the development team for this great piece of work and all the useful advice on this board.


    I spent a few days now reading the forum and trying to get a rtorrent docker working (diameter/rtorrent to be precise), but the one on linuix server has the same issues..


    When I select "bridge" mode I get the option to fill in the IP adress "Host IP" and also I have the option to fill in the hostname.. I have recently also configured docker on a freenas box and with their setup when I chose bridge mode I get the option tho create a virtual mac adress and using DHCP an IP adress will be assigned... But I have no idea how to achieve this in OMV..
    Can someone please point me to the right direction to get the bridged option for docker images set correctly.


    Thanks in advance!

    • Offizieller Beitrag

    You don't need to do anything special, just select the ports you want to reach and match them with the exposed ones or if you want custom ones, press the plus button to validate so the it gets correctly assigned. Don't fill the host ip address, just leave it default 0.0.0.0


    That's it.


    Alternatively you can reach the containers using their own ip address (172.17.0.x) if you put a global static route in your router pointing that subnet to the omv ip address

  • Hi thanks for your reply! That makes one thing clear..


    However after creating and running the container I have no idea what IP my router has assigned to it so I am not able to connect to it in my LAN..
    In the container details the IP adress is set to 172.17.0.2, this adress I cannot reach within my LAN, so I guess I have to put this static route in my router pointing to the omv iop adress... Not really sure how to do that


    Is there a way to have this container get an IP adress on she subnet of other devices in my network (say an 192.168.1.X IP adress) ?


    Thanks in advance!

  • Once the docker is set up in Bridge mode, and if it's properly started, your router should assign an IP address just like if it was another device on the network (192.168.x.x). To find the IP address, look at your router. Most routers have a page that lists the devices that are connected.


    You can also force a MAC address on the docker container and configure the router to assign a fixed IP address to that MAC address.


    You can ignore the 172.17.x.x address.


    Of course, this assumes that the docker container started properly. Check the log for that.

  • Thanks again, the container is said to be running in OMV webUI, also I cannot find anything strange in the container details settings (see snippet underneath)
    However in my router this MAC adress doesn't show up (and so there's no IP being assigned).


    It looks like that's the cause of the problem..


    No idea how to debug this..


    Kind Regards,

  • Thanks again, the container is said to be running in OMV webUI, also I cannot find anything strange in the container details settings (see snippet underneath)
    However in my router this MAC adress doesn't show up (and so there's no IP being assigned).



    "NetworkSettings": {"Bridge": "","SandboxID": "717d8b3161acfcac67ebc3cd37c81fc5f26bbcbed540d7664f1c845a0a601112","HairpinMode": false,"LinkLocalIPv6Address": "","LinkLocalIPv6PrefixLen": 0,"Ports": {"443/tcp": [{"HostIp": "0.0.0.0","HostPort": "443"}],"49160/tcp": null,"49160/udp": [{"HostIp": "0.0.0.0","HostPort": "49160"}],"49161/tcp": [{"HostIp": "0.0.0.0","HostPort": "49161"}],"80/tcp": null},"SandboxKey": "/var/run/docker/netns/717d8b3161ac","SecondaryIPAddresses": null,"SecondaryIPv6Addresses": null,"EndpointID": "74b8d5a448c397f6ec25bc05bb658e84f6f139db8dd25903fd1c09def81f6523","Gateway": "172.17.0.1","GlobalIPv6Address": "","GlobalIPv6PrefixLen": 0,"IPAddress": "172.17.0.2","IPPrefixLen": 16,"IPv6Gateway": "","MacAddress": "02:42:ac:11:00:02","Networks": {"bridge": {"IPAMConfig": null,"Links": null,"Aliases": null,"NetworkID": "3a7c47afe9eccb284f5cc29e24da0565b91fe4c74fa3ca22f3c5a9abd2f7547f","EndpointID": "74b8d5a448c397f6ec25bc05bb658e84f6f139db8dd25903fd1c09def81f6523","Gateway": "172.17.0.1","IPAddress": "172.17.0.2","IPPrefixLen": 16,"IPv6Gateway": "","GlobalIPv6Address": "","GlobalIPv6PrefixLen": 0,"MacAddress": "02:42:ac:11:00:02"}}}}]
    It looks like that's the cause of the problem..


    No idea how to debug this..


    Kind Regards,

  • Thanks again, the container is said to be running in OMV webUI, also I cannot find anything strange in the container details settings (see snippet underneath)
    However in my router this MAC adress doesn't show up (and so there's no IP being assigned).



    "NetworkSettings": {
    "Bridge": "",
    "SandboxID": "717d8b3161acfcac67ebc3cd37c81fc5f26bbcbed540d7664f1c845a0a601112",
    "HairpinMode": false,
    "LinkLocalIPv6Address": "",
    "LinkLocalIPv6PrefixLen": 0,
    "Ports": {
    "443/tcp": [
    {
    "HostIp": "0.0.0.0",
    "HostPort": "443"
    }
    ],
    "49160/tcp": null,
    "49160/udp": [
    {
    "HostIp": "0.0.0.0",
    "HostPort": "49160"
    }
    ],
    "49161/tcp": [
    {
    "HostIp": "0.0.0.0",
    "HostPort": "49161"
    }
    ],
    "80/tcp": null
    },
    "SandboxKey": "/var/run/docker/netns/717d8b3161ac",
    "SecondaryIPAddresses": null,
    "SecondaryIPv6Addresses": null,
    "EndpointID": "74b8d5a448c397f6ec25bc05bb658e84f6f139db8dd25903fd1c09def81f6523",
    "Gateway": "172.17.0.1",
    "GlobalIPv6Address": "",
    "GlobalIPv6PrefixLen": 0,
    "IPAddress": "172.17.0.2",
    "IPPrefixLen": 16,
    "IPv6Gateway": "",
    "MacAddress": "02:42:ac:11:00:02",
    "Networks": {
    "bridge": {
    "IPAMConfig": null,
    "Links": null,
    "Aliases": null,
    "NetworkID": "3a7c47afe9eccb284f5cc29e24da0565b91fe4c74fa3ca22f3c5a9abd2f7547f",
    "EndpointID": "74b8d5a448c397f6ec25bc05bb658e84f6f139db8dd25903fd1c09def81f6523",
    "Gateway": "172.17.0.1",
    "IPAddress": "172.17.0.2",
    "IPPrefixLen": 16,
    "IPv6Gateway": "",
    "GlobalIPv6Address": "",
    "GlobalIPv6PrefixLen": 0,
    "MacAddress": "02:42:ac:11:00:02"
    }
    }
    }
    }
    ]



    It looks like that's the cause of the problem..


    No idea how to debug this..


    Kind Regards,

    • Offizieller Beitrag

    The bridge mode has nothing to with the local network, the docker0 is a network bridge for all containers, the default subnet is 172.17.0.x.
    Every port forward we put is a DNAT entry in the nat table. Network data from the containers get a MASQUERADE entry also in the nat table.


    If you want to use your local network scope you need to use macvlan driver, creating a macvlan network. You can assign ip address at the run/create of the container. I am not sure but you can probably assign MAC address to each run/create container so you can control the assignment with the DHCP server.


    The plugin has no support for macvlan, so you need to first drop down to CLI to create the macvlan network. In the plugin you will probably need to specify no network and run the ip assignment in the extra option. Beware that this extra options don't come back when you use the modify container option.


    As usual docker docs get much better with time and this function is well explained here


    https://docs.docker.com/engine…bridge-mode-example-usage

  • Thanks for your reply subzero79..
    Using the macvlan route sounds indeed what I was trying to accomplish, but if there's another less complicated way to be able to access 172.17.0.2 with a browser on another machine it would just be fine as well..


    problem is I'm not used to reconfiguring my router in order to rout a different subnet.


    I read in another post you wrote here I should "put network 172.17.0.0/24 with GW IP_OF_OMV in the router static route entries" in order to be able to reach all docker instances by 172.17.0.x ip's from the lan 1982.168.x.x sunet
    I used advanced tomato firmware on my router and I can set 172.17.0.2 as " destination" and 192.168.1.36 as "gateway", but doing so gives me "invalid IP adress for the 172.17.0.0/24 entry, and changing it to 172.17.0.2 does not give the result I was hoping for..


    I left the subnet mask

    255.255.255.255


    Did not find anything related to masquerade...



    Can someone point me in the right direction?

    • Offizieller Beitrag

    You actually don't need to that....remember docker targets individual applications. Most of them are restricted to just one or two ports. So just map the ports host:container and you will only use the host IP address.


    Post a screenshot of the static route entry in tomato. This method kind of works, because the IP address of the container will eventually change on reboot or docker daemon restart, and that is not really good.

  • Adding those entries allows me to connect to the OMV Webui by typing 172.17.0.1 in the adress bar in my browser.
    I still cannot ping 172.17.0.2, which is the ip adress the docker image is assigned to.. and also opening 172.17.0.2:8080 doesn't open the rutorrent webinterface..
    there's no errors in the container log..



    May this helps: this is the ifconfig output for OMV:


    docker0 Link encap:Ethernet HWaddr 02:42:10:92:42:aa
    inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:114865 errors:0 dropped:0 overruns:0 frame:0
    TX packets:87051 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:316959771 (302.2 MiB) TX bytes:6459146 (6.1 MiB)


    eth1 Link encap:Ethernet HWaddr 00:25:90:5d:ef:d7
    inet addr:192.168.1.36 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:139438 errors:0 dropped:0 overruns:0 frame:0
    TX packets:240207 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:18759272 (17.8 MiB) TX bytes:337134603 (321.5 MiB)
    Memory:fb100000-fb17ffff


    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:11833 errors:0 dropped:0 overruns:0 frame:0
    TX packets:11833 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1
    RX bytes:3260061 (3.1 MiB) TX bytes:3260061 (3.1 MiB)


    veth8ed5072 Link encap:Ethernet HWaddr f6:ed:8e:be:d9:c8
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:114819 errors:0 dropped:0 overruns:0 frame:0
    TX packets:86411 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:318564877 (303.8 MiB) TX bytes:6230838 (5.9 MiB)

  • Hi there, sorry for the long time away, I finally have some more time to get this working..


    I still am not able to connect to the docker0 bridged network adress from within my homenetwork.. The file /proc/sys/net/ipv4/ip_forward does not exists..


    Could it be ip forwarding is not enabled? How do I manage to debug this?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!