Dockers (pihole) and VLAN


Recommended Posts

Hi, 

I was tired of not being able to access some dockers from other dockers and from VMs on the same interface.

I read that I had to have the dockers in bridge mode or on a VLAN.

 

So yesterday I setup 4 vlans.  To verify that it worked I created a VM on vlan br0.2 and it worked, I got dhcp for that network (from the router) and could access unraid etc.

So now I tried to install pihole and I put it on the interface br0.2, but no matter what I try I can't access the pihole web interface.

I also installed a wordpress docker and put it on br0.2, but I couldn't access that either.

Can someone please help me with the right configuration regarding vlans and the pihole docker to be able get it to work?

 

I use Custom network: br0.2
Fixed IP: 192.168.2.2
Then we have key 5 and 6. i have tried leaving them as they are, deleting them, and put the same config as the custom network and fixed ip

Link to comment

What are you trying to accomplish exactly, docker containers on the default bridge are able to locate each other on IP details.

If you want to have them be able to reach each other by name, then you have to use a custom network.

Ref to Docker Docs

 

Now for pihole, I've put mine on the custom: br0 bridge and gave it an IP in my own segment, since this allows my to use port 80 of the host and still have pihole available on that same port. No VLAN was required at all for this.

 

1964665076_2020-05-2608_57_41-Window.thumb.png.71ef1d0ef20a20f56a5db822fe5c9126.png

 

Note that I do use VLANs, but that's mainly to be able to reach the host from a docker container.

I've created a macvlan driver network on that VLAN, without giving the host an IP in that same VLAN, this allows me to reach the unRAID host on its usual address from the newly created network. 

Edited by S1dney
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.