Saturday, December 7, 2013

Building My Layer 2 Network Lab

I've started building the Layer 2 network foundation for my lab by applying a base configuration and creating EtherChannel links between switches.


First, I've erased the startup-config and VLAN database to make sure I've got a clean switch. Then, I configured the hostname, passwords and then created the EtherChannel using Link Aggregation Control Protocol (LACP).

Switch#show flash

Directory of flash:/

    2  -rwx         736   Mar 1 1993 00:00:33 +00:00  vlan.dat
    3  -rwx        1119   Mar 1 1993 00:33:41 +00:00  config.text
    4  -rwx       16258  Feb 23 2010 00:09:55 +00:00  config.old
    5  -rwx         968   Mar 1 1993 01:27:04 +00:00  startup-config
    6  drwx         512   Mar 1 1993 00:07:54 +00:00  c3560-ipbase-mz.122-35.SE5
  464  -rwx           5   Mar 1 1993 00:33:41 +00:00  private-config.text

27998208 bytes total (18626560 bytes free)
Switch#delete vlan.dat
Delete filename [vlan.dat]?
Delete flash:vlan.dat? [confirm]
Switch#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
00:03:06: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Switch#reload
Proceed with reload? [confirm]

00:03:09: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

<OUTPUT TRUNCATED>

Would you like to enter the initial configuration dialog? [yes/no]: no
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SW1
SW1(config)#do show interface status

Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        notconnect   1            auto   auto 10/100BaseTX
Fa0/2                        notconnect   1            auto   auto 10/100BaseTX
Fa0/3                        notconnect   1            auto   auto 10/100BaseTX
Fa0/4                        notconnect   1            auto   auto 10/100BaseTX
Fa0/5                        notconnect   1            auto   auto 10/100BaseTX
Fa0/6                        notconnect   1            auto   auto 10/100BaseTX
Fa0/7                        notconnect   1            auto   auto 10/100BaseTX
Fa0/8                        notconnect   1            auto   auto 10/100BaseTX
Gi0/1                        notconnect   1            auto   auto Not Present
SW1(config)#interface range fastethernet0/1 - 2
SW1(config-if-range)#description ETHERCHANNEL TO SW2
SW1(config-if-range)#channel-protocol ?
  lacp  Prepare interface for LACP protocol
  pagp  Prepare interface for PAgP protocol

SW1(config-if-range)#channel-protocol lacp

SW1(config-if-range)#channel-group ?
  <1-48>  Channel group number

SW1(config-if-range)#channel-group 1 ?
  mode  Etherchannel Mode of the interface

SW1(config-if-range)#channel-group 1 mode ?
  active     Enable LACP unconditionally
  auto       Enable PAgP only if a PAgP device is detected
  desirable  Enable PAgP unconditionally
  on         Enable Etherchannel only
  passive    Enable LACP only if a LACP device is detected

SW1(config-if-range)#channel-group 1 mode active
Creating a port-channel interface Port-channel 1

SW1(config-if-range)#switchport mode ?
  access        Set trunking mode to ACCESS unconditionally
  dot1q-tunnel  set trunking mode to TUNNEL unconditionally
  dynamic       Set trunking mode to dynamically negotiate access or trunk mode
  private-vlan  Set private-vlan mode
  trunk         Set trunking mode to TRUNK unconditionally

SW1(config-if-range)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.    // THIS ERROR SHOWS UP IN A CATALYST 3560 SWITCH
SW1(config-if-range)#switchport ?
  access         Set access mode characteristics of the interface
  backup         Set backup for the interface
  block          Disable forwarding of unknown uni/multi cast addresses
  host           Set port host
  mode           Set trunking mode of the interface
  nonegotiate    Device will not engage in negotiation protocol on this
                 interface
  port-security  Security related command
  priority       Set appliance 802.1p priority
  private-vlan   Set the private VLAN configuration
  protected      Configure an interface to be a protected port
  trunk          Set trunking characteristics of the interface
  voice          Voice appliance attributes
  <cr>

SW1(config-if-range)#switchport trunk ?
  allowed        Set allowed VLAN characteristics when interface is in trunking
                 mode
  encapsulation  Set trunking encapsulation when interface is in trunking mode
  native         Set trunking native characteristics when interface is in
                 trunking mode
  pruning        Set pruning VLAN characteristics when interface is in trunking
                 mode

SW1(config-if-range)#switchport trunk encapsulation ?
  dot1q      Interface uses only 802.1q trunking encapsulation when trunking
  isl        Interface uses only ISL trunking encapsulation when trunking
  negotiate  Device will negotiate trunking encapsulation with peer on
             interface

SW1(config-if-range)#switchport trunk encapsulation dot1q   // NEED TO SET ENCAPSULATION
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#interface range fastethernet 0/3 - 4
SW1(config-if-range)#description ETHECHANNEL TO SW3
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#channel-protocol lacp
SW1(config-if-range)#channel-group 2 mode active
Creating a port-channel interface Port-channel 2
SW1(config-if-range)#end

SW1#show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SD)         LACP      Fa0/1(D)    Fa0/2(D)   // "D" FOR DOWN SINCE THERE ARE NO CABLES YET
2      Po2(SD)         LACP      Fa0/3(D)    Fa0/4(D)

SW1#show interface port-channel 1
Port-channel1 is down, line protocol is down (notconnect)
  Hardware is EtherChannel, address is 0000.0000.0000 (bia 0000.0000.0000)
  MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Auto-duplex, Auto-speed, link type is auto, media type is unknown
  input flow-control is off, output flow-control is unsupported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts (0 multicasts)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 0 multicast, 0 pause input
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 PAUSE output
     0 output buffer failures, 0 output buffers swapped out

SW1#show interface port-channel 2
Port-channel2 is down, line protocol is down (notconnect)
  Hardware is EtherChannel, address is 0000.0000.0000 (bia 0000.0000.0000)
  MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Auto-duplex, Auto-speed, link type is auto, media type is unknown
  input flow-control is off, output flow-control is unsupported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts (0 multicasts)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 0 multicast, 0 pause input
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 PAUSE output
     0 output buffer failures, 0 output buffers swapped out
SW1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SW1(config)#ip default-gateway 192.168.1.1    // SEND TRAFFIC TO 871W
SW1(config)#interface fastethernet0/8   // TRUNK TO 871W
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.1.2 255.255.255.0   // FOR REMOTE MANAGEMENT
SW1(config-if)#do show ip interface brief
Interface                   IP-Address     OK? Method Status             Protocol
Vlan1                       192.168.1.2     YES manual up                    down
FastEthernet0/1        unassigned      YES unset  down                  down
FastEthernet0/2        unassigned      YES unset  down                  down
FastEthernet0/3        unassigned      YES unset  down                  down
FastEthernet0/4        unassigned      YES unset  down                  down
FastEthernet0/5        unassigned      YES unset  down                  down
FastEthernet0/6        unassigned      YES unset  down                  down
FastEthernet0/7        unassigned      YES unset  down                  down
FastEthernet0/8        unassigned      YES unset  down                  down
GigabitEthernet0/1     unassigned      YES unset  down                  down
Port-channel1          unassigned      YES unset  down                  down
Port-channel2          unassigned      YES unset  down                  down
SW1(config-if)#exit
SW1(config)#enable password cisco     // NICE PASSWORD FOR LAB ENVIRONMENT ONLY
SW1(config)#line vty 0 4
SW1(config-line)#password cisco
SW1(config-line)#login
SW1(config-line)#end
SW1#
00:18:22: %SYS-5-CONFIG_I: Configured from console by console
SW1#write memory
Building configuration...
[OK]
SW1#
00:07:02: %SYS-5-CONFIG_I: Configured from console by console
SW1#show running-config
Building configuration...

Current configuration : 2299 bytes
!
! Last configuration change at 01:36:49 SGT Sat Sep 14 2013 by cisco
! NVRAM config last updated at 01:31:43 SGT Sat Sep 14 2013 by cisco
!
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW1
!
enable password cisco
!
username cisco privilege 15 password 0 cisco
no aaa new-model
clock timezone SGT 8
system mtu routing 1500
ip subnet-zero
ip name-server 8.8.8.8
ip name-server 4.2.2.2
!
!
!
!
no file verify auto
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
interface Port-channel1
 description L2 ETHERCHANNEL TO SW2
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface Port-channel2
 description L2 ETHECHANNEL TO SW3
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/1
 description L2 ETHERCHANNEL TO SW2 (LINK#1)
 switchport trunk encapsulation dot1q
 switchport mode trunk
 channel-group 1 mode active
!
interface FastEthernet0/2
 description L2 ETHERCHANNEL TO SW2 (LINK#2)
 switchport trunk encapsulation dot1q
 switchport mode trunk
 channel-group 1 mode active
!
interface FastEthernet0/3
 description L2 ETHECHANNEL TO SW3 (LINK#1)
 switchport trunk encapsulation dot1q
 switchport mode trunk
 channel-group 2 mode active
!
interface FastEthernet0/4
 description L2 ETHECHANNEL TO SW3 (LINK#2)
 switchport trunk encapsulation dot1q
 switchport mode trunk
 channel-group 2 mode active
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface GigabitEthernet0/1
!
interface Vlan1
 description L3 MANAGEMENT VLAN
 ip address 192.168.1.2 255.255.255.0
!
ip default-gateway 192.168.1.1
ip classless
ip http server
!
!
control-plane
!
banner motd ^C
+--------------------------------------------------------------+
| This equipment is privately owned and monitored.             |
| Disconnect immediately if you are not an authorized user.    |
+--------------------------------------------------------------+
^C
!
line con 0
line vty 0 4
 exec-timeout 0 0
 logging synchronous
 login local
line vty 5 15
 login
!
ntp clock-period 36028859
ntp server 203.123.48.6



The same base configuration were applied for SW2 and SW3. After EtherChannel was configured and cabled, it started to negotiate and form with the help of LACP.

SW1#show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator

        M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SD)         LACP      Fa0/1(w)    Fa0/2(w)
2      Po2(SD)         LACP      Fa0/3(w)    Fa0/4(w)


SW1#
00:21:00: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
00:21:06: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
00:21:07: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up
00:21:08: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
00:21:15: %LINK-3-UPDOWN: Interface FastEthernet0/2, changed state to up
00:21:21: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
00:22:28: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up
00:22:34: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
00:22:35: %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to up
00:22:35: %LINK-3-UPDOWN: Interface Port-channel2, changed state to up
00:22:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel2, changed state to up
00:22:40: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up
SW1#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
Vlan1                  192.168.1.2     YES NVRAM  up                    up
FastEthernet0/1        unassigned      YES unset  up                    up
FastEthernet0/2        unassigned      YES unset  up                    up
FastEthernet0/3        unassigned      YES unset  up                    up
FastEthernet0/4        unassigned      YES unset  up                    up
FastEthernet0/5        unassigned      YES unset  down                  down
FastEthernet0/6        unassigned      YES unset  down                  down
FastEthernet0/7        unassigned      YES unset  down                  down
FastEthernet0/8        unassigned      YES unset  up                    up
GigabitEthernet0/1     unassigned      YES unset  down                  down
Port-channel1          unassigned      YES unset  up                    up
Port-channel2          unassigned      YES unset  up                    up
SW1#show interface description
Interface                      Status         Protocol Description
Vl1                            up             up       L3 MANAGEMENT VLAN
Fa0/1                          up             up       L2 ETHERCHANNEL TO SW2 (LINK#1)
Fa0/2                          up             up       L2 ETHERCHANNEL TO SW2 (LINK#2)
Fa0/3                          up             up       L2 ETHECHANNEL TO SW3 (LINK#1)
Fa0/4                          up             up       L2 ETHECHANNEL TO SW3 (LINK#2)
Fa0/5                          down           down
Fa0/6                          down           down
Fa0/7                          down           down
Fa0/8                          up             up
Gi0/1                          down           down
Po1                            up             up       L2 ETHERCHANNEL TO SW2
Po2                            up             up       L2 ETHECHANNEL TO SW3
SW1#show interface status

Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1     L2 ETHERCHANNEL TO connected    trunk      a-full  a-100 10/100BaseTX
Fa0/2     L2 ETHERCHANNEL TO connected    trunk      a-full  a-100 10/100BaseTX
Fa0/3     L2 ETHECHANNEL TO  connected    trunk      a-full  a-100 10/100BaseTX
Fa0/4     L2 ETHECHANNEL TO  connected    trunk      a-full  a-100 10/100BaseTX
Fa0/5                        notconnect   1            auto   auto 10/100BaseTX
Fa0/6                        notconnect   1            auto   auto 10/100BaseTX
Fa0/7                        notconnect   1            auto   auto 10/100BaseTX
Fa0/8                        connected    trunk      a-full  a-100 10/100BaseTX
Gi0/1                        notconnect   1            auto   auto Not Present
Po1       L2 ETHERCHANNEL TO connected    trunk      a-full  a-100
Po2       L2 ETHECHANNEL TO  connected    trunk      a-full  a-100


After the EtherChannel is formed, we verify by issuing the show etherchannel summary command.

SW1#show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Fa0/1(P)    Fa0/2(P)
2      Po2(SU)         LACP      Fa0/3(P)    Fa0/4(P)


SW1#show etherchannel port-channel
                Channel-group listing:
                ----------------------

Group: 1
----------
                Port-channels in the group:
                ---------------------------

Port-channel: Po1    (Primary Aggregator)

------------

Age of the Port-channel   = 0d:00h:35m:27s
Logical slot/port   = 2/1          Number of ports = 2
HotStandBy port = null
Port state          = Port-channel Ag-Inuse
Protocol            =   LACP

Ports in the Port-channel:

Index   Load   Port     EC state        No of bits
------+------+------+------------------+-----------
  0     00     Fa0/1    Active             0
  0     00     Fa0/2    Active             0

Time since last port bundled:    0d:00h:14m:39s    Fa0/2

Group: 2
----------
                Port-channels in the group:
                ---------------------------

Port-channel: Po2    (Primary Aggregator)

------------

Age of the Port-channel   = 0d:00h:35m:28s
Logical slot/port   = 2/2          Number of ports = 2
HotStandBy port = null
Port state          = Port-channel Ag-Inuse
Protocol            =   LACP

Ports in the Port-channel:

Index   Load   Port     EC state        No of bits
------+------+------+------------------+-----------
  0     00     Fa0/3    Active             0
  0     00     Fa0/4    Active             0

Time since last port bundled:    0d:00h:13m:21s    Fa0/4


The Spanning Tree Protocol (STP) is enabled by default, so we can go ahead and verify using the show spanning-tree command on each switch. Notice that all switches have a default priority of 32768. My network chose the 871W router as the root bridge by default. The best way to optimize the Layer 2 network is to manually assign the core switch as the root bridge, which is SW1 for this case.

SW1#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee   // THE ORIGINAL STP (802.1D)
  Root ID    Priority    32768
             Address     0026.99c6.db24    // 871 BID
             Cost        19
             Port        9 (FastEthernet0/8)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     6416.8dec.a700    // SW1 BID (C3560)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/8            Root FWD 19        128.9    P2p     // TRUNK PORT TO 871
Po1              Desg FWD 12        128.56   P2p
Po2              Desg FWD 12        128.64   P2p


SW2#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     0026.99c6.db24    // 871 BID
             Cost        31
             Port        65 (Port-channel1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     001b.0db0.8f00    // SW2 BID (C2940)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Po1              Root FWD 12        128.65   P2p
Po2              Desg FWD 12        128.66   P2p

SW2#show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        u - unsuitable for bundling
        U - in use      f - failed to allocate aggregator
        d - default port

Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Fa0/1(Pd)   Fa0/2(P)
2      Po2(SU)         LACP      Fa0/3(Pd)   Fa0/4(P)


SW3#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     0026.99c6.db24    // 871 BID
             Cost        31
             Port        56 (Port-channel1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     001f.9d88.b980    // SW3 BID (C2960)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po1                 Root FWD 12        128.56   P2p
Po2                 Altn BLK 12        128.64   P2p     // REDUNDANT PATH BLOCKED BY STP


SW3#show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator

        M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Fa0/1(P)    Fa0/2(P)
2      Po2(SU)         LACP      Fa0/3(P)    Fa0/4(P)


Routers with built-in switchports (like the Cisco 800 series ISRs) or Ethernet Switch (ESW) module will participate in a STP root bridge election. 

871W#show spanning-tree brief

Bridge group 1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     0026.9947.91a0
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     0026.9947.91a0
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
Dot11Radio0          128.9    128    33 DIS     0 32768 0026.9947.91a0 128.9
Vlan1                128.13   128    19 FWD     0 32768 0026.9947.91a0 128.13


VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     0026.99c6.db24
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     0026.99c6.db24
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0        128.1    128    19 FWD     0 32768 0026.99c6.db24 128.1



Let's try out if the switch can reach the Internet and if the router can Telnet to the switches.

SW1#ping www.google.com

Translating "www.google.com"...domain server (255.255.255.255) % Name lookup aborted
% Unrecognized host or address, or protocol not running.

SW1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SW1(config)#ip name-server 8.8.8.8 4.2.2.2
SW1(config)#end
00:37:06: %SYS-5-CONFIG_I: Configured from console by consolew.
SW1#ping www.google.com

Translating "www.google.com"...domain server (8.8.8.8) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 173.194.38.147, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/13/17 ms

871W#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!

871W#telnet 192.168.1.2
Trying 192.168.1.2 ... Open

User Access Verification

Password:
SW1>

Saturday, November 16, 2013

Cisco Configuration Professional (CCP) for my 871w router

CCP is the "new" GUI from Cisco that is used to manage their routers. It's a free downloadable software (using a CCO account) and it has also replaced Security Device Manager (SDM) a couple of years ago.

Here are the quick steps and commands used to enable my 871w router for CCP.

871W#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
871W(config)#username admin privilege 15 password cisco123   // CCP DOESN'T LIKE cisco/cisco AND IT WILL ASK YOU TO CREATE A MORE SECURE USER ACCOUNT
871W(config)#ip http server    // USE ip http secure-server FOR HTTPS ACCESS
871W(config)#ip http authentication local


You'll need to install an older version of Java for CCP to work nicely.  The file version used on my Windows 7 PC is running 6.0.310.79.


If you just double-click the program, it will open the CCP window and display "Retrieving port" indefinitely. The program must be "Run as administrator" which can be done by doing a right-click on the program.


After successfully opening CCP, it will ask you for the IP address, username and password of the discovered device.


CCP is smart enough to detect and ask you to change the default login of cisco/cisco.


The Configure section covers a lot of functions for managing the router. I just put here some screenshots, including Monitor section, which are of interest.







Friday, November 1, 2013

Configuring NetFlow

I started monitoring my Internet edge router using NetFlow (version 5). There is a new version called Flexible NetFlow (FNF), which is more scalable and have additional options available. This topic was included in the SECURE course. Maybe I would consider doing FNF for my next blog since the IOS can support it.

871W(config)#flow ?
  exporter  Define a Flow Exporter
  monitor   Define a Flow Monitor
  record    Define a Flow Record


I'm always curious what are the traffic my router sends and receives on the Internet. These are the current users in my home network.

871W#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
192.168.1.21        0188.c663.b59e.29       Oct 12 2013 10:58 PM    Automatic
192.168.1.22        0178.ca39.e481.e3       Oct 12 2013 09:50 PM    Automatic
192.168.1.23        01d8.9e3f.87a7.c5       Oct 12 2013 09:50 PM    Automatic
192.168.1.24        0190.187c.69a7.d1       Oct 12 2013 09:50 PM    Automatic
192.168.1.25        01e0.f847.a03b.2f       Oct 12 2013 09:51 PM    Automatic
192.168.1.26        016c.71d9.079e.5d       Oct 12 2013 10:22 PM    Automatic
192.168.1.27        01ec.55f9.01f9.0c       Oct 12 2013 10:36 PM    Automatic   // THIS IS ME


There are many NetFlow analyzers out there, but for this scenario I used a free tool from Solarwinds called the Real-time NetFlow Traffic Analyzer (NTA). This is what the application looks like and the commands used to enable NetFlow:


871W(config)#ip flow?
flow-aggregation  flow-cache        flow-capture  flow-egress
flow-export       flow-top-talkers

871W(config)#ip flow-export ?
  destination      Specify the Destination IP address
  interface-names  Export interface names
  source           Specify the interface for source address
  template         Specify the template specific configurations
  version          Specify the version number

871W(config)#ip flow-export destination ?
  Hostname or A.B.C.D  Destination IP address

871W(config)#ip flow-export destination 192.168.1.27 ?
  <1-65535>  UDP/SCTP port number

871W(config)#ip flow-export destination 192.168.1.27 2055    // DEFAULT UDP PORT
871W(config)#ip flow-export version ?
  1
  5
  9

871W(config)#ip flow-export version 5
871W(config)#ip flow-export source ?
  Async               Async interface
  BVI                 Bridge-Group Virtual Interface
  CDMA-Ix             CDMA Ix interface
  CTunnel             CTunnel interface
  Dialer              Dialer interface
  Dot11Radio          Dot11 interface
  FastEthernet        FastEthernet IEEE 802.3
  Lex                 Lex interface
  Loopback            Loopback interface
  Multilink           Multilink-group interface
  Null                Null interface
  Tunnel              Tunnel interface
  Vif                 PGM Multicast Host interface
  Virtual-Dot11Radio  Virtual dot11 interface
  Virtual-PPP         Virtual PPP interface
  Virtual-Template    Virtual Template interface
  Virtual-TokenRing   Virtual TokenRing
  Vlan                Vlan IEEE 802.1q
  vmi                 Virtual Multipoint Interface

871W(config)#ip flow-export source bvi1
871W(config)#ip flow-cache ?
  entries  Specify the number of entries in the flow cache
  timeout  Specify flow cache timeout parameters

871W(config)#ip flow-cache timeout ?
  active    Specify the active flow timeout
  inactive  Specify the inactive flow timeout

871W(config)#ip flow-cache timeout active ?
  <1-60>  Timeout in minutes

871W(config)#ip flow-cache timeout active 5
871W(config)#interface bvi1     // LAN INTERFACE
871W(config-if)#ip route-cache flow
871W(config-if)#interface fastethernet4     // WAN INTERFACE
871W(config-if)#ip route-cache flow
871W(config-if)#exit

871W#show run | include flow
 ip route-cache flow
 ip route-cache flow
ip flow-cache timeout active 5
ip flow-export source BVI1
ip flow-export version 5
ip flow-export destination 192.168.1.27 2055

871W#show ip flow ?
  export       Display export statistics
  interface    Display flow configuration on Interfaces
  top-talkers  Display top talkers

871W#show ip flow export
Flow export v5 is enabled for main cache
  Export source and destination details :
  VRF ID : Default
    Source(1)       192.168.1.1 (BVI1)
    Destination(1)  192.168.1.27 (2055)
  Version 5 flow records
  4185 flows exported in 179 udp datagrams
  0 flows failed due to lack of export packet
  143 export packets were sent up to process level
  0 export packets were dropped due to no fib
  16 export packets were dropped due to adjacency issues
  0 export packets were dropped due to fragmentation failures
  0 export packets were dropped due to encapsulation fixup failures

871W#show ip cache flow
IP packet size distribution (214853 total packets):
   1-32   64   96  128  160  192  224  256  288  320  352  384  416  448  480
   .000 .061 .005 .002 .001 .001 .000 .000 .000 .000 .000 .000 .000 .000 .001

    512  544  576 1024 1536 2048 2560 3072 3584 4096 4608
   .000 .000 .000 .005 .913 .000 .000 .000 .000 .000 .000

IP Flow Switching Cache, 278544 bytes
  93 active, 4003 inactive, 4827 added
  70986 ager polls, 0 flow alloc failures
  Active flows timeout in 5 minutes
  Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 25800 bytes
  93 active, 931 inactive, 4430 added, 4430 added to flow
  0 alloc failures, 0 force free
  1 chunk, 1 chunk added
  last clearing of statistics never
Protocol         Total    Flows   Packets Bytes  Packets Active(Sec) Idle(Sec)
--------         Flows     /Sec     /Flow  /Pkt     /Sec     /Flow     /Flow
TCP-Telnet           4      0.0        55    41      0.0      16.3      15.2
TCP-WWW           2802      0.5        72  1422     37.2       3.7       8.4
TCP-other         1043      0.1         9   643      1.8       2.2       9.2
UDP-DNS            161      0.0         1    65      0.0       0.0      15.4
UDP-NTP             20      0.0         1    76      0.0       0.0      15.1
UDP-other          695      0.1         1   136      0.1       0.1      15.4
ICMP                 9      0.0         1    58      0.0       4.2      15.4
Total:            4734      0.8        45  1379     39.2       2.7       9.9

SrcIf         SrcIPaddress    DstIf         DstIPaddress    Pr SrcP DstP  Pkts
BV1           192.168.1.24    Fa4           63.168.61.65    06 C5F8 01BB     1
BV1           192.168.1.24    Fa4           74.125.235.55   06 DCD9 01BB     4
BV1           192.168.1.27    Fa4           173.252.102.241 06 05F9 01BB     1
Fa4           74.125.235.50   BV1           59.189.105.75   06 01BB 8FB7     8
Fa4           173.194.38.156  BV1           59.189.105.75   06 0050 CEAD     1
BV1           192.168.1.24    Fa4           31.186.225.24   06 C2F2 0050     2
BV1           192.168.1.24    Fa4           31.186.225.24   06 C2F1 0050     2
BV1           192.168.1.24    Fa4           31.186.225.24   06 C2F9 0050     2
BV1           192.168.1.24    Fa4           173.245.2.213   06 BD3C 0050     1
BV1           192.168.1.24    Fa4           54.230.150.226  06 885E 0050     1
Fa4           74.125.235.55   BV1           59.189.105.75   06 01BB DCD9     2
Fa4           91.190.216.61   BV1           59.189.105.75   06 303E D367     1
BV1           192.168.1.24    Fa4           96.7.54.91      06 9F19 0050     1
BV1           192.168.1.24    Fa4           96.7.54.91      06 9F16 0050     1
BV1           192.168.1.24    Fa4           74.125.235.50   06 8FB7 01BB     5
Fa4           72.246.189.33   BV1           59.189.105.75   06 0050 DE4D     1
BV1           192.168.1.27    Fa4           172.16.1.254    06 0ED8 0050     2
Fa4           173.245.2.213   BV1           59.189.105.75   06 0050 BD3C     1
BV1           192.168.1.24    Fa4           199.38.166.155  06 8981 0050     1
Fa4           72.246.188.97   BV1           59.189.105.75   06 0050 D1ED     1
BV1           192.168.1.24    Fa4           184.73.189.70   06 DEBE 0050     1
BV1           192.168.1.24    Fa4           54.241.220.8    06 A300 0050     2
BV1           192.168.1.24    Fa4           72.246.188.89   06 8ACC 0050     1
BV1           192.168.1.24    Fa4           195.8.215.136   06 8D6B 0050     3
BV1           192.168.1.24    Fa4           195.8.215.136   06 8D6C 0050     2
BV1           192.168.1.25    Fa4           91.190.216.61   06 D367 303E     2

SrcIf         SrcIPaddress    DstIf         DstIPaddress    Pr SrcP DstP  Pkts
BV1           192.168.1.24    Fa4           173.194.38.143  06 A7D7 0050     1
BV1           192.168.1.24    Fa4           173.194.38.143  06 A7D6 0050     1
BV1           192.168.1.27    Local         192.168.1.1     06 0444 0017    37
BV1           192.168.1.24    Fa4           199.38.166.156  06 DF2A 0050     1
BV1           192.168.1.25    Null          8.8.8.8         11 E1E8 0035     1
Fa4           199.38.166.156  BV1           59.189.105.75   06 0050 DF2A     1
BV1           192.168.1.24    Fa4           72.246.188.98   06 CB3A 0050     1
BV1           192.168.1.24    Fa4           72.246.188.211  06 B83E 0050     1
Fa4           173.194.38.141  BV1           59.189.105.75   06 0050 A995     1
BV1           192.168.1.24    Fa4           8.39.37.21      06 A258 0050     2
BV1           192.168.1.24    Fa4           8.39.37.21      06 A272 0050     2
BV1           192.168.1.24    Fa4           8.39.37.21      06 A273 0050     2
BV1           192.168.1.24    Fa4           8.39.37.21      06 A271 0050     2
BV1           192.168.1.24    Fa4           8.39.37.21      06 A274 0050     2
Fa4           173.194.38.143  BV1           59.189.105.75   06 0050 A7D7     1
Fa4           173.194.38.143  BV1           59.189.105.75   06 0050 A7D6     1
Fa4           72.246.188.89   BV1           59.189.105.75   06 0050 8ACC     1
BV1           192.168.1.24    Fa4           192.33.31.101   06 8B5B 01BB     2
Fa4           8.8.8.8         Local         59.189.105.75   11 0035 EF47     1
Fa4           173.252.102.241 BV1           59.189.105.75   06 01BB 05F9     2
Fa4           195.8.215.136   BV1           59.189.105.75   06 0050 8D6A     3
Fa4           195.8.215.136   BV1           59.189.105.75   06 0050 8D6B     2
Fa4           195.8.215.136   BV1           59.189.105.75   06 0050 8D6C     1
Fa4           204.11.109.160  BV1           59.189.105.75   06 0050 C659     1
Fa4           72.246.188.98   BV1           59.189.105.75   06 0050 CB3A     1
BV1           192.168.1.24    Fa4           74.125.139.120  06 8435 0050     1
Fa4           54.241.220.8    BV1           59.189.105.75   06 0050 A300     1
BV1           192.168.1.24    Fa4           50.97.214.162   06 B716 0050     1
Fa4           184.73.189.70   BV1           59.189.105.75   06 0050 DEBE     1
Fa4           72.246.188.211  BV1           59.189.105.75   06 0050 B83E     1
Fa4           31.186.225.24   BV1           59.189.105.75   06 0050 C2F9     1
Fa4           31.186.225.24   BV1           59.189.105.75   06 0050 C2F1     1
Fa4           31.186.225.24   BV1           59.189.105.75   06 0050 C2F2     1
Fa4           204.11.109.63   BV1           59.189.105.75   06 0050 A5DA     1
Fa4           72.5.64.63      BV1           59.189.105.75   06 0050 94BF     1
BV1           192.168.1.24    Fa4           173.194.38.141  06 A995 0050     1
BV1           192.168.1.25    Fa4           23.58.242.217   06 D374 01BB     7
BV1           192.168.1.24    Fa4           72.246.189.25   06 86FE 0050     1
Fa4           74.125.139.120  BV1           59.189.105.75   06 0050 8435     1
BV1           192.168.1.24    Fa4           31.13.68.8      06 DB30 0050     3
BV1           192.168.1.25    Null          8.8.8.8         11 EF47 0035     1
Fa4           63.168.61.65    BV1           59.189.105.75   06 01BB C5F8     1
Fa4           72.246.189.25   BV1           59.189.105.75   06 0050 86FE     1
BV1           192.168.1.24    Fa4           66.117.25.36    06 A0B6 0050     2
BV1           192.168.1.24    Fa4           38.108.107.27   06 CD4A 0050     3
BV1           192.168.1.24    Fa4           38.108.107.27   06 CD49 0050     3
BV1           192.168.1.24    Fa4           31.13.68.16     06 CC94 0050     1
BV1           192.168.1.24    Fa4           31.13.68.16     06 CC91 0050     1
BV1           192.168.1.24    Fa4           31.13.68.16     06 CC8C 0050     1
Fa4           10.143.96.1     Null          255.255.255.255 11 0043 0044     2
BV1           192.168.1.24    Fa4           31.13.68.16     06 CC8A 0050     1
BV1           192.168.1.24    Fa4           31.13.68.16     06 CC85 0050     1
BV1           192.168.1.24    Fa4           31.13.68.16     06 CC87 0050     1
Fa4           23.58.225.224   BV1           59.189.105.75   06 0050 ED24     1
Fa4           31.13.68.8      BV1           59.189.105.75   06 0050 DB30     3

SrcIf         SrcIPaddress    DstIf         DstIPaddress    Pr SrcP DstP  Pkts
BV1           192.168.1.24    Fa4           204.236.131.45  06 9F55 0050     3
BV1           192.168.1.24    Fa4           204.11.109.63   06 A5DA 0050     1
BV1           192.168.1.27    Local         192.168.1.1     11 EB78 00A1   165
Fa4           96.7.54.91      BV1           59.189.105.75   06 0050 9F16     1
Fa4           96.7.54.91      BV1           59.189.105.75   06 0050 9F19     1
BV1           192.168.1.24    Fa4           173.194.38.156  06 CEAD 0050     1
BV1           192.168.1.24    Fa4           96.7.54.88      06 9005 0050     3
BV1           192.168.1.24    Fa4           96.7.54.88      06 9004 0050     3
BV1           192.168.1.24    Fa4           204.11.109.160  06 C659 0050     1
Fa4           23.58.242.217   BV1           59.189.105.75   06 01BB D374     7
Fa4           38.108.107.27   BV1           59.189.105.75   06 0050 CD49     3
Fa4           38.108.107.27   BV1           59.189.105.75   06 0050 CD4A     3
BV1           192.168.1.24    Fa4           72.5.64.63      06 94BF 0050     1
BV1           192.168.1.24    Fa4           72.246.188.97   06 D1ED 0050     1
Fa4           72.246.188.216  BV1           59.189.105.75   06 0050 DDB9     1
Fa4           72.246.188.216  BV1           59.189.105.75   06 0050 DDD3     1
Fa4           72.246.188.216  BV1           59.189.105.75   06 0050 DDD2     1
Fa4           204.236.131.45  BV1           59.189.105.75   06 0050 9F55     1

871W#show ip flow top-talkers
% Top talkers not configured
871W#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
871W(config)#ip flow?
flow-aggregation  flow-cache        flow-capture  flow-egress
flow-export       flow-top-talkers

871W(config)#ip flow-top-talkers   
871W(config-flow-top-talkers)#?
Netflow top talker configuration commands:
  cache-timeout  Configure cache timeout
  default        Set a command to its defaults
  exit           Exit from top talkers configuration mode
  match          Configure match criteria
  no             Negate a command or set its defaults
  sort-by        Configure top talker sort criteria
  top            Configure number of top talkers

871W(config-flow-top-talkers)#top ?
  <1-200>  Number of top talkers

871W(config-flow-top-talkers)#top 10
871W(config-flow-top-talkers)#sort-by ?
  bytes    Sort top talkers by bytes
  packets  Sort top talkers by packets

871W(config-flow-top-talkers)#sort-by bytes
871W(config-flow-top-talkers)#end

871W#show ip flow top-talkers

SrcIf         SrcIPaddress    DstIf         DstIPaddress    Pr SrcP DstP Bytes
Fa4           165.254.58.10   BV1           59.189.105.75   06 01BB A28D   134K
Fa4           23.61.194.64    BV1           59.189.105.75   06 01BB 8958   120K
Fa4           165.254.58.25   BV1           59.189.105.75   06 01BB E472   120K
Fa4           72.246.188.251  BV1           59.189.105.75   06 01BB DDA7   106K
Fa4           23.59.188.139   BV1           59.189.105.75   06 01BB BCDA    53K
Fa4           23.59.189.147   BV1           59.189.105.75   06 01BB CFEF    48K
BV1           192.168.1.27    Local         192.168.1.1     11 EB78 00A1    21K
Fa4           63.168.61.65    BV1           59.189.105.75   06 01BB D5F4    16K
BV1           192.168.1.25    Fa4           64.4.23.145     06 D388 9C62    12K
Fa4           17.173.66.179   BV1           59.189.105.75   06 01BB D38A    11K
10 of 10 top talkers shown. 71 flows processed.


The source port (SrcP) and destination port (DstP) on the top talker's list are displayed in hexadecimal values. We just convert it to decimal using this cool web tool:


It's good to know that most websites nowadays are doing encryption (HTTPS/TCP port 443). Looks like Facebook and Google are on the top visited domains. There's also a Braille protocol listed and someone must've tried to perform a denial of service (DOS) attack on my home network (holy crap!). It seems like there's a lot of crazy stuff going on over the Internet.