Router Container

Is anyone aware of a guide or strategy for building a router (for lack of a better term) container which overrides the default docker gateway such that all the traffic passes through it? It would have two networks, one where internal: true, and all peers on that subnet would route traffic through it. The second network would be a normal docker network that has access to the outside world.

This would allow for things like a squid proxy (this is actually really easy, and I've already done the equivalent of this with just squid, but what if I want to manage all of the other traffic as well with similar services?

Ideally, I'd route it through something like an opnsense VM, but when I bridged the opnsense VM onto the same bridge network that the VM was running on, they couldn't talk to each other properly. DNS requests, for instance, were sent, but I can't tell if they were received and they never received a reply.

submitted by /u/Ibespwn
[link] [comments]
Source: Reddit