Sunday, February 20, 2011

Configure Cisco Router toWork With Cable Interner 3

Setting Cisco Router as DHCP Server

This option really is optional if you want to set Cisco router to work with cable internet, but this is a good chance to add your skill in configuring Cisco devices.

From the previous post, you know how to configure your router's interface to accept IP address from DHCP server.
Now it's time to configure your router as DHCP server.

Once again you need to make sure your Router IOS image support the DHCP server feature if not then the command won't be available.
To set a DHCP server, you will configure a pool of network IP addresses that you want to give out to the clients (PC, printer, NAS, etc).
As shown on the image in the previous post, I want to give out the IP addresses from the network
First thing you need to configure is to exclude the IP addresses that you dont want to give out.
For example, I've configured the router interface 0/1 to be, then I need to exclude so the router won't give out this address.
You can configure the exclusion in the router's global configuration mode:
router> enable
router# configure terminal
router (config)# ip dhcp excluded-address

This command is very useful especially if you need to exclude a range of IP addresses, if you need to exclude say until you can do it like this:

router (config)# ip dhcp excluded-address

After the ip dhcp excluded-address we give the low IP address and the high IP address, this way your router not give IP addresses from to, the router will start giving out address from and so on.

Next thing to do is creating a pool of addresses, when issuing the ip dhcp pool, you'll be taken to the dhcp configuration mode where you can set the additional parameters beside the ip address and subnet mask to the clients.
In this example I want to make a pool with the name of HOME_CLIENTS

router> enable
router# configure terminal
router (config)# ip dhcp pool HOME_CLIENTS
router (dhcp-config)# network
router (dhcp-config)# default-router
router (dhcp-config)# import all

At the third line above you can see the configuration command of a pool with the name HOME_CLIENTS.
Fourth line shows that the pool HOME_CLIENTS will give out the addresses in the network, with the exception of the addresses in the ip dhcp excluded-address that I showed you previously.
Fifth line tells the clients should be given a default gateway address of (the router's IP address).
The sixth line is the one important thing for configuring DHCP server in cable internet environment.
The import all command tells the router to give out other configuration received from the ISP cable internet DHCP server to the clients in the LAN.
For example, most ISP will give the DNS servers IP addresses from their DHCP server and this configuration might change depends on the ISP, so you definitely want to give this configuration out to the clients.
If you have your own DNS server in the LAN, you can tell the clients to use this DNS server using the following command:
router (dhcp-config)# dns-server

The above command will send out DNS server address of and to the clients.
You can also configure the router to use the above DNS server using the following command in the global configuration mode:
router (config)# ip name-server
You can get more information on Cisco IOS DHCP and DNS commands in the cisco site, please click here to go there.

No comments:

Post a Comment