Packet Tracer Simulation Lab Layer 2 Switching
-
Upload
johnson-liu -
Category
Technology
-
view
5.759 -
download
3
description
Transcript of Packet Tracer Simulation Lab Layer 2 Switching
Johnson Liu
CCIE#11440(R&S, SP)
CCSI#31346
Packet Tracer Simulation Lab L2 Switching
Agenda Slide
• Power on a new switch
• Assign a port as an specific VLAN membership
• Setup hosts in the same VLAN
• Power on another new switch
• Assign a port as an trunk interface to pass-through different VLAN traffic over a single link
• Enable a Inter-VLAN routing to route traffic between different VLANs
3/6/2013 Confidential | Copyright 2012 Trend Micro Inc.
Power on a new switch
Power on a new Switch
3/6/2013 4 Confidential | Copyright 2012 Trend Micro Inc.
Power on a new Switch
3/6/2013 5 Confidential | Copyright 2012 Trend Micro Inc.
Power on a new Switch
3/6/2013 6 Confidential | Copyright 2012 Trend Micro Inc.
Switch basic configuration
3/6/2013 7 Confidential | Copyright 2012 Trend Micro Inc.
Switch>enable
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW1
SW1(config)#interface vlan 1
SW1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Vlan1, changed state to up
SW1(config-if)#ip address 10.100.1.253 255.255.255.0
SW1(config-if)#exit
SW1(config)#ip default-gateway 10.100.1.254
SW1(config)#exit
SW1#
%SYS-5-CONFIG_I: Configured from console by console
SW1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Check switch basic configuration
3/6/2013 8 Confidential | Copyright 2012 Trend Micro Inc.
SW1#sh ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 unassigned YES manual down down
FastEthernet0/2 unassigned YES manual down down
FastEthernet0/3 unassigned YES manual down down
FastEthernet0/4 unassigned YES manual down down
…
FastEthernet0/20 unassigned YES manual down down
FastEthernet0/21 unassigned YES manual down down
FastEthernet0/22 unassigned YES manual down down
FastEthernet0/23 unassigned YES manual down down
FastEthernet0/24 unassigned YES manual down down
Vlan1 10.100.1.253 YES manual up down
SW1#
Check switch basic configuration
3/6/2013 9 Confidential | Copyright 2012 Trend Micro Inc.
SW1#sh vlan
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
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
Remote SPAN VLANs
------------------------------------------------------------------------------
Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
Check switch basic configuration
3/6/2013 10 Confidential | Copyright 2012 Trend Micro Inc.
SW1#sh run
Building configuration…
Current configuration : 1091 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW1
!
interface FastEthernet0/1
!
interface FastEthernet0/2
…
interface Vlan1
ip address 10.100.1.253 255.255.255.0
!
ip default-gateway 10.100.1.254
!
…
SW1#
Assign a port as an specific VLAN membership
Assign a port as an specific VLAN membership
3/6/2013 12 Confidential | Copyright 2012 Trend Micro Inc.
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#int f0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 2
SW1(config-if)#^Z
SW1#
%SYS-5-CONFIG_I: Configured from console by console
SW1#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active 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
2 VLAN0002 active Fa0/1
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
Assign a port as an specific VLAN membership
3/6/2013 13 Confidential | Copyright 2012 Trend Micro Inc.
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#int f0/2
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 2
SW1(config-if)#exit
SW1(config)#exit
SW1#
%SYS-5-CONFIG_I: Configured from console by console
SW1#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active 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
2 VLAN0002 active Fa0/1, Fa0/2
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
Setup hosts in the same VLAN
Setup hosts in the same VLAN
3/6/2013 15 Confidential | Copyright 2012 Trend Micro Inc.
Setup hosts in the same VLAN
3/6/2013 16 Confidential | Copyright 2012 Trend Micro Inc.
• Now this Switch has two VLAN:
– VLAN 1: Management VLAN (SVI: 10.100.1.253/24)
– VLAN 2: For hosts PC0 and PC1 communicates to each other (10.100.2.0/24)
• Now PC0 can ping PC1, but PC0 and PC1 cannot ping Switch SVI interface (10.100.1.253/24), its normal and it was due to they belong to different subnet.
• Switch cannot route different subnet traffic, even all hosts connect to the same Switch but belong to different VLAN. (We need a layer 3 device to route Inter-VLAN traffic)
Power on another new switch
Power on another new switch
3/6/2013 18 Confidential | Copyright 2012 Trend Micro Inc.
Another new switch basic configuration
3/6/2013 19 Confidential | Copyright 2012 Trend Micro Inc.
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW2
SW2(config)#
SW2(config-if)#int vlan 1
SW2(config-if)#no shutdown
SW2(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
SW2(config-if)#ip address 10.100.1.252 255.255.255.0
SW2(config-if)#exit
SW2(config)#ip default-gateway 10.100.1.254
SW2(config)#int f0/1
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 2
% Access VLAN does not exist. Creating vlan 2
Assign a port as an trunk interface to pass-through different VLAN traffic over a single link
Setup trunk interconnection between two SW1 & SW2 F0/24
3/6/2013 21 Confidential | Copyright 2012 Trend Micro Inc.
SW1>en
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#int f0/24
SW1(config-if)#switchport mode trunk
SW1(config-if)#^Z
SW1#
%SYS-5-CONFIG_I: Configured from console by console
SW2>en
SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#int f0/24
SW2(config-if)#switchport mode trunk
SW2(config-if)#^Z
SW2#
%SYS-5-CONFIG_I: Configured from console by console
• Now SW2 can ping SW1 VLAN1 via Trunk interface(FastEthernet0/24)
SW2#ping 10.100.1.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.100.1.253, timeout is 2 seconds:
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 20/20/20 ms
Switch Trunk allow VLAN1 & VLAN2 pass-through, but not for Inter-VLAN routing
3/6/2013 22 Confidential | Copyright 2012 Trend Micro Inc.
Enable a Inter-VLAN routing to route traffic between different VLANs
Add a new Router to support Inter-VLAN routing
3/6/2013 24 Confidential | Copyright 2012 Trend Micro Inc.
Configure Router interface as VLAN1 & VLAN2 gateway
3/6/2013 25 Confidential | Copyright 2012 Trend Micro Inc.
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#int f0/0.1
%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up
Router(config-subif)#encapsulation dot1Q 1 native
Router(config-subif)#ip address 10.100.1.254 255.255.255.0
Router(config-subif)#int f0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up
Router(config-subif)#encapsulation dot1Q 2
Router(config-subif)#ip address 10.100.2.254 255.255.255.0
Router(config-subif)#exit
Router(config)#exit
Router#
Configure SW1 F0/23 Trunk interface uplink to Router F0/0
3/6/2013 26 Confidential | Copyright 2012 Trend Micro Inc.
SW1>en
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#int f0/23
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to up
SW1(config)#exit
SW1#
• Now SW1 can ping Router F0/0.1 via Trunk interface(FastEthernet0/23)
SW1#
SW1#ping 10.100.1.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.100.1.254, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 11/17/20 ms
Now Router support Inter-VLAN routing to route VLAN1 to VLAN2 and vice versa
3/6/2013 27 Confidential | Copyright 2012 Trend Micro Inc.
PC>ping 10.100.1.254
Pinging 10.100.1.254 with 32 bytes of data:
Reply from 10.100.1.254: bytes=32 time=39ms TTL=255
…
PC>ping 10.100.2.254
Pinging 10.100.2.254 with 32 bytes of data:
Reply from 10.100.2.254: bytes=32 time=40ms TTL=255
…
PC>ping 10.100.2.1
Pinging 10.100.2.1 with 32 bytes of data:
Reply from 10.100.2.1: bytes=32 time=10ms TTL=128
…
Q&A
3/6/2013 28 Confidential | Copyright 2012 Trend Micro Inc.
Appendix
3/6/2013 29 Confidential | Copyright 2012 Trend Micro Inc.