0% found this document useful (0 votes)
78 views14 pages

Lab 3-Configure VLAN and Inter-Vlan Using DHCP Server

The document outlines the steps to configure inter-VLAN communication using a DHCP server on a switch, creating three VLANs (10, 20, and 30) and assigning DHCP pools to each. It details the configuration of VLANs, trunk ports, DHCP pools, and router interfaces to enable communication between VLANs. Finally, it instructs on verifying that PCs receive their IP configuration from the DHCP server and testing connectivity between them.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views14 pages

Lab 3-Configure VLAN and Inter-Vlan Using DHCP Server

The document outlines the steps to configure inter-VLAN communication using a DHCP server on a switch, creating three VLANs (10, 20, and 30) and assigning DHCP pools to each. It details the configuration of VLANs, trunk ports, DHCP pools, and router interfaces to enable communication between VLANs. Finally, it instructs on verifying that PCs receive their IP configuration from the DHCP server and testing connectivity between them.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Configure Inter-vlan using DHCP Server for

multiple VLANs on the Switch

Configure this lab to meet the following objectives.

 Create three VLANs 10,20 and 30 and add 2 PCs to


each VLAN.
 Configure the DHCP server on the switch and create
three DHCP pools.
 Assign a DHCP pool to each VLAN.
 Configure all PCs as DHCP clients.
 Verify that all PCs receive their IP configuration from
the DHCP server.
 Test connectivity between all PCs.
Step 1: Creating and assigning VLANs
Create 3 VLANs: VLAN 10, VLAN 20, and VLAN 30 and
Assign VLAN 10 to Fa0/1 and Fa0/2, VLAN
20 to Fa0/3 and Fa0/4, and VLAN 30 to Fa0/5 and Fa0/6.

Switch>en
Switch#conf t
Enter configuration commands, one per line. End with
CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name student
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name staff
Switch(config-vlan)#exit
Switch(config)#vlan 30
Switch(config-vlan)#name finance
Switch(config-vlan)#exit
Switch(config)#int range fa0/1-2
Switch(config-if-range)#sw
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#sw
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#exit
Switch(config)#int range fa0/3-4
Switch(config-if-range)#sw
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#sw
Switch(config-if-range)#switchport access vlan 20
Switch(config-if-range)#exit
Switch(config)#int fa0/5-6
^
% Invalid input detected at '^' marker.
Switch(config)#int range fa0/5-6
Switch(config-if-range)#sw
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#sw
Switch(config-if-range)#switchport access vlan 30
Switch(config-if-range)#exit
Switch(config)#do wr
Building configuration...
[OK]
Switch(config)#
Step 2: Configuring trunk port
Switch(config)#int fa0/7
Switch(config-if)#sw
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
Switch(config)#do wr
Building configuration...
[OK]
Switch(config)#

Step 3: Configuring DHCP server and creating


DHCP pools on switch
By default, DHCP service is enabled on all supporting
Cisco switches. To use this service, we have to create and
configure a DHCP pool on the switch.
The following table lists the steps that are required to
create and configure a DHCP pool.
Configuration Description (required command)
step
Define Use the 'ip dhcp excluded-address' command to
reserved IP define the range of reserved IP addresses.
addresses
Create the To create a DHCP pool and enter DHCP pool
DHCP pool configuration mode, use the 'ip dhcp pool [pool
name]' command.
Define IP range use the 'network [network ID] [subnet
for lease mask]' command to define the range of IP
addresses. DHCP uses this range to provide IP
configuration to clients.
Set default To set the default gateway IP address, use
gateway IP the 'default-router [IP address of the default
gateway]' command.
Set DNS server To set the DNS server IP address, use the 'dns-
IP server [IP address of the DNS
server]' command.

Create three DHCP pools by using the above


configuration steps.
Switch(config)#ip dh
Switch(config)#ip dhcp pool vpool10
Switch(dhcp-config)#network 10.0.0.1 255.0.0.0
Switch(dhcp-config)#de
Switch(dhcp-config)#default-router 10.0.0.1
Switch(dhcp-config)#dn
Switch(dhcp-config)#dns-server 4.4.4.4
Switch(dhcp-config)#exit
Switch(config)#ip d
Switch(config)#ip dhc
Switch(config)#ip dhcp pool vpool20
Switch(dhcp-config)#network 20.0.0.0 255.0.0.0
Switch(dhcp-config)#de
Switch(dhcp-config)#default-router 20.0.0.1
Switch(dhcp-config)#dn
Switch(dhcp-config)#dns-server 8.8.8.8
Switch(dhcp-config)#exit
Switch(config)#ip dhcp pool vpool30
Switch(dhcp-config)#network 30.0.0.0 255.0.0.0
Switch(dhcp-config)#de
Switch(dhcp-config)#default-router 30.0.0.1
Switch(dhcp-config)#dn
Switch(dhcp-config)#dns-server 30.0.0.2
Switch(dhcp-config)#exit
Switch(config)#
Step 4: Assigning IP addresses to VLANs
DHCP uses the IP address of a VLAN to determine the
pool from which it should provide an IP configuration. To
assign an IP address to the VLAN, use the following
commands.
Switch(config)#interface vlan [vlan name or number]
Switch(config-if)#ip address [ip address] [subnet mask]
Assign an IP address to each VLAN from the reserved IP
address of the corresponding DHCP pool.

Switch(config)#int vlan 10
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface


Vlan10, changed state to up

Switch(config-if)#ip ad
Switch(config-if)#ip address 10.0.0.5 255.0.0.0
Switch(config-if)#exit
Switch(config)#int valn 20
^
% Invalid input detected at '^' marker.
Switch(config)#int vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface


Vlan20, changed state to up

Switch(config-if)#ip ad
Switch(config-if)#ip address 20.0.0.5 255.0.0.0
Switch(config-if)#exit
Switch(config)#int vlan 30
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface


Vlan30, changed state to up

Switch(config-if)#ip ad
Switch(config-if)#ip address 30.0.0.5 255.0.0.0
Switch(config-if)#exit
Switch(config)#do wr
Building configuration...
[OK]
Switch(config)#
Step 5: Configuring the router's interface
By default, different VLANs cannot communicate with
each other. To allow communication between different
VLANs, we have to connect them through a router. We
don't need a dedicated router interface for each VLAN.
Routers support interface virtualization. We can use a
single router interface to allow communication between
multiple VLANs.
To virtualize the Fa0/0 interface and to configure it to
allow communication between different VLANs, use the
following configuration on the router.

Router>en
Router#conf t
Enter configuration commands, one per line. End with
CNTL/Z.
Router(config)#int gig0/0/0
Router(config-if)#no shut

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

%LINEPROTO-5-UPDOWN: Line protocol on Interface


GigabitEthernet0/0/0, changed state to up

Router(config-if)#exit
Router(config)#int fa0/0.10
%Invalid interface type and number
Router(config)#int gig0/0/0.10
Router(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0.10,
changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface


GigabitEthernet0/0/0.10, changed state to up
Router(config-subif)#en
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip ad
Router(config-subif)#ip address 10.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#int gig0/0/0.20
Router(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0.20,
changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface


GigabitEthernet0/0/0.20, changed state to up

Router(config-subif)#en
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip ad
Router(config-subif)#ip address 20.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#int gi0/0/0.30
Router(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0.30,
changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet0/0/0.30, changed state to up

Router(config-subif)#enc
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 30
Router(config-subif)#ip address 30.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#do wr
Building configuration...
[OK]
Router(config)#

Step 6: Configuring and verifying DHCP clients


To configure a host as the DHCP client, click the host and
click the Desktop menu option and click the IP
configuration option and choose the DHCP option. If the
DHCP server is properly configured, the DHCP client will
receive the IP configuration in a few seconds.

You might also like