Inter Vlan is Used to Communicate Between two or more different Vlans.

Network Devices in different Vlans cannot communicate with one another without help of  Router to route the data between Vlans.

Types of vlan

1. Port based Vlan - Assign Vlan to Ports

2. Network Based Vlan - Assign vlan to Networks

Steps to Configure Inter Vlan:

1. Vlan Database

2. Access Mode

3.Trunk Mode

4. Encapsulation

  Step 1


 Syntax to create a Vlan Database

Switch>enable
Switch#vlan database
Switch(vlan)#vlan <no> name <anyname>
Switch(vlan)#exit

To verify Vlan Database

Switch#show vlan brief

  Step 2


 Syntax to create Access Mode

Switch>enable
Switch#config t
Switch(config)#interface fastEthernet <port no>
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan <no>
Switch(config-if)#exit

To Verify

Switch#show vlan brief

  Step 3


 Syntax to create Trunk Mode

Switch>enable
Switch#config t
Switch(config)#interface fastEthernet <portno>
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#exit

To Verify Trunk:

Switch#show interfaces trunk

  Step 4


 Syntax to Create Encapsulation

Router#enable
Router#config t
Router(config)#interface fastEthernet <port no>
Router(config-if)#no shutdown
Router(config)#interface fastEthernet <port no>.<sub-if no>
Router(config-subif)#encapsulation dot1Q <vlan no>
Router(config-subif)#ip address <gateway ip address> <subnet mask>
Router(config-subif)#exit

<Sub- if no> sub interface number range 1-65535


 Here we configured as Vlan 10 accessing 192.168.10.0 network and Vlan 20 Accessing 192.168.20.0



Creating Vlan

For Creating VLan we need a Switch and PC

PC1 --- ip 192.168.10.2   255.255.255.0 gw: 192.168.10.1

Pc2 --- ip 192.168.10.3   255.255.255.0 gw: 192.168.10.1

Pc3 --- ip 192.168.20.2   255.255.255.0 gw: 192.168.20.1

Pc4 --- ip 192.168.20.3   255.255.255.0 gw: 192.168.20.1

gw : Default Gateway

Switch --- Cisco Catalyst 2950

Router --- Cisco 2503

cables used Twisted Pair Straight-trough to connect between Switch to PC and Switch to Router

Switch Configuration

Creating Vlan Database

Switch>en
Switch#vlan database
Switch(vlan)#vlan 10 name cisco
Switch(vlan)#vlan 20 name ms
Switch(vlan)#exit
Switch#show vlan brief

VLAN Name                                   Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                                        active   Fa0/1, Fa0/2, Fa0/3, Fa0/4,
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24

10   cisco                                        active
20   ms                                           active
1002 fddi-default                         active
1003 token-ring-default             active
1004 fddinet-default                   active
1005 trnet-default                       active

Accessing Ports to VLAN

Switch#config t
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10

Switch(config-if)#interface fastEthernet 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10

Switch(config-if)#interface fastEthernet 0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20

Switch(config-if)#interface fastEthernet 0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#^Z
Switch#show vlan brief

VLAN Name                                    Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                                        active    Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24

10   cisco                                           active    Fa0/1, Fa0/2
20   ms                                              active    Fa0/3, Fa0/4
1002 fddi-default                            active
1003 token-ring-default                active
1004 fddinet-default                      active
1005 trnet-default                           active

Trunk Between Network Devices

Switch>en
Switch#config t
Switch(config)#interface fastEthernet 0/5
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all

To verify trunk

Switch#show interfaces trunk

Port        Mode         Encapsulation  Status        Native vlan
Fa0/5       on            802.1q                 trunking    1

Port        Vlans allowed on trunk
Fa0/5       1-1005

Port        Vlans allowed and active in management domain
Fa0/5       1

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/5       1

Encapsulation (Router)

Router>en
Router#config t
Router(config)#interface fastEthernet 0/0
Router(config-if)#no shutdown
Router(config-if)#interface fastEthernet 0/0.1
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 192.168.10.1 255.255.255.0
Router(config-subif)#exit
Router(config)#interface fastEthernet 0/0.2
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 192.168.20.1 255.255.255.0
Router(config-subif)#exit

Router#show running-config

Building configuration...

Current configuration : 783 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
.
.
.
.

interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0

Result:

All pcs Commuicate with each other.....

 

0 comments:

Post a Comment

 
Top