If you want to configure Dynamic Host Configuration Protocol(DHCP) on PC clients, you currently have multiple options to choose for your DHCP server. One of the morecommon ways to accomplish this is by using a Windows or Linux server. However,most home networks get DHCP from their DSL or cable router.
Many administrators forget—or don't even realize—that DHCPis also available on Cisco IOS routers and switches. Keep in mind that DHCP is onlyavailable on newer IOS-based switches. For example, Catalyst 3550 and 3750offer DHCP.
Deciding if this is right for your organization
Using a router as a DHCP server has its pros and cons. Forexample, let's say you have a multisite network, and you've decided to use yourrouters as DHCP servers for each network.
One benefit of running DHCP on a routers is that it doesn'trequire any extra hardware (like a Windows server does). In addition, runningDHCP on a router can save your organization the cost of a dedicated DHCPserver. It also provides DHCP locally at each site—regardless of whether theWAN is operational.
But there are some drawbacks. For example, someadministrators might not be too comfortable monitoring and troubleshooting DHCPfrom a router; they may prefer to use Windows DHCP Manager rather than CiscoIOS commands to check the status of client leases, manually terminate a DHCPlease, or assign a static reservation. In addition, some administrators mightprefer implementing a centralized DHCP server in order to have one place tomonitor and troubleshoot DHCP.
Of course, every IT shop is different, with varying skillsets, comfort levels, and budgets. Depending on your organization's needs, CiscoIOS DHCP could be the perfect fit for your network.
Getting started
Let's look at how to configure basic DHCP on an IOS-basedrouter. For this example, we'll start off with the default configuration on aCisco 2611 router running IOS 12.2. (The configuration should be the same—orvery similar—on all IOS-based routers).
To begin, connect the router's Ethernet port to a switch,and connect the switch to a laptop, which will serve as the DHCP client.
To configure Cisco IOS DHCP, follow these steps, whichinclude sample commands:
- Configure an IP address on the router's Ethernet port, and bring up the interface. (On an existing router, you would have already done this.)
Router(config)# interface ethernet0/0 Router(config-if)#ip address 1.1.1.1 255.0.0.0 Router(config-if)# no shutdown
- Create a DHCP IP address pool for the IP addresses you want to use.
Router(config)# ip dhcp pool mypool
- Specify the network and subnet for the addresses you want to use from the pool.
Router(dhcp-config)# network 1.1.1.0 /8
- Specify the DNS domain name for the clients.
Router(dhcp-config)#domain-name mydomain.com
- Specify the primary and secondary DNS servers.
Router(dhcp-config)#dns-server 1.1.1.10 1.1.1.11
- Specify the default router (i.e., default gateway).
Router(dhcp-config)#default-router 1.1.1.1
- Specify the lease duration for the addresses you're using from the pool.
Router(dhcp-config)#lease 7
- Exit Pool Configuration Mode.
Router(dhcp-config)#exit
This takes you back to the global configuration prompt. Next,exclude any addresses in the pool range that you don't want to hand out.
For example, let's say that you've decided that all IP addressesup to .100 will be for static IP devices such as servers and printers. All IPaddresses above .100 will be available in the pool for DHCP clients.
Here's an example of how to exclude IP addresses .100 andbelow:
Router(config)#ip dhcp excluded-address 1.1.1.0 1.1.1.100
Next, enter the ipconfig/renew command on the laptop to receive an IP address. After you have theIP address, enter the ipconfig /allcommand. Listing A shows sampleoutput from this command.
Using DHCP commands
After configuring DHCP on the router, you can use DHCP show commands to see what's going on. Forexample, you can use one of the most common DHCP commands to view which DHCP IPaddresses currently have leases: show ipdhcp bindings.
Listing B showssample output from this command. From this output, you can see that my PCreceived the IP address of 1.1.1.101 (the first address after 100) and its MACaddress.
Keep in mind that DHCP configuration can be very complex onCisco routers. You can configure backup servers, settings to prevent conflicts,secure DHCP, and many other options. For more information, check out Cisco'sConfiguring DHCP documentation.
David Davis has workedin the IT industry for 12 years and holds several certifications, includingCCIE, MCSE+I, CISSP, CCNA, CCDA, and CCNP. He currently manages a group ofsystems/network administrators for a privately owned retail company andperforms networking/systems consulting on a part-time basis.
Tidak ada komentar:
Posting Komentar