isleepbad

joined 1 year ago
[–] isleepbad@alien.top 1 points 11 months ago

Right now it's private only and basically a V1 home version. I'm planning to rewrite it to make it public.

Long term I want to write terraform resources directly to my backend and take out the orchestrator.

[–] isleepbad@alien.top 1 points 11 months ago

I use a Synology DVA 1622 NAS to host all of the things you did. The only difference is I upgraded the RAM to 16 GB (to handle my other services)

My wife and I can watch high quality series at the same time with no issues. Only limiting factor is our WiFi connectivity in the house is shit.

[–] isleepbad@alien.top 1 points 11 months ago (3 children)

Mine is a bit exotic I guess. I use Terraform to manage my home lab. I tried all of the docker update solutions out there and they'd always make my Terraform out of sync. So I built my own solution that interacts with an orchestrator, a backend and a front-end.

I use Terraform to create flows for each service. Then the flows interact with the backend to manage the actual updates. The frontend is there to let me see the latest change log of each project before I update.

For my next project I want to set up an oil tank monitor for our heating. Then I can use Prometheus and Grafana to monitor usage. From there I can start making predictions and so on

[–] isleepbad@alien.top 1 points 1 year ago

I have Synology and back up the entire volume.

[–] isleepbad@alien.top 1 points 1 year ago (1 children)

No that's not correct. You don't need to be in host mode to access the local LAN.

[–] isleepbad@alien.top 1 points 1 year ago (1 children)

Why did you use 192.168.2.200/29 for your route? This is the last part I dont quite understand. How does it play into the settings you chose above?

I made a typo here and it should be --ip-range 192.168.2.200/29

As I mentioned above you are creating a virtual LAN and as such you need to carve out your own subnet.

My setup is ip range 192.168.87.96/30 which is ip range 192.168.87.96 to 192.168.87.99 . I chose 192.168.87.99 as my auxillary and my Nginx was automatically given IP 192.168.87.96 . Now my question is how do I go about knowing what to use for route?

What do you mean what to use for route? Given what you said your command should look like:

docker network create -d macvlan \
-o parent=eth0 \
--subnet=192.168.87.0/24 \
--gateway=192.168.87.1 \ #this is your router's address
--ip-range 192.168.87.96/30 \
--aux-address="host=192.168.87.99" \
dockervlan

So that command is saying: I have an entire LAN that lives on the subnet 192.168.87.0/24. My router (i.e. gateway) has the IP address 192.168.87.1. I have a virtual network (macvlan) that has its own subnet that has the range 192.168.87.96/30.

So now you need to create the virtual subnet (macvlan) using the command

sudo ip route add 192.168.87.96/30 dev macvlan0

If you use any other subnet it wouldn't make any sense. How else would you get the same address space you described in the ip-range option?

[–] isleepbad@alien.top 1 points 1 year ago (3 children)

I was actually referring to 'sudo ip route add 192.168.2.200/29 dev macvlan0' for #3

That is the MACVLANs subnet. That's basically carving a small subnet out of your LAN that your virtual LAN will sit on. See the preparation section of the original post.

And yes, all proxying goes to the aux IP.

[–] isleepbad@alien.top 1 points 1 year ago (5 children)

I think I am about 99% of the way there. Seems like I got it mostly figured out, but I do have a couple questions for you. And thanks again for your time, you have no idea how much I appreciate you and your assistance in this.

  1. After completing the steps, I can access my NAS as usual, the Nginx proxy manager is accessible via it's macvlan IP, but I can also connect to the NAS and all it's services including the Nginx container from the auxillary host IP. What's the deal with that?

Yes, the auxiliary host IP is basically a new virtual IP that sits on your LAN. So basically when you connect your synology to your home network, it gets assigned an IP (with its own MAC address included). With the MACVLAN network, you've basically created a new virtual network on your NAS with its on device (MAC) address. It is in essence a virtual copy of your NAS host that your router sees it as a new device on your network.

  1. Once all is said and done. Should my Nginx be connected to both the default bridge network and the new macvlan or just the macvlan? It's always connected to the default bridge when installing any new container, but when I add the container to the new macvlan, am I supposed to disconnect it from the default bridge at the same time?

This is up to you how you want your network architecture to look like, but when you spin up a new container that you want available accessible by your ngnix, you have to:

  1. Specify your docker's macvlan network as your container's network (and remove it from the default bridge) OR

  2. Connect your ngnix container to your application's docker network (basically isolate all containers in their own network)

Up to you. Personally I do #2.

  1. Your fourth command for adding routing. How do I know what to use? My IP range for example is 192.168.87.96/30 with an auxiliary IP of 192.168.87.99. How do I decide the routing CIDR notation? I tried to look at yours and wasn't sure how you decided on yours. I just went with 192.168.87.96/30 which is the same as my IP range, but I'm not exactly sure what that is doing or not doing and if I should've chosen a different Ip for that. My CIDR notation for IP range is just 4 IPs, as you can probably tell by now. I notice this one is very important and if not configured properly can make or break the connection. At first, I selected 192.168.87.98, but that didn't work. When I chose by IP range for routing, it worked. I blindly did this, so I have no idea why one is working over the other and how to decide this part.

I presume you're talking about this one ? sudo ip addr add 192.168.2.201/32 dev macvlan0 I guess I didn't explain properly but that is your auxiliary host's IP. If you look at command 2 you'll see --aux-address="host=192.168.2.201". Basically the CIDR notation /32 is the same as the subnet mask 255.255.255.255, only one IP address can be served in macvlan0.

  1. Your final command, which you say is optional for communication between the macvlan and the NAS. I'm not sure if I need to be using this? My entire reason for doing all this is to use NPM for accessing my FQDN on my LAN with SSL certs only on my LAN and nothing exposed to outside internet. I just want all the DNS rewrites from Adguard Home to point to the Nginx macvlan IP so that Nginx can proxy it to the correct NAS service and also SSL it at the same time. Adguard home cannot use port numbers in the DNS rewrites and only can use IP, which is why I am doing all this in the first place. I had to give Nginx its own IP, or Adguard home DNS rewrites couldn't communicate with it.

Yea its optional. For my purposes it was nice to have because I have gitea and wanted to use GIT on the Synology locally. You don't have to.

Overall, I am able to execute all you've described with just these concerns I've listed above. Again, thanks a ton, brother. I learned a lot in this experience.

Yea it's not straightforward and I spent a ton of time researching it. Glad to help.

[–] isleepbad@alien.top 1 points 1 year ago

Those other guides assume you already have a macvlan and want to use docker on it. Like I said, not many complete guides out there. Mine is the most comprehensive you'll find.

The gist of it is, you create a macvlan network on your NAS then you place a docker network on that macvlan network.

[–] isleepbad@alien.top 1 points 1 year ago (7 children)

You have to create your own Mac address.

Google "valid MAC addresses" and place your own there. Anyone will do.

You're creating a virtual LAN on your network and as such you need a MAC address. You can skip it but as I said in my guide, one will be automatically created for you each time and you'll have multiple virtual devices sitting on your network.

[–] isleepbad@alien.top 1 points 1 year ago (2 children)

So basically all you did was create a docker network with no macvlan on your synology. The docker network you created will simply look for a macvlan and communicate with it. There needs to be an actual macvlan there to communicate with. You really should read through my responses again.

Here are some pointers:

  • Your step 2 needs an auxiliary address for your host. --aux-address="host=192.168.2.201"

  • Look at my step 3. You have to run those commands to setup the macvlan on your synology. You have to use your auxiliary host address in the series of commands I showed you. When you run them properly you will see the host show up in your router.

view more: next ›