Pages

Showing posts with label EtherChannel. Show all posts
Showing posts with label EtherChannel. Show all posts

Thursday, May 20, 2010

spanning tree on Cat 6500, 4510 and 3560


make sure all the cabling are fine and working, show CDP should be able to show all it's neighbor

set all the connected port above to be a trunking port

ex using int range command on CORE1 to set trunk on int Gi1/1 until Gi1/3


CORE1(config)#interface range gigabitEthernet 1/1 - 3
CORE1(config-if-range)#switchport trunk encapsulation dot1q
CORE1(config-if-range)#switchport mode trunk

configure etherchannel between CORE1 and CORE2

interface GigabitEthernet1/1 (same for Gi1/2)
 switchport
 switchport trunk encapsulation dot1q
 switchport mode trunk
 no ip address
 channel-protocol lacp
 channel-group 64 mode active
end

this will automatically create etherchannel, Po64, make sure all the attribute in physical port applied the same to the port channel

interface Port-channel64
 switchport
 switchport trunk encapsulation dot1q
 switchport mode trunk
 no ip address
end

*once you start your switch, check the name, if 'router>' then all ports are layer3 port and by default is administratively shutdown, change it to switchport (layer2)
*if start with 'switch>', then it shouldn't be any problem

make sure you configure this on all ports above, next is creating management VLAN interface, we'll use VLAN1 to be the management VLAN, by default all port are belong to this VLAN

configure on CORE1


interface Vlan1
 ip address 172.16.1.1 255.255.255.0
end

use the same subnet for int VLAN1 on CORE2, DIST1 and ACC1, just change the last octet to 2, 3 and 4 accordingly

now all the int VLAN are up, if not then you might want to check on the trunk conf, make sure it's working
use this command, and make sure all of your trunk ports are listed, check on all switch

DIST1#sh interface trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa4/3       on               802.1q         trunking      1
Fa4/5       on               802.1q         trunking      1
Fa4/7       on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa4/3       1-4094
Fa4/5       1-4094
Fa4/7       1-4094

Port        Vlans allowed and active in management domain
..

configure enable and line vty password before you can telnet all the switch using VLAN1 ip address

DIST1(config)#enable secret cisco
DIST1(config)#line vty 0 15
DIST1(config-line)#password cisco
DIST1(config-line)#privilege level 15

the line will make sure you telnet session automatically goes into the enable mode
now you should be able to telnet to all the others switch

next we'll conf VTP for easy VLAN management, on CORE1

CORE1(config)#vtp mode server
CORE1(config)#vtp domain AMD
CORE1(config)#vtp version 2

conf the CORE2, DIST1 and ACC1 to be mode client

create 4 VLAN on CORE2

CORE1(config)#vlan 10
CORE1(config)#vlan 20
CORE1(config)#vlan 30
CORE1(config)#vlan 40

show vlan on all the switch, make sure all have the same VLAN, if not then troubleshoot your VTP


now we move to spanning-tree, how to configure it? no need, by default it is turned on already(PVST), but we can control the behavior of spanning tree by manipulating a few attributes

lowest priority will become a root, if all are same value, then lowest mac address take place
in this case CORE1 has the lowest priority

show spanning-tree vlan [VLAN number]
*use show spanning-tree to to get the result for every single VLAN

by default, a single switch will become a root bridge for every single VLAN inside your network

CORE1>sh span vlan 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192  this value should be same as Bridge ID (below), because the switch itself is Root
             Address     0019.0787.300a
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    8192 priority value and ID for this switch
             Address     0019.0787.300a
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi1/3            Desg FWD 19        128.3    P2p all ports in Root should be in FWD mode
Po64             Desg FWD 3         128.1665 P2p


CORE2#sh span vla 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     0019.0787.300a
             Cost        3
             Port        1665 (Port-channel64) local port going to Root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768 this switch can't become a Root because CORE1 has a lower priority
             Address     0019.a908.ac0a
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi7/5            Desg FWD 19        128.773  P2p port that forward traffic to the LAN segment
Po64             Root FWD 3         128.1665 P2p closest port to the root in term of cost

now we'll configure per VLAN spanning-tree, mean that we manually configure each VLAN it's own Root
there's two command to achieve this

spanning-tree vlan [VLAN X] root primary/secondary
OR
spanning-tree vlan [VLAN X] priority [Bridge ID]

we have created VLAN 10, 20, 30 and 40
divide into 2, 10 and 30 root on CORE1
20 and 40 root on CORE2

CORE1(config)#spanning-tree vlan 10 root primary
CORE1(config)#spanning-tree vlan 30 root primary

CORE2(config)#spanning-tree vlan 20 root primary
CORE2(config)#spanning-tree vlan 40 root primary

CORE2#show spanning-tree vlan 20

let's confirm this
 
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     0019.a908.ac14
             This bridge is the root now this switch is the root for VLAN 20
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    8192
             Address     0019.a908.ac14
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi7/5            Desg FWD 19        128.773  P2p
Po64             Desg FWD 3         128.1665 P2p

check on all the other 3 VLANs for their root

now you can configure secondary root for each VLAN using the same approach

for the second command,
remove all the configuration that we just put in, we should have the Bridge ID (by know you should know how to get the Bridge ID)
but now the problem is, all my switch have the same Bridge priority : 32788 and since CORE1 has the lowest mac, it's now the Root for all VLANs

so, I've set VLAN 10 and 30 to have a higher priority value than it's Root for now

CORE1#spanning-tree vlan 10,30 priority 36864

check on CORE2, that fella should be the Root for VLAN 20 and 30 right now

we can also confirm this on DIST1

DIST1#show spanning-tree vlan 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     0019.a908.ac0a
             Cost        19
             Port        197 (FastEthernet4/5)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)
             Address     0018.19b2.58c0
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa4/3               Altn BLK 19        128.195  P2p
Fa4/5               Root FWD 19        128.197  P2p  root port for VLAN 10 is different than 20 (below), Fa4/3 connect to CORE1, Fa4/5 to CORE2

DIST1#show spanning-tree vlan 20

VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     0019.0787.3014
             Cost        19
             Port        195 (FastEthernet4/3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20)
             Address     0018.19b2.58c0
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa4/3               Root FWD 19        128.195  P2p connect to CORE1, it's the Root for VLAN20
Fa4/5               Altn BLK 19        128.197  P2p

another useful command

DIST1#show spanning-tree interface fastEthernet 4/5

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001            Altn BLK 19        128.197  P2p
VLAN0010            Root FWD 19        128.197  P2p
VLAN0020            Altn BLK 19        128.197  P2p
VLAN0030            Root FWD 19        128.197  P2p
VLAN0040            Altn BLK 19        128.197  P2p
VLAN0050            Altn BLK 19        128.197  P2p

Wednesday, March 24, 2010

EtherChannel, Trunking, VTP, VLANs and Access port - GNS3 and VPCs

mentor_vlan



























we'll start with setup EtherChannel between S1 and S2
use the range for of the interface for easy setup
S1(config)#interface rang fa 1/14 - 15
S1(config-if-range)#channel-group 1 mode on

Creating a port-channel interface Port-channel1
*Mar  1 00:23:53.623: %EC-5-BUNDLE: Interface Fa1/14 joined port-channel Po1
*Mar  1 00:23:53.683: %EC-5-BUNDLE: Interface Fa1/15 joined port-channel Po1
*Mar  1 00:23:56.579: %LINEPROTO-5-UPDOW
we getting this feedback on the screen, indicating that this EtherChannel is up.
we have created a virtual interface of EtherChannel called Port-Channel1, or Po1
let's verify this by show etherchannel summary, here you can more detail such as interfaces that intercipated in this group
S2#show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        R - Layer3      S - Layer2
        U - in use
Group Port-channel  Ports
-----+------------+-----------------------------------------------------------
1     Po1(SU)     Fa1/14(P)  Fa1/15(P)
now our EtherChannel are ready, let's create a trunk across this EtherChannel to carry the VLAN between both switches.
first we'll define the format or encapsulation of trunk, we are using dot1q
then we configure the mode of the port/interface to be in trunk mode
S1(config)#interface port-channel 1
S1(config-if)#switchport trunk encapsulation dot1q
S1(config-if)#switchport mode trunk
conf on SW2 also
now let's verify we do have our trunk setup
S2#show interfaces trunk
Port      Mode         Encapsulation  Status        Native vlan
Po1       on           802.1q         trunking      1
Port      Vlans allowed on trunk
Po1       1-1005
Port      Vlans allowed and active in management domain
Po1       1
Port      Vlans in spanning tree forwarding state and not pruned
Po1       1
now that we have trunk, next we create VTP Domain to centralize the VLANs management.
to make sure each switch can exchange the VLAN database, the VTP domain name must be the same, we'll also add password to it for more security
SW1 will be the server, while SW2 are the client, every VLAN created in server will advertised to the client.
S1#vlan database
S1(vlan)#vtp domain lab
Changing VTP domain name from NULL to lab
S1(vlan)#vtp server
S1(vlan)#vtp password cisco
Setting device VLAN database password to cisco.
S1(vlan)#
S2(vlan)#vtp domain lab
S2(vlan)#vtp client
Setting device to VTP CLIENT mode.
S2(vlan)#vtp password cisco
Setting device VLAN database password to cisco.
S2(vlan)#
now let's create a few VLAN on VTP server to see is it successfully propagated accross the trunk
S1(vlan)#vlan 10 name IT
VLAN 10 modified:
    Name: IT
S1(vlan)#vlan 20 name Eng
VLAN 20 added:
    Name: Eng
show vlan-switch to make sure it's created an exist on both SW1 and Sw2
S1#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                Fa1/4, Fa1/5, Fa1/6, Fa1/7
                                                Fa1/8, Fa1/9, Fa1/10, Fa1/11
                                                Fa1/12, Fa1/13
10   IT                               active
20   Eng                              active
...
S2#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                Fa1/4, Fa1/5, Fa1/6, Fa1/7
                                                Fa1/8, Fa1/9, Fa1/10, Fa1/11
                                                Fa1/12, Fa1/13
10   IT                               active
20   Eng                              active
yes, now we are confimed that SW2 learn all the VLANs from SW1.
ok, now we'll configure the access port for IT and Eng
S1(config)#interface fastEthernet 1/0
S1(config-if)#switchport access vlan 10
S1(config)#interface fastEthernet 1/1
S1(config-if)#switchport access vlan 20
S2(config)#interface fastEthernet 1/0
S2(config-if)#switchport access vlan 10
S2(config)#interface fastEthernet 1/1
S2(config-if)#switchport access vlan 20
make sure all those port are fall into their right VLAN accordingly, use show vlan-switch
S2#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/2, Fa1/3, Fa1/4, Fa1/5
                                                Fa1/6, Fa1/7, Fa1/8, Fa1/9
                                                Fa1/10, Fa1/11, Fa1/12, Fa1/13
10   IT                               active    Fa1/0
20   Eng                              active    Fa1/1
now it's time to test the connectivity, IT pc should be able to access IT server, so do the Eng
configure ip address on VPCS as below (just put any address for the gateway, we don't need it yet because in this lab we don't do routing between different VLAN)
IT pc : 192.168.10.1
Eng pc : 192.168.20.1
IT server : 192.168.10.100
Eng server : 192.168.20.100
VPCS 1 >ip 192.168.10.1 192.168.10.99 24
PC1 : 192.168.10.1 255.255.255.0 gateway 192.168.10.99
VPCS 1 >2
VPCS 2 >ip 192.168.20.1 192.168.20.99 24
PC2 : 192.168.20.1 255.255.255.0 gateway 192.168.20.99
VPCS 2 >3
VPCS 3 >ip 192.168.10.100 192.168.10.99 24
PC3 : 192.168.10.100 255.255.255.0 gateway 192.168.10.99
VPCS 3 >4
VPCS 4 >ip 192.168.20.100 192.168.20.99 24
PC4 : 192.168.20.100 255.255.255.0 gateway 192.168.20.99
make sure all machine in the same VLAN can ping to each other
VPCS 1 >ping 192.168.10.100
192.168.10.100 icmp_seq=1 time=47.804 ms
192.168.10.100 icmp_seq=2 time=27.366 ms
192.168.10.100 icmp_seq=3 time=11.526 ms
192.168.10.100 icmp_seq=4 time=15.531 ms
192.168.10.100 icmp_seq=5 time=21.648 ms
VPCS 2 >ping 192.168.20.100
192.168.20.100 icmp_seq=1 time=40.551 ms
192.168.20.100 icmp_seq=2 time=16.720 ms
192.168.20.100 icmp_seq=3 time=34.366 ms
192.168.20.100 icmp_seq=4 time=16.558 ms
192.168.20.100 icmp_seq=5 time=49.387 ms
if you try to ping to another VLAN, should receive this error because we don't configure any inter-VLAN routing
VPCS 1 >ping 192.168.20.1
host (192.168.10.99) not reachable