Saturday, 4 April 2020

DHCP CONFIGURATION FOR MULTIPLE VLANS | ROUTER AS DHCP SERVER

DHCP CONFIGURATION FOR MULTIPLE VLAN | ROUTER AS DHCP SERVER

!!Configuration of uplink on Switch

Switch>en
Switch#
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int fa0/1
Switch(config-if)#no shut
Switch(config-if)#switchport mode trunk
Swigtch(config-if)#^Z

!!Creating VLANS 10 & 20 making ports as members of same.

Fa0/2 - 3 =====> VLAN 10
Fa0/4 - 5 =====> VLAN 20

Switch(config)#vlan 10
Switch(config-vlan)#name DATA1
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name DATA2
Switch(config-vlan)#^Z

Switch(config)#int range fa0/2 - 3
Switch(config-if-range)#no shut
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int range fa0/4 -5
Switch(config-if-range)#no shut
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 20
Switch(config-if-range)#^Z

!!Making LAN interface of Router UP 

Router>en
Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int gi0/0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

Router(config-if)#^Z

!!Configuration of sub-interfaces on Router required for inter vlan communication 

Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int gi0/0.10
Router(config-subif)#no shut
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 10.0.0.1 255.255.255.0
Router(config-subif)#^Z
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int gi0/0.20
Router(config-subif)#no shut
Router(config-subif)#encapsulation dot1
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 20.0.0.1 255.255.255.0
Router(config-subif)#^Z
Router#
%SYS-5-CONFIG_I: Configured from console by console

!!Configuring Router as DHCP Server for vlan 10 and 20

Router(config)#ip dhcp pool dhcpvlan10
Router(dhcp-config)#network 10.0.0.0 255.255.255.0
Router(dhcp-config)#default-router 10.0.0.1
Router(dhcp-config)#^Z
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip dhcp pool dhcpvlan20
Router(dhcp-config)#network 20.0.0.0 255.255.255.0
Router(dhcp-config)#default-router 20.0.0.1
Router(dhcp-config)#^Z

!!Verification 

Router#sh ip dhcp pool

Pool dhcpvlan10 :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 254
 Leased addresses               : 0
 Excluded addresses             : 0
 Pending event                  : none

 1 subnet is currently in the pool
 Current index        IP address range                    Leased/Excluded/Total
 10.0.0.1             10.0.0.1         - 10.0.0.254        0    / 0     / 254

Pool dhcpvlan20 :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 254
 Leased addresses               : 0
 Excluded addresses             : 0
 Pending event                  : none

 1 subnet is currently in the pool
 Current index        IP address range                    Leased/Excluded/Total
 20.0.0.1             20.0.0.1         - 20.0.0.254        0    / 0     / 254

!! Currently no binding 

Router#sh ip dhcp binding
IP address       Client-ID/              Lease expiration        Type
                 Hardware address
Router#


!!Setting DHCP option of PCs and Verification of IP address 








!!Verification on Router

Router#sh ip dhcp binding
IP address       Client-ID/              Lease expiration        Type
                 Hardware address
10.0.0.2         0030.A303.5C3E           --                     Automatic
10.0.0.3         0050.0FEB.2A1E           --                     Automatic
20.0.0.2         000B.BE18.DA1E           --                     Automatic
20.0.0.3         0090.2B5E.A1DC           --                     Automatic
Router#

!! Verification from PC0 

C:\>ping 10.0.0.3

Pinging 10.0.0.3 with 32 bytes of data:

Reply from 10.0.0.3: bytes=32 time=1ms TTL=128
Reply from 10.0.0.3: bytes=32 time<1ms TTL=128
Reply from 10.0.0.3: bytes=32 time=1ms TTL=128
Reply from 10.0.0.3: bytes=32 time<1ms TTL=128

Ping statistics for 10.0.0.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

C:\>ping 20.0.0.2

Pinging 20.0.0.2 with 32 bytes of data:

Request timed out.
Reply from 20.0.0.2: bytes=32 time<1ms TTL=127
Reply from 20.0.0.2: bytes=32 time<1ms TTL=127
Reply from 20.0.0.2: bytes=32 time<1ms TTL=127

Ping statistics for 20.0.0.2:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\>ping 20.0.0.3

Pinging 20.0.0.3 with 32 bytes of data:

Request timed out.
Reply from 20.0.0.3: bytes=32 time<1ms TTL=127
Reply from 20.0.0.3: bytes=32 time<1ms TTL=127
Reply from 20.0.0.3: bytes=32 time<1ms TTL=127

Ping statistics for 20.0.0.3:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms


3 comments: