Configure a Next Hop for an IPv4 Static Route

Table 1. Configuration considerations
Interface type Description

Physical interface

  • The interface for the next hop must have at least one IP address configured on it. The address does not need to be in the same subnet as the destination network.
  • ARP is generated for a forwarded packet destination IP address when a physical interface is configured as the next hop.

Virtual interface

The interface for the next hop must have at least one IP address configured on it. The address does not need to be in the same subnet as the destination network.

VRF

  • The VRF must be an existing VRF. Any physical port referenced in the next hop must have a valid IP address so that the route is added to the routing table.
  • Using a VRF with a physical port as next hop allows for VRF route leaking for all incoming traffic intended for the destination IP address.
  1. Access global configuration mode.
    device# configure terminal
    
  2. To configure a physical interface, enter the destination IP address and prefix length, the ethernet keyword, and the interface number of the next hop.
    device(config)# ip route 10.128.2.69/24 ethernet 1/4
    
  3. To configure a virtual interface, enter the destination IP address and prefix length, the ve keyword, and the VLAN ID.
    device(config)# ip route 10.128.2.0/24 ve 3
    
  4. To configure a VRF, enter the destination IP address and prefix length, the next-hop-vrf keyword, the VRF name, and then identify the next hop as an IP address, interface, or null route.
    device(config)# ip route 10.0.0.0/24 next-hop-vrf red ethernet 1/1
    
    This example routes traffic for IP address 10.0.0.0/24 through VRF red over port 1/1.

This example configures an IP static route to destination network addresses beginning with 10.0.0.0 through the next-hop interface 2/1.

device(config)# ip route 10.0.0.0/24 ethernet 2/1

This example configures an IP static route with a destination address of 10.128.2.0, a prefix-length of /24, and a virtual interface (ve 3) as the next hop.

device(config)# ip route 10.128.2.0/24 ve 3

This example routes traffic for IP address 10.0.0.0/24 through VRF red over IP address 11.1.2.3.

device(config)# ip route 10.0.0.0/24 next-hop-vrf red 11.1.2.3
This example routes traffic for IP address 10.0.0.0/24 through VRF red over virtual interface 3.
device(config)# ip route 10.0.0.0/24 next-hop-vrf red ve 3

This example discards the traffic for IP address 10.0.0.0/24 through VRF red using a null route.

device(config)# ip route 10.0.0.0/24 next-hop-vrf red null 0