Scenario 6-4: Configuring CEF-Based Layer 3 Switching on the Catalyst 6000/6500 Operating in Native Mode
In the previous scenario, you learned how to upgrade a Cisco Catalyst 6000/6500 switch from hybrid mode to native mode. When you upgrade to native mode, you lose both the Supervisor engine and MSFC configurations, meaning you must manually reconfigure the functionality previously in place when the switch was in hybrid mode. In Scenario 6-2, you learned how to configure the Catalyst 6000/6500 for CEF-based Layer 3 switching in hybrid mode. In this scenario, you configure the newly converted Switch-A for CEF-based Layer 3 switching in native mode, maintaining the same functionality as in Scenario 6-2. Figure 6-16 shows the new topology of Switch-A for this scenario.
Figure 6-16 Topology for Scenario 6-4
Configuration Tasks
The goal of this scenario is to implement the same functionality configured on Switch-A in Scenario 6-2. When upgraded to native mode, a Cisco Catalyst 6000/6500 switch loses its configuration, meaning you must reconfigure the switch from scratch. This requires the following configuration tasks:
Configuring system settings
Configuring Layer 2 interfaces
Configuring Layer 3 interfaces
Configuring Layer 3 routing
Verifying connectivity
Configuring System Settings
In this book so far, you have learned how to configure Cisco IOS-based Catalyst switches using the Catalyst 3550 switch. Because the native mode Catalyst 6000/6500 switch runs the same base operating system as the Catalyst 3550 (Cisco IOS), the commands used on the Catalyst 6000/6500 are identical to those used on the Catalyst 3550.
NOTE
Some minor differences exist in the command set supported on each switch, due to differences in the features supported.
This means that the same commands used to create and configure VLANs on the Catalyst 3550 are also used on the Catalyst 6000/6500. The same applies for all features that both switches have in common.
Example 6-38 demonstrates configuring Switch-A with a host name and passwords and configuring VLANs as required.
Example 6-105 Configuring System Settings on Switch-A in Native Mode
Router# configure terminal Router(config)# hostname Switch-A Switch-A(config)# enable secret cisco Switch-A(config)# line vty 0 15 Switch-A(config-line)# password cisco Switch-A(config-line)# exit Switch-A(config)# vtp mode transparent Setting device to VTP TRANSPARENT mode. Switch-A(config)# vlan 2 Switch-A(config-vlan)# name VLAN02
Configuring Layer 2 Interfaces
On the native mode Catalyst 6000/6500, it is important to understand that by default, all interfaces are configured as routed interfaces, as opposed to switched interfaces as is the default on other Cisco IOS-based Catalyst switches. This means that all interfaces are shut down by default (this is the default state for a routed interface on Cisco IOS) so if you wish to configure an interface for Layer 2 or Layer 3 operation, you must explicitly enable the interface. If you want to configure a Layer 2 interface (i.e. switched interface), you must also explicitly configure this, because all interfaces are Layer 3 interfaces by default.
You might also be wondering how interfaces are named in native mode. All interfaces are named using the interface-type interface-id convention used on other Cisco IOS-based Catalyst switches, with the interface-id defined in the format module/port. For example, port 2/4 on a 10/100BASE-T module is represented as interface fastEthernet2/4 on native mode.
In this scenario, interface fastEthernet0/1 through interface fastEthernet0/3 are all Layer 2 interfaces, with interface FastEthernet0/2 belonging to VLAN 2. Example 6-37 demonstrates configuring each of the above interfaces as Layer 2 interfaces and assigning the appropriate interface to VLAN 2.
Example 6-106 Configuring Layer 2 Parameters on Switch-A in Native Mode
Switch-A# configure terminal Switch-A(config)# interface range fastEthernet2/1 - 3 Switch-A(config-if-range)# no shutdown Switch-A(config-if-range)# switchport Switch-A(config-if-range)# exit Switch-A(config)# interface fastEthernet2/2 Switch-A(config-if)# switchport access vlan 2
In Example 6-39, notice that the interface range command is support on the native mode Catalyst 6000/6500, just like the Catalyst 3550. The no shutdown command takes each interface out of its default shutdown state and then the switchport command configures each interface as a Layer 2 interface, as opposed to a Layer 3 router interface. Finally, interface fastEthernet2/2 is assigned to VLAN 2, as this interface is connected to Host-Y.
Configuring Layer 3 Interfaces
On the native mode Catalyst 6000/6500, the same types of Layer 3 interfaces supported on other Cisco IOS-based Layer 3 Catalyst switches are also supported:
Physical interface
Switch virtual interface (SVI)
In this scenario, an SVI must be created for VLAN 2 (an SVI for VLAN 1 exists by default, but is in a shutdown state) so that Switch-A can route between VLAN 1 and VLAN 2. Example 6-40 demonstrates configuring SVIs for each VLAN and configuring the appropriate IP addressing for each SVI.
Example 6-107 Configuring Layer 2 Parameters on Switch-A in Native Mode
Switch-A# configure terminal Switch-A(config)# interface vlan 1 Switch-A(config-if)# no shutdown Switch-A(config-if)# ip address 192.168.1.1 255.255.255.0 Switch-A(config-if)# exit Switch-A(config)# interface vlan 2 Switch-A(config-if)# ip address 192.168.2.1 255.255.255.0
As you can see in Example 6-40, the configuration required on Switch-A is identical to the configuration required on the MSFC when creating SVIs in hybrid mode (see Example 6-39).
Configuring Layer 3 Routing
Finally, Layer 3 routing needs to be configured. In this scenario, Switch-A needs to participate in OSPF area 0, with Router-A as an OSPF neighbor. Example 6-41 shows the configuration required on Switch-A.
Example 6-108 Configuring Layer 2 Parameters on Switch-A in Native Mode
Switch-A# configure terminal Switch-A(config)# router ospf 1 Switch-A(config-router)# network 192.168.1.0 0.0.0.255 area 0 Switch-A(config-router)# network 192.168.2.0 0.0.0.255 area 0 Switch-A(config-router)# end Switch-A# show ip ospf neighbors Neighbor ID Pri State Dead Time Address Interface 192.168.1.2 1 FULL/BDR 00:00:33 192.168.1.2 Vlan1 Switch-A# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set O IA 10.0.0.0/8 [110/2] via 192.168.1.2, 00:00:37, Vlan1 C 192.168.1.0/24 is directly connected, Vlan1 C 192.168.2.0/24 is directly connected, Vlan2
The configuration and subsequent Layer 3 routing configuration verification shown in Example 6-41 is identical to the hybrid mode configuration of an MSFC (see Example 6-40).
Verifying Connectivity
At this point, the native mode configuration of Switch-A is in place. Having a single operating system to manage all components of the Catalyst 6000/6500 simplifies management and ensures only a single configuration file and operating system image file needs to be maintained. To verify your configuration, Host-X should be able to ping Host-Y and vice versa, and both hosts should also be able to ping the loopback interface on Router-A.
To view the MAC address used by the MSFC for routing, you use the show mls cef mac command, which is demonstrated in Example 6-42 on Switch-A.
Example 6-109 Displaying the MSFC MAC Address in Native Mode
Switch-A# show mls cef mac Switch-A-sp# Router MAC address: 0004.dd41.890a
If you compare the output of Example 6-42 with the output of the show mls cef mac command on the Supervisor engine of Switch-A in Scenario 6-2 (see Example 6-41), notice that the same router MAC address (00d0.0515.640a) is displayed. Even though Switch-A is now operating in native mode, the fundamental components of Layer 3 switching are still present (PFC and MSFC), so it is important that the L2 engine passes any frames with a destination MAC address of the MSFC to the L3 engine for possible L3 switching. Notice in Example 6-42 that the show mls cef mac command is actually executed by the switch processor rather than the MSFC processor, as indicated by the Switch-A-sp# prompt at the beginning of the command output. This is because the L2 engine is a component of the switch processor (Supervisor engine).
To view the FIB table in native mode, you use the show mls cef command, as demonstrated in Example 6-43.
Example 6-110 Displaying the FIB in Native Mode
Switch-A# show mls cef Switch-A-sp# Index Prefix Mask Adjacency 0 0.0.0.0 255.255.255.255 punt 1 255.255.255.255 255.255.255.255 punt 2 127.0.0.12 255.255.255.255 punt 3 127.0.0.0 255.255.255.255 punt 4 127.255.255.255 255.255.255.255 punt 5 192.168.1.1 255.255.255.255 0004.dd41.890a 6 192.168.1.2 255.255.255.255 00d0.0515.640a 7 192.168.1.100 255.255.255.255 0010.a4e0.1ed3 8 192.168.1.0 255.255.255.255 punt 9 192.168.1.255 255.255.255.255 punt 10 192.168.2.1 255.255.255.255 0004.dd41.890a 11 192.168.2.100 255.255.255.255 0006.53fe.8420 12 192.168.2.0 255.255.255.255 punt 13 192.168.2.255 255.255.255.255 punt 6400 224.0.0.0 255.255.255.0 punt 6401 192.168.1.0 255.255.255.0 punt 6402 192.168.2.0 255.255.255.0 punt 6403 10.0.0.0 255.0.0.0 00d0.0515.640a 115200 0.0.0.0 0.0.0.0 drop
In Example 6-43, notice that each destination prefix and associated mask are listed, along with adjacency information. The adjacency information does not specify next hop IP information as is the case in hybrid mode (see Example 6-42). Instead, the MAC address of the next hop device is listed. Notice that many prefixes have the punt adjacency associated with them. This means that any packets with a destination IP address that matches the prefix should be forwarded (punted) to the route processor (MSFC) for processing. For example, entry 5 shows that traffic destined to 192.168.1.1 should be sent to the route processor, which is the correct action because this is the IP address configured on the VLAN 1 interface. Notice that the last entry (numbered 115200) specifies a prefix of 0.0.0.0 and mask of 0.0.0.0, which matches any destination IP address not matched by the preceding FIB entries. The adjacency is a drop adjacency, which means any packets not matched by other FIB entries are dropped. This is the correct action to take because if no FIB entry for a destination exists, then no route for the destination exists and the destination is deemed unreachable.
Also in Example 6-43, the shaded entries indicate FIB entries that have a remote adjacency to which any packets that match the entry should be forwarded. The remote adjacency is indicated by a MAC address in the adjacency column. Referring to the MAC addresses for Host-X, Host-Y, and Router-A in Figure 6-16, you can see in Example 6-43 that the appropriate IP addresses are associated with the correct MAC addresses. For example, entry 6403 specifies a destination prefix of 10.0.0.0/8 (which is reachable via Router-A) and lists the adjacency as 00d0.0515.640a, which is the MAC address of Router-A.
Finally, to view the adjacency table in native mode, you use the show mls cef adjacency command, as demonstrated in Example 6-44.
Example 6-111 Displaying the CEF Adjacency Table in Native Mode
Switch-A# show mls cef adjacency Switch-A-sp# Index 17416 : mac-sa: 0004.dd41.890a, mac-da: 0006.53fe.8420 interface: Fa2/2, mtu: 1514 packets: 0000000000000010, bytes: 0000000000000960 Index 17417 : mac-sa: 0004.dd41.890a, mac-da: 00d0.0515.640a interface: Fa2/3, mtu: 1514 packets: 0000000000000010, bytes: 0000000000000960 Index 17418 : mac-sa: 0004.dd41.890a, mac-da: 0010.a4e0.1ed3 interface: Fa2/1, mtu: 1514 packets: 0000000000000020, bytes: 0000000000001920 Index 262140: mac-sa: 00d0.0515.640a, mac-da: 0000.0000.0202 interface: unknown, mtu: 1514 packets: 0000004294967295, bytes: 0002199023255551
Notice in Example 6-44 that an adjacency entry exists per destination MAC address. The output is rather different from the comparative command on a hybrid mode switch and is much easier to understand. Each adjacency entry contains the information required for the hardware-based L3 engine on the PFC-2 to perform Layer 3 switching. Remember that Layer 3 switching occurs at the data plane of IP routing; at this level, a rewrite of the destination and source MAC addresses is required, along with knowledge of the egress interface. You can see in Example 6-44 that each adjacency specifies the source MAC address to rewrite, destination MAC address to rewrite, and egress interface. You can also see the number of packets and associated bytes that have been matched to each adjacency. This is useful for verifying that CEF-based Layer 3 switching is actually taking place.
If you put together all of the information in Example 6-43 and Example 6-44, you begin to see exactly how L3 switching works using CEF. Suppose a packet from Host-X (192.168.1.100) is passed to the L3 engine on the PFC-2 that is addressed to Host-Y (192.168.2.100). The L3 engine inspects the destination IP address (192.168.2.100) and looks up the FIB table (see Example 6-44) for the most specific entry that matches the destination IP address. Entry #11 is matched, which specifies an adjacency of 0006.53fe.8420. The L3 engine then looks up the adjacency table (see Example 6-44) for an adjacency with a destination MAC address of 0006.53fe.8420. Entry #17416 is matched, which provides the L3 engine with the values for the rewriting of the source MAC address (0004.dd41.890ai.e., the MSFC) and destination MAC address (0006.53fe.8420i.e., Host-Y), as well as the interface (Fa2/2) out which the packet should be sent. The L3 engine rewrites the frame waiting to be routed, performs other required tasks (such as TTL decrement and checksum recomputation), and then forwards the packet to the egress interface for transmission. Figure 6-17 shows the process described above.
Figure 6-17 CEF Operation on Switch-A
At this stage, you have successfully verified CEF-based Layer 3 switching operation. As a final verification task, you can use the show mls cef statistics command to view the NetFlow statistical information that is collected. Example 6-45 demonstrates executing the show mls cef statistics command, generating some traffic on the network (in this example, a continuous ping is generated between Host-X and Host-Y), and then executing the show mls cef statistics command again.
Example 6-112 Displaying NetFlow Statistics
Switch-A# show mls cef statistics Switch-A-sp# Total CEF switched packets: 0000000000021720 Total CEF switched bytes: 0000000032444268 _ (Generate traffic between Host-X and Host-Y, wait a few minutes) _ Switch-A# show mls cef statistics Switch-A-sp# Total CEF switched packets: 0000000000021926 Total CEF switched bytes: 0000000032753268
In Example 6-45, the second show mls cef statistics command is executed approximately 3 minutes after the first. Notice that the number of packets L3 switched by CEF has increased by 206 (from 21720 to 21926), and the total number of bytes has also increased due to the continuous ICMP traffic being sent from Host-X to Host-Y.
You can also use the show interfaces command on a native mode switch to view the number of packets that have been Layer 2 switched and Layer 3 switched on a particular interface. Example 6-46 shows the output of the show interfaces command on interface FastEthernet 2/2, which is connected to Host-Y.
Example 6-113 Displaying Interface Statistics in Native Mode
Switch-A# show interface FastEthernet2/2 FastEthernet2/2 is up, line protocol is up Hardware is C6k 10/100Mb 802.3, address is 0004.dd41.890a (bia 0004.dd41.890a) _ (Output truncated) _ L2 Switched: ucast: 3993 pkt, 354635 bytes - mcast: 569 pkt, 46508 bytes L3 in Switched: ucast: 75329 pkt, 112930074 bytes - mcast: 0 pkt, 0 bytes mcast L3 out Switched: ucast: 75337 pkt, 112929372 bytes _ (Output truncated) _
In Example 6-46, the shaded output indicates how many packets have been L2 switched on the interface as well as how many packets have been L3 switched in and out of the interface. This command is useful for verifying L3 switching on a particular interface.
TIP
The L2 and L3 switching interface counters are updated approximately every 180 seconds.