Managing VLANs & DHCP Server

In the following topics, we will build a network with three VLANs with its DHCP Server configurations. Let's first configure the core switch.

Step1: Configuration of Core Switch

Here in the core switch we will configure the VLAN database and DHCP Server which will serve as the source of the IP Address for the client PCs.


1) Creating VLANs

Core-Switch#conf t

Core-Switch(config)#vlan 2

Core-Switch(config-vlan)#name ACCT

Core-Switch(config-vlan)#exit

Core-Switch(config)#vlan 3

Core-Switch(config-vlan)#name HR

Core-Switch(config-vlan)#exit

Core-Switch(config)#vlan 4

Core-Switch(config-vlan)#name IT

Core-Switch(config-vlan)#exit


2) Assign Management IP on each VLANs

Core-Switch#conf t

Core-Switch(config)#int vlan 2

Core-Switch(config-if)#ip address 192.168.2.1 255.255.255.0

Core-Switch(config-if)#exit

Core-Switch(config)#int vlan 3

Core-Switch(config-if)#ip address 192.168.3.1 255.255.255.0

Core-Switch(config-if)#exit

Core-Switch(config)#int vlan 4

Core-Switch(config-if)#ip address 192.168.4.1 255.255.255.0

Core-Switch(config-if)#exit

Core-Switch(config)#


3) Create DHCP Excluded-Address

The purpose of creating the DHCP excluded-address is to spare of at least 20 IP address which will be use for static IP configuration for some devices or server that will require the dedicated IP settings.

Core-Switch#conf t

Core-Switch(config)#ip dhcp excluded-address 192.168.2.1 192.168.2.20

Core-Switch(config)#ip dhcp excluded-address 192.168.3.1 192.168.3.20

Core-Switch(config)#ip dhcp excluded-address 192.168.4.1 192.168.4.20


4) Create DHCP Server for each VLAN

Now we will configure the DHCP Server, which will be use for dynamic IP deployment on client PC or devices.

Note: the dns-server 8.8.8.8 is global DNS address and you could change with your actual DNS address provided by your internet service provider.


Core-Switch#conf t

Core-Switch(config)#ip dhcp pool VLAN2-ACCT

Core-Switch(dhcp-config)#network 192.168.2.0 255.255.255.0

Core-Switch(dhcp-config)#default-router 192.168.2.1

Core-Switch(dhcp-config)#dns-server 8.8.8.8


Core-Switch(config)#ip dhcp pool VLAN3-HR

Core-Switch(dhcp-config)#network 192.168.3.0 255.255.255.0

Core-Switch(dhcp-config)#default-router 192.168.3.1

Core-Switch(dhcp-config)#dns-server 8.8.8.8


Core-Switch(config)#ip dhcp pool VLAN4-IT

Core-Switch(dhcp-config)#network 192.168.4.0 255.255.255.0

Core-Switch(dhcp-config)#default-router 192.168.4.1

Core-Switch(dhcp-config)#dns-server 8.8.8.8


5) Configure switchport for vlan access

In this LAB we only have three (3) access switches, so I will just configure three (3) switchports for vlan access.

Core-Switch#conf t

Core-Switch(config)#int fa0/1

Core-Switch(config-if)#switchport access vlan 2

Core-Switch(config-if)#switchport mode access


Core-Switch(config)#int fa0/2

Core-Switch(config-if)#switchport access vlan 3

Core-Switch(config-if)#switchport mode access


Core-Switch(config)#int fa0/3

Core-Switch(config-if)#switchport access vlan 4

Core-Switch(config-if)#switchport mode access


Note: You can configure other switchport and you can add other VLANs for future expansions. We are done configuring the core switch, we will now proceed to configure the access switches.


Step 2: Access Switches Configuration

Let's begin on the first switch which is label as switch0, this switch will be connected to VLAN 2 so that we are going to configure this switch with VLAN 2 segment, switch1 for VLAN 3 segment, and switch2 for VLAN 4 segement


Core-Switch#conf t

Core-Switch(config)#vlan 2

Core-Switch(config-vlan)#exit

Core-Switch(config)#int vlan 2

Core-Switch(config-if)#ip address 192.168.2.2 255.255.255.0

Core-Switch(config-if)#exit


Core-Switch(config)#int fa0/1

Core-Switch(config-if)#switchport access vlan 2

Core-Switch(config-if)#switchport mode access

Core-Switch(config-if)#exit


Core-Switch(config)#int fa0/2

Core-Switch(config-if)#switchport access vlan 2

Core-Switch(config-if)#switchport mode access


Core-Switch(config)#int fa0/24

Core-Switch(config-if)#switchport access vlan 2

Core-Switch(config-if)#switchport mode access


Note: The switchport 1 and 2 is connected to client PC and the switchport 24 is the uplink connection to core switch. Let's do the same configuration to switch number 1 that will be connected to VLAN 3 segement.


Core-Switch#conf t

Core-Switch(config)#vlan 3

Core-Switch(config-vlan)#exit

Core-Switch(config)#int vlan 3

Core-Switch(config-if)#ip address 192.168.3.2 255.255.255.0

Core-Switch(config-if)#exit


Core-Switch(config)#int fa0/1

Core-Switch(config-if)#switchport access vlan 3

Core-Switch(config-if)#switchport mode access

Core-Switch(config-if)#exit


Core-Switch(config)#int fa0/2

Core-Switch(config-if)#switchport access vlan 3

Core-Switch(config-if)#switchport mode access


Core-Switch(config)#int fa0/24

Core-Switch(config-if)#switchport access vlan 3

Core-Switch(config-if)#switchport mode access


We're done with switch1 let's proceed with switch2 to be connected for VLAN 4 segment


Core-Switch#conf t

Core-Switch(config)#vlan 4

Core-Switch(config-vlan)#exit

Core-Switch(config)#int vlan 4

Core-Switch(config-if)#ip address 192.168.4.2 255.255.255.0

Core-Switch(config-if)#exit


Core-Switch(config)#int fa0/1

Core-Switch(config-if)#switchport access vlan 4

Core-Switch(config-if)#switchport mode access

Core-Switch(config-if)#exit


Core-Switch(config)#int fa0/2

Core-Switch(config-if)#switchport access vlan 4

Core-Switch(config-if)#switchport mode access


Core-Switch(config)#int fa0/24

Core-Switch(config-if)#switchport access vlan 4

Core-Switch(config-if)#switchport mode access


Step 3: Client PC configuration and testing the connectivity

This is the last part in our network implementation and after this LAB test you may now proceed to the live implementation on your network infrastructure.


on client PC set the network interface to DHCP and IP address will automatically obtained an IP address from you desire vlan segment connectivity, upon obtaining and IP address you can ping random IP's to ensure your proper configuration. - Watch the demo simulation.

1 Comments

Post a Comment

Previous Post Next Post