Netbox IPAM Prefixes and IP addresses the right way

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
when it comes to doing ip addressing in netbox there's the right way and then there's the functional way in this video we're going to talk about the right way [Music] now i'm not going to just leave you with that cliffhanger because the next video i'm going to talk about the functional way which i used to call the engineers way i just didn't want to offend people that might be a little more planned but most engineers that i find are not planners they wouldn't say that but they they just they they kind of they get the boxes and they're like oh i'm okay i'm just gonna take it and go install it and then and then figure out what to do from there right and it's valid it's functional you'll get there it's just kind of more of a roundabout way in this way i want to talk about if you've got a project manager or you're thinking ahead you're thinking proactively of how you're going to do things let me let me first off go back and let me bring you to the screen i've got netbox right here i'm going to take you back to how netbox handles ip addressing because we've already done this right here which is the aggregate the routing information registries kind of the the big umbrella of subnets right now we're into the prefixes which is where it really begins now just just for the record the engineer way or the functional way is to do this right you got your devices you're like i'm going to install them and i you know you go install them and you're assigning ip addresses and later on you're like i guess i'll i guess i'll go you know project not project plan but but plan you know how the prefix is working all like it's kind of like it's it's more of like the i guess method versus the the the the planned way which is let me plan this out figure out what ip addresses are there and then assign them to the devices we're going to kind of go each direction in here so just to make sure we're all on the same page let me just get to a blank slide right here when you're doing ip addressing typically you'll do allocation so let's just say for example we've got a data center i'm going to get a get a good example going here a data center where we've said let's just say 10.16.0.0.16 is going to be our data center subnet right and that'll be for all the device i mean and you and i both know as you look at it it's huge it's a 65 536 ip addresses so there's no way you would just you know flat lay that on the data center you're going to subnet that so maybe you break that into all the different subnets maybe you do you say you know 10.16.0.0.21 that would be an increment of 8 is is let's just say database servers right the 10.16.8.0.21 or not 24 21 uh might be our web servers and and down down and down we go and again this is still a huge subnet this this would literally encompass 10.16.0.0.7.255 would be the last ip address in that range so we'll subnet that further maybe we'll have 10.16.0.0.24 is our web database servers uh you know the the 10.16 you see where i'm going here right this is this is the way that you plan it um usually the engineer's mind is you'll just have one subnet at the data center one you know slash 24 and when that fills up you'll go to the next one and you'll go to the next one and then before long you've got projects on your hands where you're trying to undo all of the you know disarray of of devices that are in these different subnets and i i'm i'm confessing i'm an engineer i'm not a planner by nature i've just through pain and sorrow learn to think in a planning mindset right so so uh so that being said let's just say hey let me just i'm going to screenshot this just so we've got it this will be how we set up our net box right there we go okay now we're getting that box back in the in the scene here we've got the aggregates which again are the big umbrellas instead we're going down now to the level of prefixes now watch this i'm going to click on add we're going to say 10. so so let's start from the data center right 10.16.0.0.16. description data center subnet right this is for the whole data center obviously we'd be more descriptive it's just a nice generic name um now notice we've got this is a pool section underneath this is if if you you know typically when you're working with subnets the very first and last ip address are not assignable right because one represents the network one represents the broadcast but in some situations like for instance you've got an assigned subnet and you're doing that things like that you can use the first and last ip address because you're using it differently so if you are doing that then check the box is a pool and then everything will be considered usable it won't remove the first and last from the list now notice you also have four statuses i guess that'd be status i right statuses container active reserved and deprecated so container means this isn't you're going to have direct assignments out of this you're good this is just a container of other prefixes right active is active which was therefore reserved is like okay i'm planning that for the future deprecated it's like i used it and now it's it's it's no longer in use but maybe there's some maintenance or something i need to do on that to get it completely removed from the system right so each of those will have different behaviors and i'll show that to you in just a second you can see there's other things here the site that would be your data center what vlan we'll talk about vlans in a little bit so i'm going to hit create right we've got our first prefix check it out 10.1600 16. it's a container of my four site okay now going back to that um that hang on i need my screen cap where are you right there um so going back to our design that was the data center right there then we broke that into the database servers 10.1600 forward slash 21. and then 10 to 16 8.0 is the web server so let's just i just want to add two more right uh 10.16.0.0421 is our database servers but again this is not active i'm not going to sign straight from that it's still too big i'm going to have subnets of those right i'll hit let's add that to our let's say that's our data center create and add another we'll do uh 10.16.8.0421 container and this will be our web service you get the idea right space create now notice how netbox is starting to handle this ooh this is so good look at it notice first off as i move from collapse to expanded it's saying okay that's your data center and underneath that you've got two subnets now notice the utilization is ticking up because it's a container when you allocate subnets when you allocate prefixes it's considered the con the container will represent that as being utilized hang on hang on watch this watch this click on add let's now add our i think i said 10.16.0.04 24 was going to be our web databases right and i'm going to say that's that's now going to be an active one i'm actually going to actively assign ip addresses from there right uh throw that at the data center create add another and then we'll have 10.16.1.0 forward slash 24. that's going to be our user databases right fine click click on create now look at what's going to happen i'm going to click on back to the prefixes right expand that out now whoa what did i do oh okay sorry i was like oh no i've what would i split up there so so notice from this first subnet i'm now a quarter use that's because this allows eight individual slash 24s that would come out of there i've used two of eight right that's so that's 25 percent one-fourth that's been used up right there now now watch watch this watch this i'm gonna go in here and let's say i change this to instead of being a container it's actually active click on update go back to the prefixes oh look at that it's no longer showing any utilization because now the mindset of netbox is saying okay i'm assuming that it's utilized when it's assigned as in an ip address right you've actually created an ip address from that subnet whereas a container is it's considered you know used when you've actually allocated the subnet so i'll go back here and hit uh let's let's go to uh edit and change that back to a container now it's considered allocated when you allocate other prefixes from that notice back back to this so so the active will show used when you start adding ip addresses containers shows used when you start adding prefixes makes sense okay so let's get into the ip addresses now super easy but super valuable to know how you do this so i'm going to go click on add and there's two first off fields that you have right here let's let's to go the old school way again this is the planning way the planning way says before i ever have a server i'm going to document that server and what it will be and then configure it based on this and can i tell you this is the idea of netbox netbox was never meant to just be a documentation system i mean it does that it does it well but it's full api centric meaning application programming interfaces you have the ability to have this set up add an ip address and it automatically adds it to your monitoring system it automatically adds it to your your inventory database right your billing system it automatically adds it to your configuration server so when you plug the device in and it downloads i mean this is the idea of software defined networking this is the idea of making things work i mean that's what network to code for example that's their whole company that's all they do is is they take a product like netbox and then tie it all together to make everything just link link link link link to where it all flows from one database instead of having you create it here add it to the excel spreadsheet go manually configure that's that's going to be the old school way back in the day we used to do that when my grandfather configured routers right and so so i p address is here so i'm documenting this but just know this could be so much bigger so we'll say this is 10.16.1. actually 0.10 24. and let's just say this is our you know web image db primary right um notice you've got you know dns names virtual you know what role is this if you have specific rules defined for this um and you can you can do nat you can do all kinds of things with this but primarily i'm just wanting to get that ip address in the database and whoa look at that we have the ip address it's laying out the parents right there in this nice little hierarchy this is the active one and then it's part of this container which is part of this data center right it's laying it out for us you can also go in there just like you saw and bolt create them really easy not not even well i'll show it to you so we can do a 10.16.1. let's just do 11 and bracket 11 through 19. you'll be able to to see the um the the range syntax on there really easy to to get right um and i'm going to click on create hangs a second and then bam we've got there's the one i manually created there's the the nine or so that i bolt created and as i come back here to my prefixes now when i expand this out i can start seeing these becoming utilizing the active ones utilization comes from the ip addresses that are in there one more thing i know i'm like barely breathing in this video because there's so much i want to show you and one more thing i want to show you is how you can bulk create these guys because most of you if you're in an existing environment will will have been tracking ip addresses from some previous database usually an excel spreadsheet that's the most common thing right so on everything prefixes devices everything they always have this import field and they did such a good job in thinking of this so when you click import you kind of create your csv on the fly that's what i what i'm i'm saying of it so so you so they're saying right here are the valid fields there's only two that are required for ip addresses ip our address and status so so i would go in there and set up my csv file so this is microsoft excel right putting all my ips my statuses maybe i put the description in there you know and in some of the other fields if i want to to modify your csv format all you got to do is you know comma and we'll also add in the description right put that in there so now you would go into excel export it and literally copy and paste this into this text box it doesn't have an upload csv function nothing like that because it causes a lot of pain and sorrow just go to the csv copy control c come in here and do a control v let's just do you know i'll just do a manual example right 10.16.1. let's just say 25 forward slash 24. status will be active description will be jeremy's server right submit and just like that it's like import completed if that were a csv file with a thousand ip addresses it would kind of hang there while doing database rights and then bam they would all show up right there in this import completed and now it's part of your ip addressing for that site there's jeremy server adding its way to the list so three different ways that you can add ip addresses manually one by one bulk create with the range and add them in a big chunk and then manually go update each one and then csv imports all of those is the right way to add ip addresses going from the prefix hierarchy down to the ip addresses and then then from there provisioning your devices based on your plan it's that simple
Info
Channel: Viatto
Views: 30,832
Rating: undefined out of 5
Keywords:
Id: zjNftvwbJ3M
Channel Id: undefined
Length: 13min 12sec (792 seconds)
Published: Tue Jan 25 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.