Traffic Non-Forwarding IP Static Route Examples

Non-forwarding interfaces are configured for IPv4 traffic using the no ip forwarding command and for IPv6 traffic using the no ipv6 forwarding command, in interface configuration mode. IPv6 forwarding is disabled by default on the interface. The following example enters static routes specifying the non-forwarding interface vlan.0.4000 as the next-hop interface:

System(rw-config)->interface vlan.0.4000
System(rw-config-intf-vlan.0.4000)->no ip forwarding
System(rw-config-intf-vlan.0.4000)->exit
System(rw-config)->ip route 10.0.0.0/8 10.21.128.1 interface vlan.0.4000
System(rw-config)->ip route 125.20.0.0/16 125.20.10.1 interface vlan.0.4000
System(rw-config)->ipv6 route 2001:11ac:fd34::/48 2001:11ac:fd34:3333::4 interface vlan.0.4000

The following example uses the legacy method of configuring a non-forwarding static route from the system command mode with a destination of 192.122.173.42 and a gateway of 192.122.168.38:

System(rw)->set ip route 192.122.173.42 192.122.168.38

The following example uses the legacy method of configuring a non-forwarding static route from the system command mode with a destination of 192.122.173.50 and a next-hop interface of VLAN 50:

System(rw)->set ip route 192.122.173.50 vlan.0.50

Configuring Non-forward IP Static Routes describes how to configure a non-forwarding IP traffic route.

Click to expand in new window

Configuring Non-forward IP Static Routes

Step Task Command(s)
1 In interface configuration mode, set the routing interface for this static route to not forward IP traffic. no ip forwarding
2 In global configuration mode, configure the static route. ip route {prefix mask | prefix/prefix-length}{ip-address [recursive] | interface interface-name| vlan vlan-id} [distance] [tag tag-id] [blackhole] [reject]
3 Optionally, in global configuration command mode, configure IPv6 static routes. IPv6 forwarding is disabled by default. ipv6 route prefix/length {ipv6-address [recursive | interface interface-name] | interface interface-name | vlan vlan-id | vrf egress-vrf | blackhole | reject} [distance] [tag tag-id]
4 Alternatively, in system configuration mode, configure the non-forwarding static route. This method supports legacy configurations. It is recommended that you use the method described in steps 1 - 3. set ip route {destination | default} {gateway | interface} [mask]