Jump to content

Cannot access host from docker on eth0


maciekish

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.

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

Archived

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

×
×
  • Create New...