How to use a vro to connect different VLANs of a single-layer switch
Some simple configurations of the experiment
First configure PC
PC1 IP: 192.168.1.1 subnet mask: 255.255.255.0 Gateway: 192.168.1.254
PC2 IP: 192.168.1.2 subnet mask: 255.255.255.0 Gateway: 192.168.1.254
PC3 IP: 192.168.2.1 subnet mask: 255.255.255.0 Gateway: 192.168.2.254
PC4 IP: 192.168.2.2 subnet mask: 255.255.255.0 Gateway: 192.168.2.254
PC1 and switch SW1 ports f0/1 PC2 and switch SW1 ports f0/2 PC3 and switch SW2 ports f0/1 PC4 and switch ports f0/2
Switch SW1 and switch SW2 ports f0/3
Vro port g0/0 and vswitch SW1 port f0/4 vrog0 port g0/1 and vswitch port f0/4
Note (the red font is the key command)
Enter switch SW1
Switch> enable // Switch Mode
Switch # configureterminal
Enterconfigurationcommands, oneperline. EndwithCNTL/Z.
Switch (config) # hostnameSW1 // modify the Host Name
SW1 (config) # vlan10 // create a virtual LAN
SW1 (config-vlan) # vlan20
SW1 (config-vlan) # exit // exit
SW1 (config) # interfacefastEthernet0/1 // enter port f0/1
SW1 (config-if) # switchportmodeaccess // switch the port Mode
SW1 (config-if) # switchportaccessvlan10 // Add port f0/1 to vlan 10
SW1 (config-if) # exit
SW1 (config) # interfacefastEthernet0/2
SW1 (config-if) # switchportmodeaccess
SW1 (config-if) # switchportaccessvlan20
SW1 (config-if) # exit
SW1 (config) # interfacefastEthernet0/4
SW1 (config-if) # switchportmodeaccess
SW1 (config-if) # switchportaccessvlan20
SW1 (config-if) # exit
SW1 (config) # interfacefastEthernet0/3
SW1 (config-if) # switchportmodetrunk // trunk in Port f0/3 mode
SW1 (config-if )#
% LINEPROTO-5-UPDOWN: LineprotocolonInterfaceFastEthernet0/3, changedstatetodown.
% LINEPROTO-5-UPDOWN: LineprotocolonInterfaceFastEthernet0/3, changedstatetoup
SW1 (config-if) # exit
SW1 (config) # exit
SW1 # showvlan // view vlan
VLANNameStatusPorts
----------------------------------------------------------------------------
1defaactiveactivefa0/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
Gig0/1, Gig0/2
10VLAN0010activeFa0/1, Fa0/4
20VLAN0020activeFa0/2
1002fddi-defaact Act/unsup
1003token-ring-defaultact/unsup
1004fddinet-defaultact/unsup
1005trnet-defaultact/unsup
VLANTypeSAIDMTUParentRingNoBridgeNoStpBrdgModeTrans1Trans2
--------------------------------------------------------------------
1enet000011500 ----- 00
10enet1000101500 ----- 00
20enet1000201500 ----- 00
1002fddi1010021500 ----- 00
1003tr1010031500 ----- 00
1004fdnet1010041500 --- ieee-00
1005trnet1010051500 --- ibm-00
RemoteSPANVLANs
------------------------------------------------------------------------------
PrimarySecondaryTypePorts
---------------------------------------------------------------------------
Configure switch SW2
Switch>
Switch> enable
Switch # configureterminal
Enterconfigurationcommands, oneperline. EndwithCNTL/Z.
Switch (config) # hostname
Switch (config) # hostnameSW2
SW2 (config) # vlan10
SW2 (config-vlan) # vlan20
SW2 (config-vlan) # exit
SW2 (config) # interfacefastethernet0/1
SW2 (config-if) # switchportmodeaccess
SW2 (config-if) # switchportaccessvlan10
SW2 (config-if) # exit
SW2 (config) # interfacefastethernet0/4
SW2 (config-if) # switchportmodeaccess
SW2 (config-if) # switchportaccessvlan10
SW2 (config-if) # exit
SW2 (config) # interfacefastethernet0/2
SW2 (config-if) # switchportmodeaccess
SW2 (config-if) # switchportaccessvlan20
SW2 (config-if) # exit
SW2 (config) # exit
SW2 #
% SYS-5-CONFIG_ I: Configuredfromconsolebyconsole
SW2 # showinterfacestrunk // view the port trunk
PortModeEncapsulationStatusNativevlan
Fa0/3auton-802.1qtrunking1
PortVlansallowedontrunk
Fa0/31-1005
PortVlansallowedandactiveinmanagementdomain
Fa0/31,10, 20
PortVlansinspanningtreeforwardingstateandnotpruned
Fa0/31,10, 20
SW2 #
SW2 # configureterminal
Enterconfigurationcommands, oneperline. EndwithCNTL/Z.
SW2 (config) # exit
SW2 #
% SYS-5-CONFIG_ I: Configuredfromconsolebyconsole
SW2 # showvlan
VLANNameStatusPorts
----------------------------------------------------------------------------
1defaactiveactivefa0/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
Gig0/1, Gig0/2
10VLAN0010activeFa0/1, Fa0/4
20VLAN0020activeFa0/2
1002fddi-defaact Act/unsup
1003token-ring-defaultact/unsup
1004fddinet-defaultact/unsup
1005trnet-defaultact/unsup
VLANTypeSAIDMTUParentRingNoBridgeNoStpBrdgModeTrans1Trans2
--------------------------------------------------------------------
1enet000011500 ----- 00
10enet1000101500 ----- 00
20enet1000201500 ----- 00
1002fddi1010021500 ----- 00
1003tr1010031500 ----- 00
1004fdnet1010041500 --- ieee-00
1005trnet1010051500 --- ibm-00
RemoteSPANVLANs
------------------------------------------------------------------------------
PrimarySecondaryTypePorts
---------------------------------------------------------------------------
SW2 #
Configure the router
Router> enable
Router # configureterminal
Enterconfigurationcommands, oneperline. EndwithCNTL/Z.
Router (config) # interfaceg0/0
Router (config-if) # ipaddress192.168.2.2520.5.255.255.0 // configure the gateway (consistent with the gateway of the PC)
Router (config-if) # noshutdown // open the port
Router (config-if )#
% LINK-5-CHANGED: InterfaceGigabitEthernet0/0, changedstatetoup
% LINEPROTO-5-UPDOWN: LineprotocolonInterfaceGigabitEthernet0/0, changedstatetoup
Router (config-if) # exit
Router (config) # interfaceg0/1
Router (config-if) # ipaddress192.168.1.2520.5.255.255.0
Router (config-if) # noshutdown
Router (config-if )#
% LINK-5-CHANGED: InterfaceGigabitEthernet0/1, changedstatetoup
% LINEPROTO-5-UPDOWN: LineprotocolonInterfaceGigabitEthernet0/1, changedstatetoup
Router (config-if) # exit
Router (config) # exit
Router #
% SYS-5-CONFIG_ I: Configuredfromconsolebyconsole
Router # showiproute // view the route table
Codes: L-local, C-connected, S-static, R-RIP, M-mobile, B-BGP
D-EIGRP, EX-EIGRPexternal, O-OSPF, IA-OSPFinterarea
N1-OSPFNSSAexternaltype1, N2-OSPFNSSAexternaltype2
E1-OSPFexternaltype1, E2-OSPFexternaltype2, E-EGP
I-IS, L1-IS-ISlevel-1, L2-IS-ISlevel-2, ia-IS-ISinterarea
*-Candidatedefault, U-per-userstaticroute, o-ODR
P-periodicdownloadedstaticroute
Gatewayoflastresortisnotset
192.168.1.0/24 isvariablysubnetted, 2 subnets, 2 masks
C192.168.1.0/24 isdirectlyconnected, GigabitEthernet0/1
L192.168.1.254/32 isdirectlyconnected, GigabitEthernet0/1
192.168.2.0/24 isvariablysubnetted, 2 subnets, 2 masks
C192.168.2.0/24 isdirectlyconnected, GigabitEthernet0/0
L192.168.2.254/32 isdirectlyconnected, GigabitEthernet0/0
Router #
Lab results
PacketTracerPCCommandLine1.0
PC> ping192.168.1.2
Pinging192.168.1.2with32bytesofdata:
Replyfrom192.168.1.2: bytes = 32 time = 2 msTTL = 128
Replyfrom192.168.1.2: bytes = 32 time = 0 msTTL = 128
Replyfrom192.168.1.2: bytes = 32 time = 0 msTTL = 128
Replyfrom192.168.1.2: bytes = 32 time = 0 msTTL = 128
Pingstatisticsfor192.168.1.2:
Packets: Sent = 4, stored ED = 4, Lost = 0 (0% loss ),
Approximateroundtriptimesinmilli-seconds:
Minimum = 0 ms, Maximum = 2 ms, Average = 0 ms
PC> ping192.168.2.1
Pinging192.168.2.1with32bytesofdata:
Requesttimedout.
Replyfrom192.168.2.1: bytes = 32 time = 0 msTTL = 127
Replyfrom192.168.2.1: bytes = 32 time = 1 msTTL = 127
Replyfrom192.168.2.1: bytes = 32 time = 0 msTTL = 127
Pingstatisticsfor192.168.2.1:
Packets: Sent = 4, stored ED = 3, Lost = 1 (25% loss ),
Approximateroundtriptimesinmilli-seconds:
Minimum = 0 ms, Maximum = 1 ms, Average = 0 ms
PC> ping192.168.2.2
Pinging192.168.2.2with32bytesofdata:
Requesttimedout.
Replyfrom192.168.2.2: bytes = 32 time = 0 msTTL = 127
Replyfrom192.168.2.2: bytes = 32 time = 0 msTTL = 127
Replyfrom192.168.2.2: bytes = 32 time = 0 msTTL = 127
Pingstatisticsfor192.168.2.2:
Packets: Sent = 4, stored ED = 3, Lost = 1 (25% loss ),
Approximateroundtriptimesinmilli-seconds:
Minimum = 0 ms, Maximum = 0 ms, Average = 0 ms