how does pc know which dhcp scope to use?

jjyiz28

Platinum Member
Jan 11, 2003
2,901
0
0
1dhcp server, multiple scopes, 1 domain, 2k active directory. setting reservations are too time consuming, am i missing something??

 

gunrunnerjohn

Golden Member
Nov 2, 2002
1,360
0
0
AFAIK, it normally takes the first IP address offered as a rule. There may be a way to modify that behavior, but I think usually that's handled outside of the workstation.
 

SectorZero

Member
Sep 29, 2002
96
0
0
You can set up all the scopes for different subnets you want, but your DHCP server will only hand out an IP for a different subnet if the request comes through a router or a DHCP relay agent. This request will be a multi cast, the packet will contain the IP info from the subnet the request originated from and the DHCP server will hand out an address from the co-responding scope.

If the DHCP request arrives as a broadcast, this means the requesting host is on the same subnet. The DHCP server will hand out an IP from a scope that handles it's own subnet.

If you want different IP configurations for certian hosts on your own subnet, you will have to configgure options for Classes, then associate the host for a speciffic class using "ipconfig setclassid" from the commandline.

Clear?

 

jjyiz28

Platinum Member
Jan 11, 2003
2,901
0
0
Originally posted by: SectorZero
You can set up all the scopes for different subnets you want, but your DHCP server will only hand out an IP for a different subnet if the request comes through a router or a DHCP relay agent. This request will be a multi cast, the packet will contain the IP info from the subnet the request originated from and the DHCP server will hand out an address from the co-responding scope.

If the DHCP request arrives as a broadcast, this means the requesting host is on the same subnet. The DHCP server will hand out an IP from a scope that handles it's own subnet.

If you want different IP configurations for certian hosts on your own subnet, you will have to configgure options for Classes, then associate the host for a speciffic class using "ipconfig setclassid" from the commandline.

Clear?

that makes a lot of sense, about using a dhcp relay, or not. but there's something that im just not getting

when you connect up the pc to a switch, and its configured to use dhcp for IP address, what determines whether that requesting host is on the same subnet as the dhcp server or not???

im fine and dandy with it if its just a broadcast and dhcp responds, then the client is on the same subnet. if the dhcp gets it from a relay server, then the client is from another subnet. but what or how do you determine what subnet that requesting host is on in the first place???

do you get what im saying?? kinda like the question which came first, chicken or egg.
 

SectorZero

Member
Sep 29, 2002
96
0
0
Certian Routers can forward DHCP requests, but as a general rule broadcasts don't pass through routers. So if a DHCP server recieves a request in the form of a broadcast it knows to dishout an IP on it's own subnet.

If a DHCP request comes in by way of a DHCP relay agent or a compliant router, the packet will contain info about its originating subnet. THat's how the DHCP server knows what scope to hand out an IP from.

This is all handled automagically by the DHCP server.
 

jjyiz28

Platinum Member
Jan 11, 2003
2,901
0
0
Originally posted by: SectorZero
Certian Routers can forward DHCP requests, but as a general rule broadcasts don't pass through routers. So if a DHCP server recieves a request in the form of a broadcast it knows to dishout an IP on it's own subnet.

If a DHCP request comes in by way of a DHCP relay agent or a compliant router, the packet will contain info about its originating subnet. THat's how the DHCP server knows what scope to hand out an IP from.

This is all handled automagically by the DHCP server.

i understand all of what you are saying. but what determines whether the client is on the same network as dhcp, so that it doesn't need a dhcp relay; and what determines whether the client is on another network, so that it needs to use a dhcp relay???
 

SectorZero

Member
Sep 29, 2002
96
0
0
O.K. IP Addressing 101.

2 computers will be on the same subnet if the network ID portions of their IP address are the same.
An IP Address is composed of Network ID and Host ID. We sepparate Net ID and Host ID using a subnet mask.

For example: 2 computers, computerA has an IP address 192.168.1.51 and a subnet mask 0f 255.255.255.0
ComputerB has an IP address of 192.168.1.52 and a subnet mask of 255.255.255.0

If you place the IP address on top of the subnet mask: 192.168.1.51
255.255.255.0
You can see that the net ID is 192.168.1 and the host ID is 51.

These 2 computers are on the same subnet. We separate subnets using routers.

Another computer, ComputerC has an IP address of 192.168.2.53 and a subnet mask of 255.255.255.0

Following our rule: 192.168.2.53
255.255.255.0

We can see that this computer has a Net ID of 192.168.2 and a host ID of 53

ComputerC is NOT on the same subnet as ComputerA and ComputerB.

Sound simple? lol It can get complicated once you start playing around with the subnet mask.
 

jjyiz28

Platinum Member
Jan 11, 2003
2,901
0
0
since a dhcp client needs to get its IP info from a dhcp server, how will you be able to tell which network it is on in the first place to get the correct scope?
 

SectorZero

Member
Sep 29, 2002
96
0
0
lol

Ok, this is not a chicken or egg situation. THere are certian hosts on any network that MUST have static IP addresses in order to function. Ports on routers connecting two or more subnets are an example of this.

So, if your router guy has done his job correctly, all your subnets should have been planned out in advance. The only hosts on any subnet that should need IP's from a DHCP server should be the client computers.

 

jjyiz28

Platinum Member
Jan 11, 2003
2,901
0
0
i have a single 16port switch. i have a DC/DNS server on port1 w/ adddress 192.168.0.2/24. i have a RRAS server, strickly for LAN routing. the RRAS server has 2 NICS, nic1 has address 192.168.0.1/24. nic2 has address 192.168.1.1/24. nic1 connected to port2, nic2 connected to port3. i have a dhcp server 192.168.0.3, set up with 2 scopes, scope 1 is 192.168.0 network(host range 100-150), scope 2 is 192.168.1 network(host range 100-150). dhcp server connected to port 4. i have a workstation with static address of 192.168.0.10/24, dns, dhcp, default gateway, all configured. connected to port 5. i have another workstation with static address of 192.168.1.10.24, all fully configured. connected to port 6

everyone is happy. i could communicate within the subnets, and between both subnets. now i introduce a workstation with automatic IP addressing. connected through port 7. which scope will it get??? will it get it from 192.168.0 network or the 192.168.1 network??
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Originally posted by: jjyiz28
since a dhcp client needs to get its IP info from a dhcp server, how will you be able to tell which network it is on in the first place to get the correct scope?

You can read the RFC for dhcp. one of the things the DHCP relay agent does is modify the DHCP request and insert the originating network in the packet. That way the server knows which scope to use.
 

SectorZero

Member
Sep 29, 2002
96
0
0
Ahhhh, I think I understand what you've done now.

You have a server with 2 NIC's (Each with different Net Id's) plugged into the same switch.
LOL

Since this is also your DHCP server, it's handing out IP's on each NIC.

But it's all plugged into the same switch!!!!!?????

OK, if this is the case then the only thing that determines what subnet a DHCP client is going to end up on is which NIC on your DHCP server responds first.

 

SectorZero

Member
Sep 29, 2002
96
0
0
Sorry, I re-read your post.

Ok, lemmee see if I got this straight this time.

You have one 16 port switch. The Multi homed server is your router NOT your DHCP server.

If you plug another DHCP client into your switch it will BROADCAST a DHCP request.
Broadcasts do not pass through routers.

THerefore the DHCP client will recieve an IP from the 192.168.0.0/24 scope
 

jjyiz28

Platinum Member
Jan 11, 2003
2,901
0
0
Originally posted by: SectorZero
Sorry, I re-read your post.

Ok, lemmee see if I got this straight this time.

You have one 16 port switch. The Multi homed server is your router NOT your DHCP server.

If you plug another DHCP client into your switch it will BROADCAST a DHCP request.
Broadcasts do not pass through routers.

THerefore the DHCP client will recieve an IP from the 192.168.0.0/24 scope

ok i think i get it. thanks for trying to figure it all out for me. but another quick question,sorry. =)

with the pre-existing network still intact, what if i add a dhcp relay server(192.168.1.2) on port 7, configured to send it to my dhcp server (192.168.0.3), then i introduce a workstation on port 8. a workstation that will be joining the domain for the first time with automatic IP addressing. what address will it get??

this is the question i ultimately wanted answered. help me out one more time, thanks buddy.
 

SectorZero

Member
Sep 29, 2002
96
0
0
AllRighty,

A DHCP Relay is configured, by default, to wait 4 seconds before passing on any DHCP requests. This is to ensure that any DHCP server on the same subnet will reply first.

So, even if you put a DHCP relay agent on your network, because of the delay, your DHCP server would hand out a 192.168.0.0/24 adress.

And yes , it is possible to set the delay on the relay agent to 0, but passing through the router would cause delays also. I 'm pretty sure your server would always dish out IP's on 192.168.0.0/24.

You should get another hub or sitch and divide up your network if you really want to play around with subnets and DHCP relay agents.
 

jjyiz28

Platinum Member
Jan 11, 2003
2,901
0
0
i was under the impression that switches must be connected to each other. if that was the case, the broadcast will reach both switches. if i wanted 2 separate subnets, get 2 switches, RRAS server connected to both, but do not connect up the switches together.

i got it now, finally. thanks bro. =)