How to Setup a LAN / Steam Cache with Pre-Fill & DNS on Unraid

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi there guys and welcome back to the Mothership and welcome to another video so in this video I'm going to be setting up a lan cache and for me it's going to be so I can cache Steam games but it can be used for a number of things such as Windows updates so if that sounds interesting let's get started okay so just what is a lan cache so let me beam over to my chair and we'll talk about it there foreign cash well it basically is exactly what it sounds like it captures things on your local network so you'd normally download from the internet so if any device on your network requests something which the lancast can cache as soon as that first device requests it and downloads it it's stored locally on the Lan to then any other device that needs it doesn't have to reach out to the internet it grabs it locally which is much quicker and it saves using bandwidth on your internet connection now personally I use it for games for steam I want to download games on my gaming VM on my laptop and also on a steam deck now yes I could just use the internet to do that but at the moment I'm using cell data for my internet so it's really slow and if I want to download a game on all three of those devices it's much easier for me to use a lan cache anyway let's jump on the computer and talk about it a bit more now before we dive into this I just want to apologize for the sound quality at the beginning of the video after recording that footage I realized I had the levels set wrong on my mic and it came out a bit weird anyway let's carry on so caching proxy servers have been around for years many companies and organizations such as universities they often run that for caching traditional web traffic but yeah certainly not for games now we can only cache HTTP traffic not https and this is fine for the game servers because the cdns or content delivery networks they use unsecured HTTP we're able to intercept that traffic and save it locally so using a lan cache is not for everyone for example if you've only got one PC that you game on there's really no point in having a lan cache because you're going to download each game only once to that PC anyway so you may as well use your regular internet now I guess there's one situation where having the one PC and having a lan cache might be useful say you've got a gaming laptop and it's only got a very small hard drive on it maybe you want to easily kind of download and then actually remove games multiple times and I guess in that case a Lancaster would actually be useful now where it becomes useful is when you've got multiple PCS that want to download the same game this way the game only needs to be downloaded the one time and all the other PCS on the network can easily download the game at full speed directly from the Lan now this is especially useful for people with really slow internet like I've got at the moment I'm currently just using cell data so downloading one game takes an age and if I want to have it on more than one machine well using a lan cache I can do that easily and quickly so what we're going to be looking at in this video well we're going to be setting up three containers firstly the Lan cache container itself this is called the monolithic land cache an all-in-one solution and you can read about it here at landcash.net now us on Raiders we will of course download Ours from Community applications the regular Lan cache it just caches games when we download them on the PC so basically we need to install the game first to allow it to be cached well if we want to pre-fill our land cache with games of our choice we can do that too we'll use a companion container called well you guessed it lancast pre-fill and this allows us to put our steam Account Details into that container and then choose the games from our library that we want to pre-fill the land cache with and yes only games that you have in your steam account come on you didn't think that we could just download anything did you you must have paid for it of course hence using your steam account now lastly we're going to install a container called Lan cache DNS and this container obviously handles all the DNS I'll also show you another way to set up the DNS manually in your router or even use the host file in Windows now I'm going to show you some problems that I had and how I overcame them so hopefully by the end of this video you're going to be able to set up a fully functional Lan cache on your server okay so let's log into the server now the first thing we need to do is we need to decide whereabouts on the server we want to have the lamb cache data go to for the Lancaster work as best as possible we really need the data going onto an SSD I personally found when I set my Lancaster be on the array or on an unassigned disk which wasn't an SSD with some games when they're being redownloaded from the cache it could be quite slow so by far the best idea is to put the location on an SSD most of us have an SSD for our cache drive but there might not be enough space on the cash drive to be able to do this so if you can it's best to have a dedicated SSD for your Lan cache to keep everything separate now I don't have that at the moment maybe that's something I'll get in the future so for now the best performance I'm going to set up the land cache here on this two terabyte SSD which is also my cash drive so I'm going to go across to the shares Tab and create a share there scroll right down to the bottom click onto add share and obviously give it a name I'm going to be very original and call it land cache now as I wanted to use the SSD I need to set use cash pull here I'm going to set it to prefer because I don't want mover to move the files off the cache Drive I want them to stay here so they can be served to the steam clients with maximum speed now if I did have a second pull dedicated to the land cache I could select that pool here but as I don't I'm just going to leave it on SSD cache now because I've set this to prefer in the event the cache Drive became full it would actually spill over onto the main array because of that I want to just set the included disk here not to be all I just want it to be disk 4. so if ever the SSD became full is then going to put the extra data onto disk 4. okay so with that done I'm going to click onto add share now there's no need to actually export this as a normal share we don't need to do that so we can finish and just click done okay so now we need to head across the community applications by clicking on the apps Tab and do a search for yep Lan cash you can see a bunch of things here like I said earlier we're going to be installing the Lan cache container the lancash DNS and also lancast pre-fill but to start we're going to install the monolithic container which is this one here the official land cache container just click on to install it will warn us here that we need to change the network the container runs on just click onto OK and the first thing we need to do is to set that IP address you should see here that the network type is set to custom br0 if it isn't you can select it here or if you'd rather a different custom Network we need to make sure that the subnet which you can see here this needs to be the same subnet or same IP range that your gaming PCs are on as well I'm going to set the static IP address for the Lan cache for me to be 10.10.20.225 now obviously don't just copy that set that for a static IP that's not in use on your network we need to leave the port as Port 80 and Port 443 make sure not to change those and here at the bottom of the template the logs folder here and a cache folder we need to change the location from being in the app data for the location that we're using for our Lan cache now I can see at the end here the location is forward slash logs so to make it easy I'm just going to copy the word Logs with Ctrl and C here and now I'm going to browse to MNT user and there's the share I created on the SSD for my data and I'm going to paste logs on the end now again I need to change this location to be the same here so I'm going to copy this again Ctrl C and I'm going to paste over that location so now I've set both of these locations for the share earlier created for the lancast data to go okay that's all we need to do for this so let's click apply and pull down that container so once it's downloaded click onto done and that's our first container all set up so now I'm going to go ahead and set up the lancast DNS here now what this does is it handles the DNS so any of the game clients on the network and for me they'll be the steam clients if they want to download data all of the requests for those locations are going to be funneled through the lancast container here but all of the regular kind of Internet when you're going to maybe Facebook eBay that kind of thing they're going to be unaffected and they'll just be sent out normally so let's click onto the install button here and get this installed now it warns us here that some ports are already in use don't worry about that just click OK because the first thing we're going to do is we're going to set a static IP for the Lan cache as well so where you see network type here change that to the same custom Network as we had the Lan cache on so br0 now the land cache DNS needs a different IP address to the land cache so for me I'm going to choose 10.10.20.224 we can leave the DNS Port the same and use generic cache we can leave that as true but for the land cache IP this is where we need to put the IP address that we chose for the lancash monolithic server earlier and for me that was 10.10.20.225 now make sure you don't just copy what I've put here this needs to be the IP address that you chose for your container and with that done just click on to apply and again once downloaded click on to done and we're now ready to start using the land cache so for that I'm going to pop across onto my gaming laptop and download God of War okay so here we are on my laptop now the first thing I need to do is I need to set the DNS on this laptop so all requests are going to go through the lancast DNS so request for steam go through that now the easiest way I can do it is to open up the network connections and on my adapter go to properties and under Internet Protocol version 4 here notice I got IPv6 disabled on ipv4 I want to go to properties and check this box here use the following DNS server address and then I'm going to put in the IP address not of the land cache of the land cache DNS and for me that was 10.10.20.224 so with that done I'm going to click ok and close these windows to test this we can open up a command prompt and first I'm going to type ip config space forward slash all and here I can see that DNS entry that I put in okay so let's clear this now next I'm going to Ping the address lambcash dot Steam content.com and hit enter and we can see the reply I'm getting from here is not my DNS server address but the address from the Lan cache which for me is 10.10.20.255 so that's all good now if you didn't get the IP back of your Lan cache then you can type the command ipconfig space forward slash flash DNS or one word and after that just try pinging the same address again and hopefully this time it will be correct now if you want to do another test we can type nslookup space land cash dot Steam content.com and this time we can see here the IP address of the lancash DNS and the IP address of the lancash server now if I type ping space google.com then we can see here I can still access the internet from this laptop but now if I type nslookup space google.com then again I can see everything here is going through the land cache but one important thing to look out for if we go back to the unraid server and we turn off the land cache DNS and now when we go back here and we run the same command again well we're not going to be able to get anything at all so always be careful when you've changed your DNS in a computer that you're always going to be able to reach that DNS server otherwise your internet's not going to work now if we didn't want to actually change the DNS locally inside our computer I'm just going to go back and change it back to how it was before so back to properties ipv4 and they're going to put obtain DNS server address automatically so now if I open up a terminal window and type ipconfig space forward slash all and now we can see that the default DNS server is 10.10.20.1 which is the IP address of my router the IP of my laptop here is 10.10.20.109 which obviously was given out by the router now if I ping lancast.steamcontent.com I get a reply back not from my steam cache externally from the CDN on the internet and if I do an NS lookup on the same this confirms 100 that our local steam cache and our local steam cache DNS isn't being used okay so now let's have a look how we can actually give out the IP address of the lancast DNS to all of the DHCP clients on our Network obviously we're going to do this from the router so I'm going to log into mine now now I can't show you how to do this for every single router all routers should be pretty similar if they allow you to do this at all obviously you're going to be looking at the Lan settings and on this router here these are just the basic settings and they don't give me enough control so I need to go to the advanced settings and on this router I need to click network settings here and then go to home networking so basically what we're looking for is in the DHCP server settings is somewhere where we can actually specify the DNS server which is handed out to all of the clients so for me this looks like it here this DNS values part so I'm going to click static here yep so here I can specify which DNS servers are given out to the the DHCP clients from the router on the network so obviously I've specified the lancast DNS here so now with that done I can apply the settings and come out of the router and now I'm going to go back to the command prompt here and I'm going to type ipconfig space forward slash flash DNS this will clear the DNS cache so I don't have any stale DNS now I'm just going to make sure that the laptop actually has a new DHCP leaves from the router so first I'm going to type ipconfig space forward slash release followed by ipconfig space forward slash renew so now I'll just check what my IP settings are with ipconfig space forward slash all and looking here good the DNS server is correct is the DNS of the lancash DNS excellent and it's quite normal here that my IP address is the same as it was before and so now we'll just run through the same tests as we did before checking what we get back from various DNS lookups now having the actual DNS given out by the router can be really useful if you're hosting like a LAN party or something because it's just that people come along and your router will give out everything that's needed for the land cash to work now the router I just showed you isn't actually the one that I use on my network it's the one that was sent by my ISP I actually use PF sense so I just want to show you how to set the DNS there so if you're using PF sense go across to Services then DHCP server scroll down and under DNS servers just put in the IP address of your lancash DNS for me 10.10.20.224 then scroll down and click save okay so let's minimize PF sense and go back to the command prompt and I'll just refresh the IP address quickly here and if we take a look at the IP and the DNS server we can see it's the lancast DNS the same as it was on the other router there's one thing we need to be careful of when we're using this method it's not just the request to the cdns that go through our DNS server but if I was to pin google.com we can see we get a reply but if I go back to the unraid server on the docker page here and I stop my Lan cache now let's go back to the command prompt and if I pin Google again we can see nothing's happening here because I've lost the whole of my internet so you need to be really careful if you set the DNS on your router to use the lancash DNS because should you shut down your server or you shut down that container then your whole network will lose its internet now in pf sense we can do something quite nice something slightly different so let's go back to pfSense and I'm going to take out the DNS server here I don't want that and so with that saved if we now go back to services and this time to DNS resolver so on the DNS resolver page I'm going to scroll down to the bottom here and we see this section host overrides I'm going to click onto add here and for host that's going to be the subdomain so that's going to be Lan cache and for the domain that's going to be steam content.com so what this is doing is setting the address lancast.steam content.com and I want it to resolve not to the lancash DNS this time but directly to the Lan cache container so for me that IP address is 10.10.20.225 and description I'm just going to call it Steam games so with that done I'm going to scroll down click onto save and then apply changes now looking at unraid we can see that the Lan cache container is stopped it's not running so let's minimize this let's open up a command prompt and clear the DNS with ipconfig space forward slash flush DNS and also let's refresh the IP address as well with ipconfig forward slash renew and if we look here at our IP configuration we can see the DNS is the router but now we can ping Google and the lancast container stopped but our Internet's still working and if we ping lancash dot Steam content.com then we're getting a reply from the container so if your router gives you the option to actually set individual DNS overrides I think this is a really nice way to do it obviously to do that you need to know the URLs that the cdns use and to find that out then go to lancast.net click onto docs here and if we scroll down under lancast DNS if we click General here then we can see here that the list of all of the supported cdns are available here on this UK lens GitHub repository and so this is where I got the URL for steam okay so there's one final way I'm going to show you that you can actually change your DNS if you're on a Windows machine this wouldn't be any good for a LAN party but maybe if you don't want to change the DNS on your network or your PC well we can actually edit What's called the host file okay so on the laptop I've now set everything back to default and I've deleted the host override in my PS sense router so now if I ping lancash dot Steam content.com it's resolving over the Internet directly to the CDN okay so to change this what I'm going to do is open up the file browser here and under my C drive I'm going to go to Windows then system 32 drivers Etc and then here my host files I'm going to edit it I'm using notepad plus plus and I suggest you use that as well so now editing the file at the bottom here underneath everything else without a hashtag I'm going to type 10.10.20.225 obviously that's the IP address of my Lan cache and then here I'm going to type land cash dot steam content.com so this is exactly the same really as what we did in pf sense but just local only for this machine setting the destination for lancash.steam content.com to being that of the IP address of my land cash container so now I'm going to save this file by just clicking exit to come out of it now it's going to say that it can't save it because I'm not in administrator mode so notepad plus plus is asking to launch an administrator mode which I want to do and so now when I close it and save it it's going to work correctly okay let's close this and this and now let's open up a command prompt let's type ping lancash dot Steam content.com and see what we get okay so perfect so it's resolving to our land cash container okay so using the host files to manage your DNS that can be useful for a single computer in your house on which you want it to be able to use the land cache but anyway there's a few ways you can actually manage the DNS a few different methods you just need to pick one that works best for you and make sure your DNS is pointing to the correct place okay so now let's have a look at the land Cash In Action actually downloading a game I've got the DNS on this laptop all set up pointing to the correct place now my internet connection at the moment like I've said it's using cell data because I'm waiting for my proper fiber Broadband to be installed so downloading anything is pretty slow okay let's minimize this and open up steam and I'm going to install this game here God of War so what's going to happen now because my DNS is all pointing to the correct place the land cache isn't going to have this game available locally so this game is going to be downloaded and as it downloads to this PC it's going to be cached and saved in the Lan cache so then when I install it elsewhere it's going to be much faster okay so let's get this installed now and the game started downloading and if I click here as you can see the speed's really slow so it's going to take a long time for the game to download you can see here it's going to take about two hours to download because the internet connection's so slow so let's come back when that's done and we'll take it from there okay so now God of War has finished downloading on the laptop and the files are installed here on the laptop and I can play the game so not only has the game been downloaded locally onto the laptop's SSD because the DNS was going through the land cache then the game is also being cached by the lancast container as well now it may not always be convenient to fill the Lan cache by downloading each game that you want to have stored so what we can also do is use a companion container which is called pre-fill land cache and using that we can choose games which we want to have pre-filled in the Lan cache without actually having to download them on any PC first so let's take a look at that okay to install a container we need to go to community applications and search for Lan cash and here I'm going to install the lancast prefill container we're going to get a warning as before about the use of a custom Network just click onto ok now this container it's slightly more difficult to set up than the others but it's still pretty simple now just one quick tip when you have a container and there's a lot of instructions in the overview if you're on Advanced view well it's quite hard to read so just toggle onto basic View and the text becomes much easier to see but anyway to fill in this container actually we need to set it onto Advanced view because the first thing we need to do is under the extra parameters here after restart unless stopped we want to put a space then hyphen hyphen and DNS equals and here you want to put the IP address not of the land cache server but of the lancash DNS server and for me this is 10.10.20.224 now when we're using the pre-fill container we need to use both the lancast DNS container and the lancast container as well we need both those containers now scrolling down here the data path we can leave it as it is if you're using Battlenet if you want to pre-fill that then you can enable Battlenet here I'm not going to I just want to pre-fill steam so under enable Steam pre-fill here I'm going to leave that set to True steam fill parameters I want that as recent and the schedule here this is set to run every day at 2 am I'm going to leave that as it is I'm going to leave check pre-fill for updates set to true and here where it says force update we normally leave this set on false if every time you started the container you wanted to force it to update you'd set that to True okay so that's the template really simple just click on to apply and pull down the container then once the container is pulled down click on to done and I'm going to go back to my Docker tab here and if I click onto the container and I go to logs here because this is the first time I'm using the container it's telling me that the steam pre-fill is not configured and it gives some instructions what to do here now I've put what we need to type in in the description of this video so I'm going to close this and I'm going to open up a terminal window into the container and the first thing we need to put in here is Sue space dollar sign user so just paste that in from the description and hit enter now next I've combined two lines together so again copy this from the description and paste it in and hit enter and now it's going to ask for your Steam account name here so pop that in and now it's going to ask for your steam password again pop that in oops it looks like I did my password wrong there okay that's better so now if your account's protected by steam guard you're going to need to check your email address and then put in the code so pop your code in here and hit enter now it's going to log into steam and retrieve all of the games you've got in your Steam account now this is really simple here we just go through each game and put a check next to it for which one we want to download and pre-fill into our land cache now actually I'm just going to do one here it's going to be fairly small I'm going to choose half life and maybe Half-Life 2. okay so once you've chosen the games you want to pre-fill just hit enter and it's going to ask if you want to run the pre-fill now or you want to wait till 2am on the schedule that we had set in the template I just want it to run now so with the yes selected I'm just going to hit enter and then with my super slow internet this is going to take a while to download it looks like I already had Half-Life there so it's on the Half-Life 2 now so while this is downloading I'm just going to minimize this and if I go to my shares here and we have a look at the size of what this is taking up at the moment it's taking up 103 gigs because I got a few games installed on the lancast now you might be wondering you know how does this know to download into that share well it's detected the Lan cache on the network and it's communicated with it so it's downloading this straight into the share that we're using for the Lan cache okay so we'll come back when this is done okay so everything's finished now and if I minimize this we can be sure that it has downloaded into the correct place because if we check the size of the lancast share now it's actually gone up you can see it's now 107 gigs okay so basically that's how to set up the lancast pre-fill now I guess we better actually test out downloading a game using the Lan cache you don't just take my word for it that it works so I'm going to open up steam okay so on Steam I'm going to download two games let's use a small one Half-Life 2 here and install that I'm going to click on downloading here so we can look at the speed and we can see here the speed shooting right up near 200 Megs per second and the game's downloaded pretty much before we can even look okay so that was done really quickly much faster than I could have downloaded two gigs over my internet but that's a bit of a small game let's go back and pick something a bit bigger let's download Tekken 7. this is an 80 gig game again I'm going to click on install next and then go to downloading here okay so the download rate is already way over 100 Megs per second and it's telling us it's going to take about five minutes to install this game so let's see if these speeds are consistent over the whole download and see if it really does take five minutes so let's run a stopwatch and speed this up so whilst this is downloading let's just look at the core usage of the VM the bottom eight cores here are the VM that this gaming machine is running on and they're currently at a hundred percent now that's because when a game downloads on Steam the files are often compressed and they're decompressed during the download and on that note I think the reason we're seeing these little dips in speed here is because that's when I open the browser on the VM and so while it was decompressing that opening of the browser it actually slowed things down and also I'm recording the video on the same machine talking about the game decompression during download if we look here we can see it says it's downloaded 30 gigs out of 45 but here the fully downloaded and decompressed is 40 gigs out of 81. okay so the game's almost finished downloading now the speed was pretty consistent all the way through taking 5 minutes 44 seconds to download Tekken 7. okay so have I had any problems while using the steam cache well to be honest yes I have let's look at that now okay so now I'm going to attempt to download God of War from the steam cache I'm downloading this game to the same VM as I just downloaded Tekken 7 to both the VM and the steam cache are on my unread server but nine times out of ten this one game it just doesn't download correctly for me okay so let's go across to the downloads here and look at the speed straight away we can see that the speed isn't as fast as it was on Tekken 7. at the moment it's just going up over 60 70 Megs here now I wouldn't really mind about that if it would stay like that all the way through it's saying it's going to take about six or seven minutes here but in a moment the speed oh it's already happening now the speed's beginning to drop down now I have no idea why this happens it doesn't always happen with this game but like I said nine times out of ten it seems to do this and the speed just seems to go lower and lower until it gets roughly around the same speed as my internet now I've had a search online to see if other people have this problem and I saw one post on Reddit where a few guys did they seem to think it's dropping back and using the internet connection to download now I don't think it's actually using the internet to download but me thinking that that's not enough let's do some experiments and test it and see if that's the case so with the fresh download of God of War I've uninstalled it and I'm going to reinstall it so as before the download starts pretty fast and then starts slowly dropping down and so I'm going to go to the unread dashboard here I'm going to look at the SSD I'll Mitch the lancast share resides now no dock containers no VMS use this SSD at all and we can see that there's lots of reads at the moment coming from this drive so now theoretically if I pause the download then the reads on that drive should also stop and we can see the reads here are stopped on 1437805 so if the reads stop when we paused it they should start again when we restart the download and actually pausing the download and restarting it it looks like the download is a bit quicker and again it's dropping down but we can see the reads on the drive they're continuing the data is definitely coming off this drive it's not coming from the internet at all I'm going to Speed the video up and wait till the speeds drop right down all the time we can see the reads coming off the SSD and now if I hit the pause button we can see the reads from this Drive have totally stopped so for me at least this proves that when the speeds slowly go down it isn't the fact that the steam client is switching to the internet and not using the Lan cache it's something else now another problem I've had from time to time is memory usage with this container now I haven't had this problem now for a long time 14 days ago there was an update to this container and since I updated I haven't had any problems but what I'd find is sometimes when I was downloading through the Lan cache is the memory uses of the container would get out of hand here we just keep going up and up now you can see here it's going up to about three gigs not too bad you might think but if you see here when I started downloading a game after doing a few others the memory usage now was at 10 gigs and again as the game's downloading we just see the RAM use go up and up and up in that container until it gets up to around 18 gigs well at least God of War actually downloaded this time one of the rare occasions when it did now like I said since the update I find the containers behaving itself and I rarely see it go over two gigs if you do find this container using too much RAM and you're worried it will cause your server problems due to lack of ram well if you edit the template and on Advanced view if you scroll down under extra parameters if you put hyphen hyphen then memory equals say 5G for five gig that will limit this container to only be able to use five gigs so with that done just click on to apply and you can be confident now that the container won't use more than that and we can see here now I've restarted the container it's telling me it's using 207 Megs out of 5 gigs like the other containers are allowed to use anything up to the full amount of ram I've got in the server up to 125 gigs so if you've got a container that has a memory leak limiting the memory can actually be quite a useful thing anyway guys so that's all I've got about land caches so that brings us to the end of this video now sorry it went on for so long I didn't really expect it to be such a long video but that's just the way it turned out to be but if you enjoyed the video I'd really appreciate a thumbs up and please share the video with anyone else who you think might find it useful now I want to give a really big thank you to all of my patrons and supporters out there thank you guys so much for supporting me without you guys I just wouldn't be able to make these videos so I really appreciate all of your help anyway guys it's getting late here and it's time for me to go but whatever you're up to for the rest of the day I hope it's good and I'll catch you in the next video
Info
Channel: Spaceinvader One
Views: 44,990
Rating: undefined out of 5
Keywords:
Id: LJtZlO0Dqwk
Channel Id: undefined
Length: 36min 14sec (2174 seconds)
Published: Thu Dec 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.