Thursday, July 10, 2014

Configure VLAN, DHCP, Trunk Port

Unknown | 5:38 PM



















Description
In this session you will be able to understand about VLAN, Trunk port, Switchport access, sub-interface and also how to configure on it. Please follow me step by step below.

Purpose
I want create 2 DHCP pool and 2 sub-interface on Router0.
I want create 2 VLAN (100 and 200), Trunk port and switchport access on Switch0
I want create switchport access and trunk on Switch1
I want create switchport access and trunk on Switch1

===> Here is what each device will had configure.
+ On Router0
- Have 2 DHCP Pool
- There are 2 Sub-interface
+ On Switch0
- There are 2 VLAN (100 and 200)
- Trunk Port
+ On Switch1
- Ther are Trunk Port
- Switchport access
+ On Switch2
- Ther are Trunk Port
- Switchport access

Please follow me how to configure on each devices.
******************************On Router0****************************************
=====Configure DHCP 2 pool named 192 and 172==============
Router>
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip dhcp pool 192
Router(dhcp-config)#network 192.168.1.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.1.1
Router(dhcp-config)#dns-server 8.8.8.8
Router(dhcp-config)#exit

Router(config)#ip dhcp pool 172
Router(dhcp-config)#network 172.16.1.0 255.255.255.0
Router(dhcp-config)#default-router 172.16.1.1 
Router(dhcp-config)#dns-server 8.8.8.8
Router(dhcp-config)#exit
Router(config)#ip dhcp excluded-address 172.16.1.1 172.16.1.20

=Create 2 Subinterface named 0/0.192 on Gi0/0 and 0/0.172 on Gi0/0=
Router(config)#int gigabitEthernet 0/0.192
Router(config-subif)#encapsulation dot1Q 192
Router(config-subif)#ip address 192.168.1.1 255.255.255.0

Router(config)#int gigabitEthernet 0/0.172
Router(config-subif)#encapsulation dot1Q 172
Router(config-subif)#ip address 172.16.1.1 255.255.255.0

=======No Shutdown int Gi0/0============================
Router(config)#int gigabitEthernet 0/0
Router(config-if)#no sh

******************************On Switch0************************************
===============Configure Trunk on Gi1/1==================
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int gigabitEthernet 1/1
Switch(config-if)#switchport mode trunk 
Switch(config-if)#switchport trunk allowed vlan 1-200


Note: If you was typed command switchpot trunk allowed vlan 1-200 it mean that you allowed only VLAN 1 to 200 can access.

=====Configure VLAN===================================
Switch>en
Switch#conf t
Switch(config)#vlan 192
Switch(config-vlan)#name IT
Switch(config-vlan)#exit
Switch(config)#vlan 172
Switch(config-vlan)#name Finance

======Configure int f0/1-f0/12 access vlan 192==============
Switch>en
Switch#conf t
Switch(config)#int range FastEthernet 0/1 - FAstEthernet 0/12
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 192

======configure int f0/13 - f0/24 access vlan 172============
Switch>en
Switch#conf t
Switch(config)#int range FastEthernet 0/13 - FAstEthernet 0/24
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 172

=======Configure Trunk on port fa0/1======================
Switch>en
Switch#conf t
Switch(config)#int fa0/1
Switch(config-if)#switchport mode trunk

=======Configure Trunk on port fa0/15=====================
Switch>en
Switch#conf t
Switch(config)#int fa0/15
Switch(config-if)#switchport mode trunk

********************************On switch1**********************************

===Configure Trunk on port Gi1/1 and only vlan 172 to 192====
Switch>
Switch>en
Switch#conf t
Switch(config)#int gigabitEthernet 1/1
Switch(config-if)#switchport mode trunk 
Switch(config-if)#switchport trunk allowed vlan 172-192
Switch(config-if)#exit
Switch(config)#

====== Apply all fa0/1 - fa0/12 access vlan 192===========
Switch(config)#int range fastEthernet 0/1 - fastEthernet 0/12
Switch(config-if-range)#switchport mode access 
Switch(config-if-range)#switchport access vlan 192

====== Apply all fa0/13 - fa0/24 access vlan 172==========
Switch(config)#int range fastEthernet 0/13 - fastEthernet 0/24
Switch(config-if-range)#switchport mode access 
Switch(config-if-range)#switchport access vlan 172

****************************On Switch2***********************************
==Configure Trunk on port Gi1/1 and allowed only vlan 172==
Switch>
Switch>en
Switch#conf t
Switch(config)#int gigabitEthernet 1/1
Switch(config-if)#switchport mode trunk 
Switch(config-if)#switchport trunk allowed vlan 172 (If u don't put this command u will allowed all vlan)
Switch(config-if)#exit
Switch(config)#

=======Appy all port can access vlan 172===============
Switch>
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int range fa0/1 - fa0/24
Switch(config-if-range)#switchport mode access 
Switch(config-if-range)#switchport access vlan 172

Share it →

No comments:

Post a Comment

Back to top

networkingandsystem © 2014

Published By Nget Phanny | Designed By IT4444