Cisco Cisco SG300-28 28-Port Gigabit Managed Switch Technical References

Page of 1053
Introduction
78-21485-01 Command Line Interface Reference Guide
41
1
 
Layer 3 Switch with Static Routing
The following example shows you how to configure IP on a Layer 3 switch with 
static routing:
The neighbor router 10.10.11.1 should be configured with the following static 
route: ip route 172.25.13.2 /32 10.10.10.2.
The neighbor router 10.11.11.1 should be configured with the following static 
route: ip route 172.25.13.2 /32 10.11.11.2.
The neighbor router 2001:DB8:2222:7270::1 connected to VLAN 1 should be 
configured with the following static route:
ipv6 route 2001:DB8:2222:7272::72/128 2001:DB8:2222:7270::2312
Switch# configure terminal
Switch(config)# interface vlan 1
Switch(config-if)# ip address 10.10.10.2 /24
Switch(config-if)# ipv6 address 2001:DB8:2222:7270::2312/64
Switch(config-if)# exit
Switch(config)# interface vlan 2
Switch(config-if)# ip address 10.11.11.2 /24
Switch(config-if)# ipv6 address 2001:DB8:3333:7271::2312/64
Switch(config-if)# exit
Switch(config)# interface loopback 1
Switch(config-if)# ip address 172.25.13.2 /32
Switch(config-if)# ipv6 address 2001:DB8:2222:7272::72/128
Switch(config-if)# exit
Switch(config)# ip route 0.0.0.0/0 10.10.11.1
Switch(config)# ip route 10.11.0.0 /16 10.11.11.1
Switch(config)# ipv6 route 0::/0  2001:DB8:2222:7270::1
Switch(config)# ipv6 route 2001:DB8:3333::/48 
2001:DB8:3333:7271::1