How to Homelab Episode 3 - Planning your Network Layout

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello and welcome back to learn linux tv and welcome to another episode of how to home lab and i love this series because i love home lab and you guys seem to love it too judging by the view count and that's great which means i get to do more home lab videos and what could be better than that the first two videos served as more of an introduction to the various components that can be part of a home lab and i used my own as an example now it's time in this video to start the process of going through each individual component of a typical home lab one by one and in this particular video it's time to talk about networking because networking is the foundation of a home lab and honestly networking can be as simple or as advanced as you want it to be and you know maybe all you need to do is just set a static ip to some of your servers and well that's it but it has to start somewhere and in this video we're going to dive into networking but before we do that i have a few notes about my channel and then we'll get started thank you for checking out learn linux tv your source for linux related fun and learning and i just love making this content for you guys but producing it isn't cheap if you enjoy my content please consider supporting my channel and you can do so by visiting support.learnlinux.tv where you can check out the official shop become a patron and find other ways to help and among the perks for becoming a patron you'll get access to select videos before the rest of the world but even if you're not able to donate right now no problem you can support this channel simply by sharing this video with your colleagues or even simply clicking the like button which lets youtube know that you want to see more awesome linux content just like this and if you're looking for something to read well i write books and you can check out my books at learnlinux.tv books if you want to suggest a topic for a future video send your ideas to suggest at learnlinux.tv or if you notice that something is broken or not working right then you can let me know by sending an email to fsck at learnlinux.tv and finally i'd like to mention the sponsor for today's video lenode has been doing cloud computing since 2003 which is actually before amazon web services was even a thing on the node's platform you can get your server up and running in minutes and they include all of the popular distributions such as centos debian ubuntu fedora and get this also arch linux and let's be honest what could be better than a linux cloud server provider that allows you to tell all of your friends i run arch lenod has multiple server plans available to make any app scalable and flexible you can use it to host a blog set up a vpn server a minecraft server or you could do what i did and set up a website for your youtube channel because the official website for learn linux tv runs on lenode and lenode offers 24x7 365 support regardless of plan size so you can get live help from a real person when you need it new users can get started right now with one hundred dollars in credit towards a new account and i highly recommend you check them out because lenote is awesome and with that out of the way let's get right into today's video all right so let's talk networking now here in front of me is an online simulator for a popular interface for a commercial router and this is from asus now i don't really have a preference for asus or anything like that it just happens to be the first thing that i found on google i wanted something generic to show you guys that is more akin to what you probably have in your house and whether or not asus is your preferred hardware or not it doesn't really matter because this is a home user router interface that you see right here which is a great example to use for this video and the first point i want to make is to use what you have now i want to buy new stuff i always want to buy new stuff but i can't always buy something every day as much as i would love to i would love to buy new routers and switches and show you guys and maybe i will show you guys some other switches and routers and things like that but the main takeaway for this video is to use what you have lying around and then maybe later you can add on to that you could buy some new gear but for now we can actually use what we have in our current network to actually configure our home lab network and that's what i'm going to show you how to do now one potential downside here is if you have a router that is provided by your isp and your isp is lame and they don't allow you to log in and get full access to the configuration well there's not a whole lot you can do about that you might actually be forced to buy something i really hope that's not the case that's not often the case because even some of the isp routers i have seen actually do give you enough access but if you're just one of those unlucky people out there that have a locked down router from your isp i'm really sorry in that case yeah maybe you might need to buy something so what do you actually need so what i recommend at a minimum is that you have a router that allows you to change the ip address scheme when it comes to dhcp and also allows you to assign static leases so what do i mean by static leases as you probably already know a static ip is something that you can assign in your linux server or whatever your device happens to be to tell it to use a specific ip address and not automatically obtain one from your router that is a valid way to do it but i don't like it it's not my preferred way to do it i actually set all of my servers all of my static devices to dhcp for the most part nothing on my network is using a static ip but a static ip is kind of important because you don't want your server to all of a sudden change its ip address the whole point of a server is that it's always available at the same ip address every time so the way that you actually handle that is you assign a static lease a static lease is also known as a dhcp reservation i like the term static lease i think that's more appropriate and a static lease is basically you logging into your router and telling it every time you see this server always assign it this ip and you give it that ip but before you can do that though you have to actually change the dacp scheme to whatever you want it to be so what i'm going to do is just open up a text editor here and arrange my windows a bit now your ip address scheme at least for most commercial routers is probably going to look something like this 192.168. and that's probably going to be the ip address to your router and then dhcp is actually going to assign addresses that are from a pool depending on your settings it could be something like this and this is just a hypothetical example now the dhcp scheme is basically a pool of addresses and your router or whatever you have that's assigning ip addresses is going to pick one from the pool anytime a device actually happens to ask for one now in this hypothetical example we are assuming the dhcp server is assigning addresses from 192 168 through 192.168.1.254. now what this also means is that there's no room for a static ip if you plan on using static ips you have to assign one that's outside of the pool but in this example you can't do that why well because the ip addresses in a class c which is actually a slash 24 network more on that later is going to start at dot one and within this ip scheme you can go up to dot 254 you can't use dot 255 because that's a broadcast address you can't use dot one because that's already taken by your router so you're left with dot two through dot 254 now if you're going to use static ips then what you're going to need to do is adjust this to something else so for example maybe you might start this at dot 50 and that's just a random number doesn't really matter so in this case you would actually configure your dhcp server to assign addresses from 50 through 254 which means that anything between 0.2 through dot 49 is actually free for you to use as a static ip you can assign that ip address to one of your devices as a static ip without any fear that that same ip address might be assigned by dhcp how do you do this so in a lot of routers i'm going to try to do this through memory but usually click on lan and i'll make this a little bit bigger just to make sure that everybody can see it we can click on dhcp server and we can set the starting address in the ending address now this is actually kind of interesting because if we go here to lan ip this particular router is assigned 192 168 51. the dacp server assigns from dot 2 through dot 254 so yeah i guess it actually kind of is using that earlier example for the most part which also means there is no room at all for static ip now yes i did mention static leases as being my preferred way to do it but i want to make sure that i cover what's required for static ips to work properly in case you need to do that so in this case i could change the dhcp server to dot 50. so it'll never assign an ip address below.50 to any client that asks for an ip address this is the first step so i'll scroll down and apply so you know this is a demo environment so of course it's not going to work quite the same way as a real router might work so let's go ahead and go back anyway we're back on the router and back in the lan section of course we could see that the changes that we wanted to make didn't stick but i didn't actually expect them to stick i think you get the idea basically you just configure the dhcp server to not assign a particular portion of the ip address space so that way if you do want to use static ips well you do have some ips that you can work with and going back to this example we have dot 2 through dot 49 that we can use for that purpose now here on the interface i'm going to try to do this from memory it's actually been a while see if it's a network map and then here on the network map if we scroll down we have six clients that are connected to this router well hypothetically so here we have some sample devices so basically we can see what's all connected to our network and most commercial routers allow you to do this the interface might vary from one to another but it's going to be pretty much the same idea in most interfaces you would actually have a button somewhere in here to add the assignment that's currently here as a static lease i don't actually see that and from what i understand we actually have to go to lan there should be a setting here ah here it is enable manual assignment so basically in this particular router the ability to set a static lease is disabled by default so let's turn this on it'll probably fail but let's see if it doesn't and of course it did so you can't actually change any settings in this you know example interface but if it was working properly and you enable that option you can go here to the client list and you should actually see a button that will allow you to add the ip as a static lease and most of the routers out there will have this ability and that's really all you need now i would love to be able to tell you guys to go out there and buy a pf sense device buy one of those corporate devices and actually that's not a bad idea because enterprise network gear is awesome and it's the best but it's also the most expensive which is why i recommend to use what you have and then later on you can save up some money and then you can replace your current network gear with enterprise network gear but in the case of this asus router this hypothetical virtual asus router it has the ability to set static leases it has the ability to customize the dhcp server so for a starter home lab it actually has everything that we need already now a feature that's often going to be missing on a consumer device such as this one is the ability to create vlans and subnets now that's actually getting quite a bit ahead of ourselves at this point because you might not even have a home lab yet but actually i recommend at some point you do create vlans and separate networks for separate things now you don't actually have to create different vlans or subnets or anything like that especially if you only plan on having a few servers but i'm telling you it's really awesome to be able to segregate network traffic so for example in my case i have a separate network for all of my media devices such as netflix and things like that and i can throttle those accordingly so you know if everyone in the house is watching netflix at the same time it doesn't saturate the connection the same with game systems and online games i even have a separate network for my kids so i can disable the network for them anytime i want and believe me you get a lot of leverage with kids when you disable their internet and the minute you do that they will be right at your door and then you could tell them why you disabled it or what they're being grounded for um leverage as a parent is awesome but those are the kinds of things that you can do with separate vlans and again use what you have you probably don't have a device right now that'll let you do that but it might be something to consider later on down the road because the way that a home lab actually happens is it starts out with what you have like this router and then you'll replace one piece of equipment for another and over the course of years you'll continue to upgrade things and then eventually you'll have what's essentially an enterprise network in your house which is basically what i have and i'm not going to get into subnetting and vlan in great detail but you know hypothetically it could play out like this maybe you'll have a network that'll be something like this so there's a network there's another one and there's a third one now each of these three are valid networks now the slash 24 at the end of each is called a cider notation and if you are familiar with the old school way of doing it then that actually means you have a subnet mask that is the standard 255 255 255 as you see here a class c network now subnet masks are technically still used but we don't really refer to those anymore the cider equivalent of this subnet mask is slash 24. they basically mean for all intents and purposes the same thing and i'll open up a terminal and there's a utility that you can install on debian and ubuntu it's actually available on other distributions as well but it's not quite the same utility on those but i can run sudo apt install ipcalc going to be a pretty quick install and it's already done so let's see what this actually looks like so if i type ipcalc and let's say 192 168 1.0 24 or whatever network address you want to use i'll press enter and we get some information let me make this full screen so we can actually see it and i'll re-center that there it is now the address 192.168.10 in a network is just referring to the network itself you can't actually use dot zero so when you see dot zero slash 24 you're basically saying that this is the network portion this is whatever number it might happen to be 1.2 and so on and the sider notation 24 basically limits how many ip addresses can actually be used and with this utility we can see which we probably already knew based on what i said earlier that the lowest i p address we can have inside this network is dot one the highest we can go to is dot 254 the broadcast is 255 and the 255 being broadcast what that means is anything you send 2.255 is actually sent to every single host in that network we get a total ip address count of 254. so when you plan an ip address scheme for your home lab or even your home especially your home business then you need to pay special attention to this because it might seem like a lot having the ability to have up to 254 things connected to your network but if you think about it the average person has a phone a tablet a laptop and a desktop for example so there's four ip addresses that are stolen from that one person and that's probably still fine unless you live in a house with like 30 different people but in a business where you have like hundreds of employees those 254 addresses that's probably not going to go very far just keep that in mind especially if you have guest wi-fi you could have all kinds of ip addresses used and i don't know about you if you've ever gone to a diner you tried to use the you know burger king wifi or something like that and you can't get connected that's because everybody driving by is getting an ip address there's no ip addresses for anyone to use that are available because all 254 addresses are basically already used before you even get there then that's not going to be a very useful guest wi-fi however how does this change if we lower the cider notation let's recall that command and subtract a number let's go to slash 23. how does that impact things already we have 510 ip addresses we can go down to slash 22 for example we're up to 1022 slash that increases to 2046 lower that to slash 20. now we have over 4 000 ip addresses that are assignable and the reason why i bring this up is because the whole point of this video is to get you guys thinking about how to design the network layout of your home lab and how many ip addresses you want dhcp to be able to assign that's important maybe 254 addresses is totally fine you could keep the slash 24 maybe you want more than that and you could get that by just subtracting one of the digits here and if you are not good at you know the math when it comes to cider notation and net masks and things like that you can use this ip calc utility on debbie and ubuntu which can give you the ability to actually see how changing the subnet mask or the sider will change the number of ip addresses that you have available now i'm going to minimize this for now let's go back to this why did i actually show all of these networks here when you are thinking about someday creating vlans which you might want to consider it's a good idea to plan how you want to split the devices that are on your network for example you might actually want to dedicate a network for network devices you know management interfaces maybe your vmware or proxmox management interface you could assign an ip address to any switches that are managed you might want to have those in their own network maybe you want your laptops and desktops in their own network your media devices you know playstations your xboxes netflix devices rokus for example whatever you might have that's for the purposes of gaming or streaming media you put them in their own network and when you start segregating things it gives you a better view over where your bandwidth is going which is why i recommend it and let's be honest most home networks you're not going to have 254 devices in your house but that's not the point you can actually segregate things by having dedicated networks for different purposes but in order to do this you have to actually be able to create virtual interfaces that are assigning addresses from these different pools and a residential device like this probably won't give you that option although some might then you're looking at something like pfsense for example being able to segregate your networks is the eventual goal but again for right now just use what you have which could be an asus device such as this one and you can actually assign like i've mentioned before a manual assignment or a static lease to a server to make sure that it always gets the same ip address and like i mentioned earlier i prefer static leases and if you think about it static leases are awesome because even if you boot your server from a live cd and you are not even booting into its normal operating system where you would set a static ip it'll still get the same ip regardless of what operating system you boot it with and another thing you'll also notice when you go to install proxmox or things like that it'll see the ip address that's assigned to it and offer you to create that as a static ip basically when you have a static lease the ip address you assign a server or a device becomes its identity and that actually is an awesome way to do it so again the whole point of this video is to get you guys thinking about how to set up your home network for the purposes of home lab and i wanted to get this video in as early as i can because the setup that you create is going to be the foundation of the rest of your home lab so even if you don't have commercial hardware at the moment and all you have is a retail device which is probably going to be the majority of you you should still start thinking about how to layout your ip addresses how to organize everything it's just a great thing to think about right now that'll set the stage for things that you might want to add to your network later in the next video i'm not sure yet what the topic at hand will be but at least in the short term we're going to go over each of the typical components of a home lab one by one in every episode to give you guys some ideas of what you might want to run in yours and then once we're done with all of that we're going to dive into other topics in greater detail and i think this series is going to keep going and going and going and it may not end for the foreseeable future if ever as long as i have a topic to talk about i'll make continued episodes in this series because i love home lab you guys seem to like it too so it's mutually beneficial so let me know what you think of the topic in this video definitely leave your comments below i look forward to reading those and i will see you again real soon subscribe if you haven't already done so and i will see you in the next [Music] episode [Music] foreign
Info
Channel: LearnLinuxTV
Views: 22,801
Rating: undefined out of 5
Keywords: Linux, Tutorial, Review, Howto, Guide, Distribution, Distro, Learn Linux, operating system, os, open-source, open source, gnu/linux, LearnLinuxTV, LearnLinux.tv, how to homelab, homelab, home server, self host, self-hosting, networking, home networking, it home lab, home network, home lab, network install, network switch, how to, home lab setup, how to make a home lab, wifi, router, switch, network, asus, d-link, ip addresses, cidr, subnet mask
Id: kivVSxFxIK4
Channel Id: undefined
Length: 25min 2sec (1502 seconds)
Published: Mon Dec 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.