1. Home page
  2. Nerwork.

Configuring Cisco Router as a DHCP Server

This article will provide information on how to configure DHCP on the Cisco Router.


0

Cisco IP DHCP Pool is a network setting that helps in automatically distributing the IP addresses required to establish connections to computers on the network. This process also assists in maintaining the clients’ IP addresses for a specified duration. To distribute multiple IP addresses simultaneously, it is necessary to enable the DHCP server on the Router. If there is no Microsoft DHCP Server distributing IPs in our setup, we can configure the #Cisco Switch Router according to our IP address range to perform the distribution.

Cisco Router DHCP Server Configuration

Based on our example scenario in the image below, we have three clients connected to the Cisco Switch Router device. By configuring the Cisco Router with the Cisco Router DHCP Pool feature, we will enable these clients to automatically obtain IP addresses from the specified IP pool.

The IP address of the Cisco Router is 172.21.1.2, and the Subnet Mask is 255.255.255.0. First, let’s configure our Cisco Router1 device and assign it an IP address.

  • Router>enable
  • Router#conf terminal
  • Router(config)#hostname R1 (I am assigning a name to the router, it’s optional!)
  • R1(config)#interface gigabitEthernet 0/0/0 (I am entering the interface. I’m using Gig0/0/0 port, so I write this value)
  • R1(config-if)#ip address 172.21.1.2 255.255.255.0 (I am setting the IP address and subnet mask for the Cisco Router)
  • R1(config-if)#no sh (I am activating the port)
thumbnail
Önerilen Yazı
How to Configure Cisco Router for RIPv2?

The Cisco Router’s IP configuration is complete. Now, according to our setup, we can configure it to distribute IP addresses from the specified DHCP pool. By defining the following commands on the Cisco Router1 device, we can create an IP pool.

  • R1#enable
  • R1#configure terminal
  • R1(config)#ip dhcp pool IPPOOL (Command to name your DHCP service. You can give any name you want.)
  • R1(dhcp-config)#network 172.21.1.0 255.255.255.0
  • R1(dhcp-config)#default-router 172.21.1.2 (Command to enter the default gateway. Enter the IP address that the router provided)
  • R1(dhcp-config)#dns-server 8.8.8.8 (Command to enter the DNS. If you have another DNS server in your network, enter that. I’m using Google DNS)
  • R1(dhcp-config)#lease 14 (Command to set the IP address lease time. You can enter the desired lease time)
  • R1(dhcp-config)#end
  • R1#write

The system is ready. Let’s say you want to reserve some of the allocated IP addresses for devices in the server room such as Servers, Firewalls, etc., rather than giving them to user computers. If you want to exclude an IP block range from the DHCP pool, you should enter the following commands on your Router device:

  • R1>enable
  • R1#configure terminal
  • R1(config)#ip dhcp excluded-address 172.21.1.2 172.21.1.10 (Command to exclude a specific IP range from the pool. I don’t want the IPs 172.21.1.2 and 172.21.1.10 to be distributed, so I wrote it this way.)
  • R1(config)#end (End command)
  • R1#write (Write command)

This concludes our IP distribution on the Cisco device. If you set the computers to obtain IP addresses automatically, they will start receiving IP addresses one after another. To check, you can enter the command “R1>sh ip dhcp binding” on the Cisco Router. It will list the IP addresses obtained by the clients. You can also check for IP conflicts by typing the command “R1>sh ip dhcp conflict.”

Yazıya Tepkin Ne Olur?
  • 0
    be_endim
    Beğendim
  • 0
    alk_
    Alkış!
  • 0
    sevmedim
    Sevmedim
  • 0
    k_zd_m
    Kızdım
  • 0
    _a_k_n_
    Şaşkın!
  • 0
    _z_ld_m
    Üzüldüm

Bültenimize Katılın!

Ücretsiz üye olun ve yeni yayınlardan haberdar olan ilk kişi olun.

Your email address will not be published. Required fields are marked *