DHCP - Dynamic Host Configuration Protocol

DHCP (Dynamic Host Configuration Protocol)

DHCP (Dynamic Host Configuration Protocol) is a process in which devices connected with network receives the ip address form the server configured with DHCP Protocol. DHCP also provides the additional settings to the devices such as subnetmask and default gateway related to that ip addressIP Address assigned by DHCP is valid for specific time which is 1 Day or 24 Hours.
To configure DHCP Server administrator have to create a pool in which network ip is defined from which ip addresses are assigned to the network devices.

What is Dynamic IP Address which is assigned by DHCP?

Dynamic IP Address is an IP address which is assigned dynamicaly to end device from ISP. Each time when end device or router is reboted, ISP assign IP Address dynamicaly to the networking device using DHCP Protocol. As ISP assign dynamic IP Address to end device or router on reboot, this is not compulsory that the IP Address which is assigned by ISP is same as the previous IP Address. Some ISP’s changes the IP Address after some time even if end device or router is connected with ISP contniously, but this process is very rare.

What are the advantages and disadvantages of Dynamic IP Address assigned by DHCP?

Advantages

  • Dynamic IP Address is cheaper than Static IP Address
  • When IP Address changes frequently after some time it provides privacy to the end device or router

Disadvantages

  • To assign dynamic IP Address to end device or router DHCP server is required
  • IP Address assigned dynamicaly changes each time and device have to request for new IP Address


How PC Get IP?

When PC powers on then it sends a request to the server to get ip address. Server checks the pool of network and search the valid available ip address in its pool and hold that ip address for that device till that device is active. When device breaks its connection with server the ip address which is assigned to that device get back to the pool and ready to assign again to another device or same device if it again requests for ip address.

Configurations

Router

Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(Config)#enable secret cisco
R1(Config)#line console 0
R1(Config-line)#password cisco
R1(Config-line)#login
R1(Config-line)#exit
R1(Config)#username R1 secret cisco
R1(Config)#ip domain-name cisco.com
R1(Config)#crypto key genrate rsa
(Set key between 360 - 2048)
R1(Config)#line vty 0 4
R1(Config-line)#transport input ssh
R1(Config-line)#login local
R1(Config-line)#exit
R1(Config)#interface gigabitethernet 0/0
R1(Config-if)#ip address 192.168.1.1 255.255.255.0
R1(Config-if)#no shutdown
R1(Config-if)#exit
R1(Config)#ip dhcp excluded-address 192.168.1.1 192.168.1.5
R1(config)#ip dhcp pool Cisco
R1(dhcp-config)#network 192.168.1.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.1.1
R1(dhcp-config)#dns-server 10.10.10.10
R1(dhcp-config)#exit
R1(Config)#exit
R1#wr

Switch

Switch>enable
Switch#configure terminal
Switch(config)#hostname S1
S1(Config)#enable secret cisco
S1(Config)#line console 0
S1(Config-line)#password cisco
S1(Config-line)#login
S1(Config-line)#exit
S1(Config)#username S1 secret cisco
S1(Config)#ip domain-name cisco.com
S1(Config)#crypto key genrate rsa
(Set key between 360 - 2048)
S1(Config)#line vty 0 15
S1(Config-line)#transport input ssh
S1(Config-line)#login local
S1(Config-line)#exit
S1(Config)#interface vlan 1
S1(Config-if)#ip address 192.168.1.2 255.255.255.0
S1(Config-if)#no shutdown
S1(Config-if)#exit
S1(Config)#exit
S1#wr

Configure PC to get ip from dhcp server

Step 1: Click on PC
Step 2: Go to Desktop Tab
Step 3: Slect IP Configuration option
Step 4: Choose DHCP

No comments:

Post a Comment