You can configure a
static route without next hop support over a VLAN, also known as a switch
virtual switch (SVI).
This example shows
how to configure a static route without a next hop over an SVI:
switch# configure terminal
switch(config)# feature interface-vlan
swicth(config)# interface vlan 10
switch(config-if)# ip address 192.0.2.1/8
switch(config-if)# ip route 209.165.200.224/27 vlan 10 <===209,165.200.224 is the IP
address of the interface that is configured on the interface that is directly connected to
the switch.
switch(config-if)# copy running-config startup-config
Note |
When you set up
a /32 static route over an interface VLAN, you have to configure an explicit
next hop by using the
ip route
ip-addr/length
vlan-id
next-hop-ip-address command.
|
This example shows
how to configure an explicit next hop when you set up a /32 static route over
an interface VLAN:
switch# configure terminal
switch(config)# feature interface-vlan
swicth(config)# interface vlan 10
switch(config-if)# ip address 209.165.202.128/27
switch(config-if)# ip route 209.165.202.130/32 vlan 10 209.165.202.130
switch(config-if)# copy running-config startup-config
Use the
no ip
static-route command to remove the static route.