Setting Up Docker Swarm with VLANs: How Do I Connect Services?

0
49
Asked By TechNerd99 On

I'm putting together a home lab with two mini PCs and a NAS, using the NAS as the Docker Swarm manager and the mini PCs as worker nodes. I know this might not be the most reliable setup since if the NAS dies, everything goes with it. My network has a main VLAN without tagging, and a separate tagged VLAN for IoT devices that connect via WiFi. Currently, I'm trying to move Frigate, which is running on another server, to my new Docker Swarm setup. I've read about macvlan and ipvlan, but I'm unsure how to connect services to specific VLANs. Is there a way to specify that a service needs to use a certain VLAN and allow it to communicate within that tag?

2 Answers

Answered By DataDynamo73 On

Just keep in mind that VLANs work a bit differently than you might expect. They don’t operate like VPNs for logical IP segmentation. If you're diving into this, it might be good to get familiar with untagged and tagged ports, as well as how managed switches handle this. These concepts can help you manage your setup better!

Answered By CloudJumper42 On

When it comes to Docker, VLANs aren't set per service or per container directly. Instead, you'll have to create a separate Docker network for each VLAN you want to use, and then attach your service to those networks. Check out the Docker documentation on macvlan for more details on how to set that up! Just a heads up, I've never used macvlan with swarm, it seems to go against what swarm is designed for.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.