63
DHPC D ynamic H ost C onfiguration P rotocol 1

Linux05 DHCP Server

Embed Size (px)

DESCRIPTION

Linux DHCP Server

Citation preview

Page 1: Linux05 DHCP Server

DHPCDynamic Host Configuration Protocol

1

Page 2: Linux05 DHCP Server

DHPC

• Every host on a TCP/IP network must have a unique IP address.

2

• Each host must be properly configured so that it knows its IP address.

• When a new host comes online, it must be assigned an IP address that is within the correct range of addresses for the subnet and is not already in use.

Page 3: Linux05 DHCP Server

DHPC• Although you can manually assign IP

addresses to each computer on your network, that task quickly becomes overwhelming if the network has more than a few computers.

3

• That’s where DHCP – Dynamic Host Configuration Protocol, comes into play.

Page 4: Linux05 DHCP Server

DHPC• DHCP automatically configures the IP

address for every host on a network, thus assuring that each host has a valid unique IP address.

4

• DHCP even automatically reconfigures IP addresses as hosts come and go.

• DHCP can save a network administrator many hours of tedious configuration work.

Page 5: Linux05 DHCP Server

DHPC 5Understanding DHCP:

• DHCP allows individual computer on a TCP/IP network to obtain their configuration information- in particular, their IP address – from a server.

• The DHCP server keeps track of which IP addresses have already been assigned so that when a computer request an IP address, the DHCP server will offer it an IP address that is not already in use.

Page 6: Linux05 DHCP Server

DHPC 6Configuration information:

• Although the primary, DHCP actually provides more configuration information than just the IP address to its clients.

• The additional configuration information is referred to a DHCP options.

Page 7: Linux05 DHCP Server

DHPC 7Configuration information:

The following is a list of some common DHCP options that can be configured by the server: The router address, also known as

the Default Gateway address.The expiration time for the

configuration information.Domain nameDNS server addressWINS server address

Page 8: Linux05 DHCP Server

DHPC 8Servers:A DHCP server can be a server computer located on the TCP/IP network. All modern server operating system have a built-in DHCP server.

To set up DHCP on a network server, all you have to do is enable the server’s DHCP function and configure its settings.

A server computer running DHCP doesn’t have to be devoted entirely to DHCP unless the network is very large.

Page 9: Linux05 DHCP Server

DHPC 9Servers:For most networks, a file server can share duty as a DHCP server.

This is especially true if you provide long leases for your IP addresses. Many multifunction routers also have built-in DHCP servers.

Page 10: Linux05 DHCP Server

DHPC 10Servers:An advantage of allowing the router to be your network’s DHCP server is that you rarely need to power down a router.

In contrast, you occasionally need to restart or power down a file server to perform system maintenance, to apply upgrades, or to perform troubleshooting.

Most networks require only one DHCP server.

Page 11: Linux05 DHCP Server

DHPC 11Servers:

If you accidently set up two DHCP servers for the same scope, you many end up with duplicate address assignments if the servers attempt to assign the same IP address to two different hosts.

Setting up two or more servers on the same network requires that you carefully coordinate the IP address ranges (scope) for which each server is responsible.

Page 12: Linux05 DHCP Server

DHPC 12Servers:

To prevent this from happening, its best to set up just one DHCP server unless your network is so large that one server can’t handle the load.

Page 13: Linux05 DHCP Server

13How DHCP actually works

Use / Config. DHCP server without knowing the details of how DHCP client configuration actually works.

The following paragraphs are a blow-by-blow account of how DHCP configures TCP/IP hosts.

Page 14: Linux05 DHCP Server

14How DHCP actually works

This procedure happens every time you boot up a host computer. It also happens when you release an IP lease and request a fresh lease.

When a host computer starts up, the DHCP client software sends a special broadcast packet, known as a DHCPDiscover message

Page 15: Linux05 DHCP Server

15How DHCP actually worksThis message uses the subnet’s broadcast address (all host ID bits set to one) as the destination address and 0.0.0.0 as the source address.

The client has to specify 0.0.0.0 as the source address because it doesn’t yet have an IP address, and it specifies the broadcast address as the destination address because it doesn’t know the address of any DHCP servers.

Page 16: Linux05 DHCP Server

16How DHCP actually works

In effect, the DHCPDiscover message is

saying ‘Hey...! I’m new here. Are there any

DHCP servers out here?’

Page 17: Linux05 DHCP Server

17How DHCP actually worksThe DHCP server receives the broadcast DHCPDiscover message and responds by sending a DHCPOffer message include an IP address that the client can use.Like the DHCPDiscover message, the DHCPOffer message is sent to the broadcast address. This makes sense because the client to which the message is being sent doesn’t yet have an IP address and won’t have one until it accepts the offer.

Page 18: Linux05 DHCP Server

18How DHCP actually worksIn effect, the DHCPOffer message is saying, ‘Hello there, whoever you are. Here’s an IP address you can use, if you want it. Let me know.’What if the client never receives a DHCPOffer message from a DHCP server?In that case, the client waits for a few seconds and tries again. The client will try four times – at 2, 4, 8 and 16 seconds. If it still doesn’t get an offer, it will try again after five minutes.

Page 19: Linux05 DHCP Server

19How DHCP actually works

The client receives the DHCPOffer message and sends back a message known as a DHCPRequest message. At this point, the client doesn’t actually own the IP address. It’s simply indicating that it’s ready to accept the IP address that was offered by the server.In effect, the DHCPRequest message says, ‘Yes, that IP address would be good for me, Can I have it, please?’

Page 20: Linux05 DHCP Server

20How DHCP actually works

When the server receives the DHCPRequest message, it marks the IP address as assigned to the client and broadcasts a DHCPAck message.

The DHCPAck message says, in effect, “Okay, it’s all yours. Here’s the rest of the information you need to use it.”

Page 21: Linux05 DHCP Server

21How DHCP actually works

When the client receives the DHCPAck message, it configures its TCP/IP stack by using the address it accepted from the server.

Page 22: Linux05 DHCP Server

22Understanding Scope:A scope is simply a range of IP addresses that a DHCP server is configured to distribute.In the simplest case, where a single DHCP sever oversees IP configuration for an entire subnet, the scope corresponds to the subnet.However, if you set up two DHCP servers for a subnet, you can configure each with a scope that allocates only one part of the complete subnet range.

Page 23: Linux05 DHCP Server

23Understanding Scope:In addition, a single DHCP server can serve more than one scope.

You must create a scope before you can enable a DHCP server. When you create a scope, you can provide it with the following properties:

1) A scope name, which helps you to identify the scope and its purpose.

one scope

Page 24: Linux05 DHCP Server

24Understanding Scope:2) A scope description, which lets you provide additional details about the scope and its purpose.

3) A starting IP address for the scope.4) An ending IP address for the scope.

5) A subnet mask for the scope. You can specify the subnet mask with dotted decimal notation or with CIDR notation.

Page 25: Linux05 DHCP Server

25Understanding Scope:6) One or more ranges of excluded addresses. These addresses won’t be assigned to clients.

7) One or more reserved addresses. These are addresses that will always be assigned to particular host devices.

8) The lease duration, which indicates how long the host will be allowed to use the IP address. ...

Page 26: Linux05 DHCP Server

26Understanding Scope:8) ... The client will attempt to renew the lease when half of the lease duration has elapsed. For example, if you specify a lease duration of eight days, the client will attempt to renew the lease after four days have passed. This allows the host plenty of time to renew the lease before the address is reassigned to some other host.

Page 27: Linux05 DHCP Server

27Understanding Scope:9) The router address for the subnet. This value is also known as the Default Gateway address.

10) The domain name and the IP address of the network’s DNS server and WINS servers.

Page 28: Linux05 DHCP Server

28Understanding excludedIn the case of DHCP scopes, exclusions can help you to prevent IP address conflicts and can enable you to divide the DHCP workload for a single subnet among two or more DHCP servers.

An exclusion is a range of addresses that are not included in a scope. The exclusion range falls within the range of the scope’s starting and ending addresses.

Page 29: Linux05 DHCP Server

29Understanding excludedIn effect, an exclusion range lets you punch a hole in a scope. The IP addresses that fall within the hole won’t be assigned.The following are several reasons for excluding IP addresses from a scope:1) The computer that runs the DHCP

service itself must usually have a static IP address assignment. As a result, the address of the DHCP server should be listed as exclusion.

Page 30: Linux05 DHCP Server

30Understanding excluded2) Some hosts many not be able to support DHCP. In that case, the host will require a static IP address.For example, you may have a really old MS-DOS computer that doesn’t have a DHCP client. By excluding its IP address from the scope, you can prevent that address from being assigned to any other host on the network.

Page 31: Linux05 DHCP Server

31Understanding Reservation

In some cases, you may want to assign a particular IP address to a particular host.

One way to do this is to configure the host with a static IP address so that the host doesn’t use DHCP to obtain its IP configuration.

Page 32: Linux05 DHCP Server

32Understanding excludedHowever, two major disadvantages to that approach exist:

1) TCP/IP configuration supplies more than just the IP address. If you use static configuration, you must manually specify the subnet mask, Default Gateway address, DNS server address, and other configuration information required by the host.

Page 33: Linux05 DHCP Server

33Understanding excluded2) You must remember to exclude the static IP address from the DHCP server’s scope. Otherwise, the DHCP server won’t know about the static address and may assign it to another host. Then, you will have two host with the same address on your network.

Page 34: Linux05 DHCP Server

34Understanding excluded

A better way to assign a fixed IP address to a particular host is to create a DHCP reservation.

A reservation simply indicates that whenever a particular host requests an IP address from the DHCP server, the server should provide it the address that you specify in the reservation.

Page 35: Linux05 DHCP Server

35Understanding excludedThe host won’t receive the IP address until the host requests it from the DHCP server, but whenever the host does request IP configuration, it will always receive the same address.

To create a reservation, you associate the IP address that you want assigned to the host with the host’s MAC address.

Page 36: Linux05 DHCP Server

36Understanding excludedAs a result, you need to get the MAC address from the host before you create the reservation.

You can get the MAC address by running the command

ipconfig /allFrom command prompt.

Page 37: Linux05 DHCP Server

37Understanding excluded

Start All Programs

Accessories System Tools

System Information.

Page 38: Linux05 DHCP Server

38

What is BOOTP

Self Study...

Page 39: Linux05 DHCP Server

39Installing and Configuring DHCP server.

1) Choose Start >> Administrative Tools >> Manage Your Server. [Manage Your Server application appears]

2) Click the Add or Remove a Role Link. [The Configure Your Server Wizard appears]

Steps:

Page 40: Linux05 DHCP Server

40Installing and Configuring DHCP server.

3) Select DHCP Server from the list of roles and then click Next.

4) Click Next.

Steps:

Page 41: Linux05 DHCP Server

41Installing and Configuring DHCP server.

The Wizard calls up the Windows Setup program to install the DHCP server components.This can take a few minutes, so be patient. When the components are installed, the Windows Setup program automatically ends and is replaced by the New Scope Wizard dialog box, as shown in figure 1.0.

Steps:

Page 42: Linux05 DHCP Server

42Installing and Configuring DHCP server.

The New Scope Wizard guides you through the process of creating the first scope for the DHCP server.

5) Click the Next buttonThe wizard asks for a name and description for the new scope.

Steps:

6) Type the name and description for the scope. Give name in description i.e. “Office-Server”

Page 43: Linux05 DHCP Server

43Installing and Configuring DHCP server.

7) Click Next The Wizard asks for the scope range, as shown in Figure

Steps:

Page 44: Linux05 DHCP Server

44Installing and Configuring DHCP server. [The Scope Wizard comes]

Steps:

Page 45: Linux05 DHCP Server

45Installing and Configuring DHCP server. [The Scope Wizard comes]

Steps:

Page 46: Linux05 DHCP Server

46Installing and Configuring DHCP server.

8) Enter the start and end IP address and the subnet mask.You can enter the subnet mask by either selecting its length from the Length spin button or by entering the complete subnet mask into the Subnet Mask text box. In this example, I’ve entered the range 192.168.1.1 through 192.168.1.254, with a subnet mask of 255.255.255.0.

Steps:

Page 47: Linux05 DHCP Server

47Installing and Configuring DHCP server.

9) Click NextThe next screen of the wizard lets you create exclusions, as shown in Figure

Steps:

Page 48: Linux05 DHCP Server

48Installing and Configuring DHCP server. Figure 3.0 : Specifying exclusion

Page 49: Linux05 DHCP Server

49Installing and Configuring DHCP server.

10) Enter each exclusion by entering the start and end IP address and then clicking ADD.

Steps:

 11) Click NextNext, the wizard asks for the lease duration, as shown in Figure

12) Use the spin boxes to specify the lease duration.

The default setting is eight days. For more information about how to choose an appropriate lease

duration, refer to the section "How long a lease?"

Page 50: Linux05 DHCP Server

50Installing and Configuring DHCP server. Specifying the lease duration

Page 51: Linux05 DHCP Server

51Installing and Configuring DHCP server.

13) Click Next The wizard asks whether you want to configure the DHCP options now or later.

 Figure Specifying the lease duration 

14) Check YES and then click NEXT The wizard asks for the IP address of the router.

Steps:

Page 52: Linux05 DHCP Server

52Installing and Configuring DHCP server.

15) Enter the router's IP address, click Add, and then click Next.Next, the wizard asks for the DNS configuration information, as shown in Figure 3.5

 16) Enter the domain name and DNS servers. To enter a DNS server, type its address in the IP address text box and click ADD button.

 You typically have more than one DNS server.

 In figure 3.5 I specified LoweWriter.com for the domain name and provided IP addresses for three DNS servers.

Steps:

Page 53: Linux05 DHCP Server

53Installing and Configuring DHCP server. Specifying the DNS information

Page 54: Linux05 DHCP Server

54Installing and Configuring DHCP server.

17) Click NextThe wizard nexst asks for the WINS configuration information. 

18) Enter the WINS server configuration and then click Next.To specify a WINS server, enter the server's IP address and click Add. 

Steps:

Page 55: Linux05 DHCP Server

55Installing and Configuring DHCP server.

19) Choose Yes or No to activate the scope now or wait until later and then click Next. 20) Click Finish to close the New Scope Wizard. 21) Click Finish to close the Configure Your Server Wizard. 

Steps:

Page 56: Linux05 DHCP Server

56Managing a DHCP server

You can bring up the DHCP management console by choosing  START >> Administrative Tools >> DHCP

Page 57: Linux05 DHCP Server

57Managing a DHCP server

-- OR --by clicking

Manage This DHCP Server from the

Manage Your Server application. 

Page 58: Linux05 DHCP Server

58Managing a DHCP server

Page 59: Linux05 DHCP Server

59Managing a DHCP server

Page 60: Linux05 DHCP Server

60Configure a DHCP Client

The DHCP client is automatically included when you install the TCP/IP protocol, so all you have to do is configureTCP/IP to use DHCP.

To do this, bring the Network Properties dialog box by choosing Network / Network Connections in the Control Panel.

Page 61: Linux05 DHCP Server

61Configure a DHCP Client

Then, select the TCP/IP protocol and click the Properties button. This brings up the TCP/IP properties dialog box, as shown in figure 3.8. 

To configure the computer to use DHCP, check  Obtain An IP Address Automatically and  Obtain DNS Server Address Automatically

Page 62: Linux05 DHCP Server

62Managing a DHCP Client

Page 63: Linux05 DHCP Server

That’s All for DHCP

63

63