QNAP LXD Container VLANs (PART 2)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so [Music] hello and welcome back once again this is scott and we are going to talk about qnap lexi container vlans part 2. this presentation is a follow-up to the previous one in which we learned how to use lex d containers from the lexi command line interface to create containers in specified vlans although we focused on how to do this in qnap container station this technique works for any linux system hosting lexi containers last time we included a command line switch to run the lexi container in privileged mode since this is required on the qnap this time we're going to cover additional switch settings so more on vlans and addresses consider putting all of your self-hosted applications that you offer on the wan on a dedicated vlan last time we set our lexd container to use a dhcp address most applications are better suited to having a static address rather than setting a static address for each container i suggest a dhcp address coupled with a dhcp address reservation on your router to achieve the same thing as a best practice here we are at the command line once again and we're going to ssh back to the qnap nas we're going to quit out of the menu and we're going to return to a shell prompt on the qnap nas now just as a reminder at this point if i do a lexi list i don't have any lex c lex d containers i went out and deleted the last container that we had created and if i do alexi profile list i have the default profile and i have the vlan 100 profile that we had created so here we are at the unifi software controller i'm going to click on the gear i'm going to go to networks and we can notice that we still have our test vlan operating at vlan 100. let's go ahead and create a second vlan and we're going to call this thing test 2 vlan and we're going to set this one to be blam 110 and we'll go ahead and set its address to be 192 168 dot will be the gateway with a 24-bit subnet mask so you don't have to set the vlan number to be identical to the third number in your ip address it's just that i kind of consider that to be a best practice and many other people in the industry do as well so let's go ahead and click update dhcp range and our dhcp range is from 110.6 to 110.254 just like it was in the 100 vlan so now we click save and now you can see we have a test vlan on vlan 100 and we have a test 2 vlan at vlan 1 10. back at the qnap command prompt we're going to do alexi profile create vlan 110 and we're going to do a lexi profile list and now we have two additional profiles vlan 100 and vlan 110 just like in the other video we're going to make the same or similar change to the profile vlan 110 and we're going to set it for vlan 110 we now have a command line that says lexi launch ubuntu version 2004 we're going to call the container test 100 again we're going to use as the basis profile default and add to it profile vlan 100 we're going to turn on privileged mode for the container because that is a requirement in qnap then we're going to set the memory limit to 2048 megabytes or 2 gigabytes and we're going to set the cpu allowance limit to up to 20 of the host cpu and we're also going to set auto start to on in our container so we're going to create this container and there it goes creating it now we're going to go back and edit the same command and we're going to create a test 110. and we're going to use profile vlan 110 with the same settings so now we have two containers if i say let's lexi list you can see test 100 and you can see that it has an ip address 192.168.100.249. and you can see that test 110 has an address of 192.168.110.177. so the one for vlan 100 is operating on the 100 network the one for vlan 110 is operating on the 110 network here we are back in container station and you can see that i have a lex d container called test 100 and a lxd container called test 110 if i look at test 100 and i do settings you can see that auto start is turned on you can see that cpu limit is set to 20 and you can see that memory limit is set to 2048. under advanced settings network shows up blank because container station has no way to recognize the vlans like we talked in the last video although they are working and then when we go to device you can see that there's a check mark in the run containers in privilege mode because this is a requirement that qnap has in order to operate correctly in container station so if we go back to the overview and now we look at test 110 and we do settings you'll be able to see that it's auto start is set on its cpu limit is also set to 20 its memory limit is set to 2048. if we go to advanced settings and we go to device you'll see that it's also set to run containers in privileged mode there's one other important difference that container station has if we look at this lex c container here the lexi container if we look at settings and we look at advanced has a mac address that it will get every single time because when we went off and created the lexi container we had to click on the option on the right side to make it bold which really meant to use that mac address persistently every time the container booted up and also notice with lexi containers we're setting the address inside of container station whereas with lexd we're using the dynamic address and also there is no option to set it within here so another interesting thing is that if you go on to lex d containers although you can't see it there's no option to change the mac address because when we create the lexd container by default it will choose the same mac address every time and as it turns out that's an advantage for us because a consistent mac address for our container is what we require in order to be able to set dhcp address reservations on the router here we are back on the unifi controller program and i'm going to go ahead and click on clients and i'm going to go all the way to the bottom of the client listing and there we have test 100 running at 192.168.100.249. and we have test 110 running at 192.168.110.177. so right now these are dhcp addresses but we can click on one of these on a unify network and most other routers will provide the same type of capability we can click on our gear here and we can click the plus next to network and it has the option to use a fixed address if we turn that on we can set this fixed address to any address that we're not currently using and then every time that container boots and the network notices that mac address online it will always assign it to the same ip address and that's how i do it for my self-hosted applications the primary reason for that is because it centralizes one place for address management meaning the router whereas if i set static ips within each server i would have to maintain those separately now if we go to test 110 similarly we click the gear we click network we click use fixed address i can type in anything i want here and do a save i'm not saving those simply because they're temporary test machines okay so in summary we added a vlan 110 to the network on the router we added a vlan 110 profile for lexi at the lexi command line we created two ubuntu 2004 lex d instances one in vlan 100 and one in vlan 110 both lexi instances use the same physical network adapter on the qnap and we added switches for auto starting the container at boot time and a switch for a memory cap and a switch for a cpu usage cap and we learned that lex d mac addresses are persistent and using dhcp address reservations on your router for lex d container instances is a best practice anyway that's it for today please subscribe and like and we'll see you next time [Music] [Applause] [Music] you
Info
Channel: Scotti-BYTE Enterprise Consulting Services
Views: 48
Rating: undefined out of 5
Keywords:
Id: EZZD3FcwF14
Channel Id: undefined
Length: 13min 39sec (819 seconds)
Published: Wed Nov 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.