33
DHCP

Dhcp edu

Embed Size (px)

Citation preview

DHCP

Overview of DHCP

• DHCP

• DHCP IP Leasing Process

• Renewing an IP Address

• Installing the DHCP Service

• DHCP Relay Agent

• Superscope Implementation

2

Dynamic Host Configuration Protocol (DHCP)

DHCP is a protocol that allows client computers to automatically

receive an IP address and TCP/IP settings from a Server.

Allows servers to assign or lease IP addresses to computers and other

devices that are enabled as DHCP clients on the network.

All DHCP messages are carried in User Datagram Protocol (UDP)

datagrams using the well-known port numbers 67 (from the server)

and 68 (to the client).

3

4

DHCP PORTS DHCP(Port-67):

Bootstrap Protocol (BOOTP) Server;

DHCP(Port-68):

Bootstrap Protocol (BOOTP) Client;

The ipconfig /all command will indicate whether the configuration

came from a DHCP server computer

5

DHCP Settings in Client Side

6

DHCP Details in cmd

7

Leasing an IP Address

• An IP address is leased during the boot process• The overall process is composed of four broadcast

packets:• It will call DORA Process:

• DHCPDISCOVER• DHCPOFFER• DHCPREQUEST• DHCPACK

8

Leasing an IP Address

• Any DHCP server that receives the DHCPDISCOVER packet

responds with a DHCPOFFER packet

• The DHCP client responds to the DHCPOFFER packet it

receives with a DHCPREQUEST packet

• A DHCPACK packet indicates confirmation that the client can

use the lease

• Once DHCPACK is received, the client can start using the IP

address and options in the lease

9

Four Packets In The DHCP IP Leasing Process

10

Renewing an IP Address• The IP address can either be permanent or timed• A permanent address is never reused for another

client• Timed leases expire after a certain amount of time

• Windows clients attempt to renew their lease after 50% of the lease time has expired. If the renewal process fails, it attempts again after 87.5% of the lease time has expired.

• Renewing the lease involves the client sending a DHCP Request packet to DHCP Server

11

Renewing an IP Address

12

More on the Renewal Process…

• DHCP Client, at startup, attempts to reach the DHCP Server Server Available:• If the server is available and the lease has not yet

expired, the client retains the IP address

• If the server is available and the lease has expired, the client attempts to renew the lease.

13

More on the Renewal Process…

• DHCP Client, at startup, attempts to reach the DHCP Server Server Unavailable:• If the server is unavailable, the client will ping the

previously assigned default gateway to determine if it’s on the same network.

• If the gateway responds and the lease hasn’t expired, the client retains the IP address

• If the gateway doesn’t respond the client will send a DISCOVER packet to begin the lease process over

14

Question?• When a DHCP Server does not respond to a Client’s call for an

IP Address, the client will autoconfigure itself APIPA IP.

• The client selects an IP address from the 169.254.0.0

subnet

• The client will attempt to contact a DHCP server using

DISCOVER packets every 5 minutes

• The lease duration can be any amount of time between 1

minute and 999 days, or it can be unlimited.

• The default lease duration is eight days.

15

Installing the DHCP Service

• When placing a DHCP Service on a Server in a Domain:• Install the DHCP Server Service• Authorize DHCP Server in Active Directory• Configure DHCP Server with appropriate scopes,

exclusions, reservations and options

• Activate the DHCP Server’s Scopes• When placing a DHCP Service on a Server in a Workgroup:

• Install the DHCP Server Service• Configure DHCP Server with appropriate scopes,

exclusions, reservations and options• Activate the DHCP Server’s Scopes

16

Authorizing the DHCP Service

• A server that is a member of a domain can be authorized

• During the installation of the service: the Install Wizard

provides an option to authorize the server

• Only members of the Enterprise Admins(win2003,win2008)

group can authorize a server

• A server that is a member of a workgroup(win7,xp)does not need

to be authorized.

17

Configuring DHCP Scopes• Scope defines a range of IP addresses• Each scope is configured with:

• Description- Name of Scope• Starting IP address- 192.168.1.51• Ending IP address- 192.168.1.200

• Subnet mask- 255.255.255.0• Exclusions• Lease duration- 8Day

Reserve a range of addresses at beginning or end of range that can be used for static addresses

18

Configuring DHCP Scopes

• Lease duration defines how long client computers are allowed to use an IP address

• Default lease duration varies based on the network type and the DHCP Server version

• A scope must be activated before the DHCP service can begin using it

19

Creating DHCP Reservations

• Reservations are used to hand out a specific IP address to a particular client

• Useful when delivering IP addresses to devices that would normally use static addresses

• Reservations are created based on MAC addresses

20

Creating DHCP Exclusions

• Exclusions are IP Addresses that are within the subnet defined within the scope but that should not be assigned to a dhcp client

21

Configuring DHCP Options

• DHCP can hand out a variety of other IP configuration options

• It is common that all workstations within an entire organization use the same DNS servers

• DNS is often configured at the server level

22

DHCP Relay Agent

• DHCP packets cannot travel across a router• A relay agent is necessary in order to have a single DHCP

server handle all leases on both network segments• This can be a Windows 2003/2008 server with DHCP

Relay Agent protocol installed or a router that is configured as a relay

• Relay agents receive broadcast DHCP packets and forward them as unicast packets to a DHCP server

• The relay agent must be configured with the IP address of the DHCP server

• The DHCP relay cannot be installed on the same server as the DHCP service

23

Configuring a DHCP Relay

DHCP Relay Agent

24

UNICASTING AND BROADCASTINGUnicast Message:• When using unicast method, one device will send the message to

exactly one destination device. If some device needs to send a message to multiple devices, it will have to send multiple unicast messages, each message addressed to a specific device. So, the sender has to send a separate message to each destination device.

Broadcast Message:

• The second method of sending messages is called the broadcasting. Broadcast is a packet that's sent to all devices on specific network. The destination address in the packet is the special broadcast address. If the packet has a broadcast address, all devices that receive that message will process it

25

26

Superscopes

• Used to combine multiple scopes into a single logical scope

• Allows multiple scopes to be treated as a single scope• Useful when a single physical network segment

contains more than one logical subnet• If a superscope is used, then the DHCP server offers

only one lease as opposed to multiple leases

27

Example 1: No Super scope

• One physical network segment

• One logical subnet (192.168.1)

• One DHCP Server• Single scope is used to

service all DHCP clients on Subnet A

28

Example 2: Superscope• One physical network segment

• Multiple logical subnets • 192.168.1• 192.168.2• 192.168.3

• Three single scopes created and joined into one superscope

• One DHCP Server services all clients on Subnet A with an IP address from the superscope

• Router configured with multiple addresses to allow packets to move from one logical network to another

29

Example 3: Superscope Implemented across a Router

• Two physical network segments: Subnet A and Subnet B

• One DHCP Server• Router configured with

Relay Agent• Something that will pass

Discover Packets back and forth from DHCP Clients and DHCP Server

30

Superscope Implemented across a Router

• Subnet A: • One physical segment• One logical subnet (192.168.1)• One single scope defined • DHCP server distributes

addresses to clients on Subnet A using addresses in single scope

• Subnet B:• One physical segment• Two logical subnets (192.168.2

& 192.168.3)• Two single scopes defined and

joined into one Superscope• DHCP server distributes

address to clients on Subnet B using addresses in superscope

Saving and Restoring DHCP Configuration

• DHCP Server configurations can be saved to a file• These saved settings can then be used to restore the server to a

known state OR to use the same settings on another server• To save the configuration :

• To restore the configuration:

31

Advantages & Disadvantages

Advantages:• To implement DHCP requires no additional costs.• Duplicated IP addresses are prevented

• Reduces the amount of time you spend configuring computers on your network

• DHCP servers only allocate IP addresses to clients when they request them.

Disadvantages:• The DHCP server can be a single point of failure in networking

environments that only have one DHCP server.• Place a DHCP relay agent on each segment

• Configure routers to forward Bootstrap Protocol (BootP) broadcasts.

32

33

Conflict Detection

• Using DHCP does not prevent static IP configuration• A DHCP server may hand out an IP address that was

already statically assigned• Conflict detection prevents a DHCP server from

creating IP address conflicts• A DHCP server pings an IP address before it is leased

to a client computer