Jump to content

Alright so its hard to find a straight up answer on google for this question so I was hoping some of you networking experts might be of help.

 

When subnetting a network, I'm assuming not every single computer in each subnet is statically assigned an IP address as this would be a pain in the ass for class A and B networks, so would an ideal way of subnetting be to hook up a router to each subnet and configure it for DHCP relay so that all nodes within a subnet are dynamically assigned an IP? 

 

I'd really appreciate some clarification, let me know if my question is understandable or not, thanks!

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/
Share on other sites

Link to post
Share on other sites

Alright so its hard to find a straight up answer on google for this question so I was hoping some of you networking experts might be of help.

 

When subnetting a network, I'm assuming not every single computer in each subnet is statically assigned an IP address as this would be a pain in the ass for class A and B networks, so would an ideal way of subnetting be to hook up a router to each subnet and configure it for DHCP relay so that all nodes within a subnet are dynamically assigned an IP? 

 

I'd really appreciate some clarification, let me know if my question is understandable or not, thanks!

Ya most addressing is done via DHCP. The only devices that generally get static addresses are routers, printers, firewalls, that sort of stuff. Also you would never have an entire class A, or even B, unsubnetted. Generally speaking most administrators keep things under ~500 hosts just because of broadcasts. Most Routers can run a DHCP service however you can also run a DHCP service on a Windows device, firewall, linux server or almost anything else really. It is also possible to have a single centralized DHCP server and use DHCP relay agents, sometimes called IP helpers, to forward broadcast bootp/DHCP requests to a DHCP server as a unicast message. For most home use however, a SoHo device is most likely the easiest thing to use for assigning addresses.

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6460677
Share on other sites

Link to post
Share on other sites

Yes DHCP relay is used for this. When the DHCP request is forwarded on to the DHCP server the source IP address is used to match the DHCP scope, source address being the IP address of the interface that forwarded the request. DHCP server will send the DHCP reply back to the DHCP relay address then it is sent to the requesting client, I can copy in a wireshark text dump of what the packets look like if you want.

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6460693
Share on other sites

Link to post
Share on other sites

Ya most addressing is done via DHCP. The only devices that generally get static addresses are routers, printers, firewalls, that sort of stuff. Also you would never have an entire class A, or even B, unsubnetted. Generally speaking most administrators keep things under ~500 hosts just because of broadcasts. Most Routers can run a DHCP service however you can also run a DHCP service on a Windows device, firewall, linux server or almost anything else really. It is also possible to have a single centralized DHCP server and use DHCP relay agents, sometimes called IP helpers, to forward broadcast bootp/DHCP requests to a DHCP server as a unicast message. For most home use however, a SoHo device is most likely the easiest thing to use for assigning addresses.

 

Thanks a lot this really cleared things up, but say we've subnetted a class A network for example. When a router relays a DHCP request from its subnet, does the DHCP server know to assign an IP address that will belong to that specific subnet or do you have to tell it somehow?

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6460697
Share on other sites

Link to post
Share on other sites

Thanks a lot this really cleared things up, but say we've subnetted a class A network for example. When a router relays a DHCP request from its subnet, does the DHCP server know to assign an IP address that will belong to that specific subnet or do you have to tell it somehow?

Leadeater covered that one pretty well. The relay agent changes the source address on the DHCP request to its own address. When the DHCP server gets the packet as a unicast it looks at the source and checks what subnet that address belongs to and replies with an address for that scope.

 

As an example:

 

Client broadcasts for a DHCP server with a source IP of 255.255.255.255 (I don't have an IP, someone help!)

Relay agent catches the broadcast and changes the source addres to its own, say 10.0.0.1, and unicasts the message on to the DHCP server

The server checks the source address, 10.0.0.1, and matches it to the DHCP scope, 10.0.0.0/23 for example.

The server then replies back to the relay agent, 10.0.0.1, and inside this packet there will be all the DHCP information the client needs

The relay agent then sends this message back to the client, again using it's own address as the source (pretending to be the DHCP server)

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6460715
Share on other sites

Link to post
Share on other sites

-snip-

 

 

-snip-

Thank you both very much, you've clarified everything I needed to know!

 

One more quick question about a subnet mask, take 255.255.255.192 for example, what does the 192 in the last octet represent? I know that it is /26 in CIDR notation but I'm just confused as to what the 192 in the last octet means. 

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6460753
Share on other sites

Link to post
Share on other sites

Network Address:   10.1.1.0          00001010.00000001.00000001.00000000

Subnet Mask:  255.255.255.192   11111111.11111111.11111111.11000000

Broadcast Address: 10.1.1.63       00001010.00000001.00000001.00111111

 

Assignable client IP range 10.1.1.1 - 10.1.1.62

 

Edit: Forgot to change the bits from 172.16.1.0 to 10.1.1.0 in the network and broadcast address, copy paste from another post error  :P

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6460780
Share on other sites

Link to post
Share on other sites

 

Network Address:   10.1.1.0          00001010.00000001.00000001.00000000
Subnet Mask:  255.255.255.192   11111111.11111111.11111111.11000000
Broadcast Address: 10.1.1.63       00001010.00000001.00000001.00111111
 
Assignable client IP range 10.1.1.1 - 10.1.1.62
 
Edit: Forgot to change the bits from 172.16.1.0 to 10.1.1.0 in the network and broadcast address, copy paste from another post error  :P

 

haha thank god that was a mistake, I was like how did he get that conversion, thanks a lot man!

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6460879
Share on other sites

Link to post
Share on other sites

Haha yea I also looked at it after posting and went, what the?? @Wombo knows where I copied that from :)

 

Just for information sake the next subnets are:

10.1.1.64 to 10.1.1.127

10.1.1.128 to 10.1.1.191

10.1.1.192 to 10.1.1.255

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6460907
Share on other sites

Link to post
Share on other sites

Haha yea I also looked at it after posting and went, what the?? @Wombo knows where I copied that from :)

 

Just for information sake the next subnets are:

10.1.1.64 to 10.1.1.127

10.1.1.128 to 10.1.1.191

10.1.1.192 to 10.1.1.255

Was it Subnet Masks Reborn? xD

 

Also @KraftDinner I feel the question of "how does a DHCP server know what scope to pull from when it gets a relayed DHCP request" Is a question we have all had. I know I did when I first learned about DHCP relay. I feel there are plenty of things in the networking field that you can look into, understand how to configure them and know that it will work, but not fully understand what is really going on. Pursuing that unknown, asking the questions and learning how our IP networks really function is what separates average IT people from great IT people. Keep asking those questions, in anything you do, and you can be one of those great people.

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6461050
Share on other sites

Link to post
Share on other sites

Was it Subnet Masks Reborn? xD

 

Also @KraftDinner I feel the question of "how does a DHCP server know what scope to pull from when it gets a relayed DHCP request" Is a question we have all had. I know I did when I first learned about DHCP relay. I feel there are plenty of things in the networking field that you can look into, understand how to configure them and know that it will work, but not fully understand what is really going on. Pursuing that unknown, asking the questions and learning how our IP networks really function is what separates average IT people from great IT people. Keep asking those questions, in anything you do, and you can be one of those great people.

Thanks for the kind words, I'm getting into the IT scene and I don't just want to know enough to get by, I'd like to be the guy that understands everything behind the scenes aswell. It just makes troubleshooting that much easier aswell.

Link to comment
https://linustechtips.com/topic/481621-subnetting-question/#findComment-6461338
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×