Problem with Host access to custom networks when network down


Recommended Posts

Hi,
I have enabled "Host access to custom networks" in Docker settings which normally creates the shim-br0 macvlan bridge on boot.

But, if the physical network link is down (e.g. cable unplugged), the shim-br0 is not created on boot, causing routing problems between the containers (e.g. when using Nginx Proxy Manager reverse proxy logs report "No route to host")

I would understand this issue if I my Unraid would use DHCP, but my Unraid's network address, DNS and gateway is configured with STATIC addresses.

To fix, I would suggest to not start docker service on boot until physical network link is up (e.g. network cable is plugged in).

Any suggestions for a work-around in the meantime ?
Thanks for any help.

 

 


Edit: I found some code in the forum to manually create the shim-br0 bridge, but I am reluctant to use it because of the hard-coded IP ranges and implementation via cron. A more elegant approach to this problem would be nice.
 

ip link add shim-br0 link br0 type macvlan mode bridge
ip link set shim-br0 up
ip route add 192.168.1.0/25 dev shim-br0 
ip route add 192.168.1.128/25 dev shim-br0

 

Edited by brokenworld
  • Upvote 2
Link to comment
  • 8 months later...
  • 3 weeks later...
  • 1 month later...

+3
Issue of unable to access 'Host network' from 'Docker network'.   
My usecase is from Ngix Proxy manager (172.17.0.9) to a local service running on a virtual IP (192.168.0.7).  From Ngix Docker I can ping the gateway (192.168.0.1) and other physical devices on the network) but cannot ping the docker VIP (192.168.0.7).

When stopping docker, turning off "Host access to custom networks", applying, turning on "Host access to custom networks", applying, allows host access again, until the next reboot. So it works, but has to be set at each reboot.  Is there a bug tracker where this can be logged?

Edited by isaw
Link to comment

+1 Again.

 

My server had a hard crash and upon restart I did the usual steps of both ensuring the shim-br0 network is up (via the commands from OP) as well as did the Docker toggle Host access to custom networks and now it is still failing.

 

EDIT: Ended up following this blog "UnraidOS host access to custom networks [Fix]" https://blog.siglerdev.us/unraidos/ which pointed me in the right direction. I forget that my network is 192.168.54.X not 192.168.1.X, so all I had to do was add the custom scripts plugin and add a script that runs the ip link code with the correct subnet. IE for me it had to be 54 when doing the ip link route add.

Edited by 97WaterPolo
Added my fix for the error
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.