A Catalyst 2960 switch can function as a Layer 3 device and route between VLANs and a limited number of static routes.

The Cisco Switch Database Manager (SDM) provides multiple templates for the 2960 switch. The templates can be enabled to support specific roles depending on how the switch is used in the network. For example, the sdm lanbase-routing template can be enabled to allow the switch to route between VLANs and to support static routing.

In Figure 1, the show sdm prefer command is entered on switch S1 and the default template is applied. The default template is the factory default setting for a Catalyst 2960 switch. The default template does not support static routing. If IPv6 addressing has been enabled, the template will be dual-ipv4-and-ipv6 default.

The SDM template can be changed in global configuration mode with the sdm prefer command.

Note: In Figures 2, 4, 6, and 7, the do command is used to execute user EXEC or privilege EXEC commands from other router configuration modes.

In Figure 2, the SDM template options are displayed with the sdm prefer ? command. The SDM template is changed to lanbase-routing. The switch must be reloaded for the new template to take effect.

In Figure 3, the lanbase-routing template is active on S1. With this template, static routing is supported for up to 750 static routes.

In Figure 4, interface F0/6 on S1 is assigned to VLAN 2. The SVIs for VLANs 1 and 2 are also configured with IP addresses 192.168.1.1/24 and 192.168.2.1/24, respectively. IP routing is enabled with the ip routing global configuration mode command.

Note: The ip routing command is automatically enabled on Cisco routers; however, the corresponding command for IPv6, ipv6 unicast-routing, is disabled, by default, on Cisco routers and switches.

In Figure 5, router R1 has two IPv4 networks configured: interface G0/1 has IP address 192.168.1.10/24 and loopback interface Lo0 has IP address 209.165.200.225/27. The show ip route command output is displayed.

A default route is configured on S1 in Figure 6. The show ip route command output is displayed.

A static route to the remote network 192.168.2.0/24 (VLAN 2) is configured on R1 in Figure 7. The show ip route command output is displayed.

In Figure 8, PC-A is configured with IP address 192.168.2.2/24 in VLAN 2 and PC-B is configured with IP address 192.168.1.2/24 in VLAN 1. PC-B is able to ping both PC-B and the loopback interface on R1.

In Figure 9, use the Syntax Checker to configure static routing on S1.