Wednesday 10 July 2024

How to configure the DHCP server on a Cisco ASA device?

How to configure the DHCP server on a Cisco ASA device?  



DHCP (Dynamic Host Configuration Protocol) servers provide all the basic information the client wants to operate on the network, including DNS address, Default Gateway, IP addresses, and subnet. masks and many more.

In this blog, we configure the Cisco ASA firewall to act as a DHCP (Dynamic Host Configuration Protocol) server. DHCP simplifies the process of IP address assignment in your network. In this scenario, we’ll set up the ASA to provide IP addresses to internal LANs using different DHCP scopes.

let's see the configuration: 

Topology:-




  • configure the topology as per the diagram 
  • configure the IP addresses on ASA and configure security
  • configure DHCP server on ASA 
  • verify the configuration with show commands and ping. 










ciscoasa(config)# interface gigabitEthernet 0
ciscoasa(config-if)# ip address 192.168.1.1 255.255.255.0
ciscoasa(config-if)# security 100
ciscoasa(config-if)# nameif inside
ciscoasa(config-if)# no shutdown
ciscoasa(config-if)# exit

ciscoasa(config)# dhcpd address 192.168.1.2-192.168.1.240 inside
ciscoasa(config)# dhcpd dns 8.8.8.8
ciscoasa(config)# dhcpd domain internetworks
ciscoasa(config)# dhcpd option 3 ip 192.168.1.1
ciscoasa(config)# dhcpd lease 3000
ciscoasa(config)# dhcpd enable inside
ciscoasa(config)# exit

ciscoasa# show dhcpd binding

IP address       Client Identifier        Lease expiration        Type

    192.168.1.2    0100.5079.6668.00            2399 seconds    Automatic
    192.168.1.3    0100.5079.6668.01            2941 seconds    Automatic
    192.168.1.4    0100.5079.6668.02            2949 seconds    Automatic
    192.168.1.5    0100.5079.6668.03            2956 seconds    Automatic
    192.168.1.6    0100.5079.6668.04            2963 seconds    Automatic
    192.168.1.7    0100.5079.6668.05            2970 seconds    Automatic
    192.168.1.8    0100.5079.6668.06            2977 seconds    Automatic


ciscoasa# show dhcpd statistics
DHCP UDP Unreachable Errors: 0
DHCP Other UDP Errors: 0

Address pools        1
Automatic bindings   7
Expired bindings     0
Malformed messages   0

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         7
DHCPREQUEST          14
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           0

Message              Sent
BOOTREPLY            0
DHCPOFFER            7
DHCPACK              14
DHCPNAK              0

ciscoasa# show dhcpd state
Context  Configured as DHCP Server
Interface inside, Configured for DHCP SERVER



PC2> ip dhcp
DORA IP 192.168.1.3/24 GW 192.168.1.1

PC2> show ip

NAME        : PC2[1]
IP/MASK     : 192.168.1.3/24
GATEWAY     : 192.168.1.1
DNS         : 8.8.8.8
DHCP SERVER : 192.168.1.1
DHCP LEASE  : 2565, 3000/1500/2625
DOMAIN NAME : internetworks
MAC         : 00:50:79:66:68:01
LPORT       : 10017
RHOST:PORT  : 127.0.0.1:10018
MTU:        : 1500


No comments:

What is layer 3 etherchannel? How to configure layer 3 etherchannel?

EtherChannel technology allows us to bundle multiple physical links into one logical link. It is used to increase the bandwidth and provide ...