Cannot access host from docker on eth0


Recommended Posts

Hi,

I have one network adapter in my unRAID box, eth0. I have set up Caddy with its own ip on eth0 in Docker as a reverse proxy for multiple services and subdomains. I want a reverse proxy for the unRAID interface as well, but i get 502 Bad Gateway. If i do

docker exec -it Caddy bash

and then try to ping the host IP it times out. Seems like the traffic is blocked or not properly routed. How do i fix this?

 

Network is 10.0.0.0/22

Host is 10.0.1.0 on eth0

Caddy is 10.0.1.12 on eth0 in Docker

I'm able to ping other devies in the network for example the router at 10.0.0.1.

Edited by maciekish
Link to comment

That's a limitation inherent with technology / security used by the custom docker networks.

The container with a dedicated IP on eth0 (Caddy in your case) is explicitly not allowed to talk to host (unRAID) due to Linux kernel security measures.

 

The only way around it, is to: (in order of difficulty)

* have a second interface (the custom network is on this interface)

* have VLAN support and locate the  container on a different VLAN than the host

 

You can refer to these topics for some more details.

 

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.