Command:

set ip next-hop (BGP)


Mode:

Router(config-route-map)#


Syntax:

set ip next-hop ip-address [...ip-address] [peer-address]
no set ip next-hop ip-address [...ip-address] [peer-address]

 

Syntax Description:

ip-address IP address of the next hop to which packets are output. The next hop must be an adjacent router.
peer-address (Optional) Sets the next hop to be the BGP peering address.

 

Command Description:

To indicate where to output packets that pass a match clause of a route map for policy routing, use the set ip next-hop command in route-map configuration mode. To delete an entry, use the no form of this command.

Use the ip policy route-map interface configuration command, the route-map global configuration command, and the match and set route-map configuration commands, to define the conditions for policy routing packets. The ip policy route-map command identifies a route map by name. Each route-map has a list of match and set commands associated with it. The match commands specify the match criteria--the conditions under which policy routing occurs. The set commands specify the set actions--the particular routing actions to perform if the criteria enforced by the match commands are met.

If the interface associated with the first next hop specified with the set ip next-hop command is down, the optionally specified IP addresses are tried in turn.

When the set ip next-hop command is used with the peer-address keyword in an inbound route map of a BGP peer, the next hop of the received matching routes will be set to be the neighbor peering address, overriding any third-party next hops. So the same route map can be applied to multiple BGP peers to override third-party next hops.

When the set ip next-hop command is used with the peer-address keyword in an outbound route map of a BGP peer, the next hop of the advertised matching routes will be set to be the peering address of the local router, thus disabling the next hop calculation. The set ip next-hop command has finer granularity than the per-neighbor neighbor next-hop-self command, because you can set the next hop for some routes, but not others. The neighbor next-hop-self command sets the next hop for all routes sent to that neighbor.

The set clauses can be used in conjunction with one another. They are evaluated in the following order:

1. set ip next-hop

2. set interface

3. set ip default next-hop

4. set default interface


Example:

In the following example, three routers are on the same FDDI LAN (with IP addresses 10.1.1.1, 10.1.1.2, and 10.1.1.3). Each is in a different autonomous system. The set ip next-hop peer-address command specifies that traffic from the router (10.1.1.3) in remote autonomous system 300 for the router (10.1.1.1) in remote autonomous system 100 that matches the route map is passed through the router bgp 200, rather than sent directly to the router (10.1.1.1) in autonomous system 100 over their mutual connection to the LAN.

Router(config)# router bgp 200
Router(config-router)# neighbor 10.1.1.3 remote-as 300
Router(config-router)# neighbor 10.1.1.3 route-map set-peer-address out
Router(config-router)# neighbor 10.1.1.1 remote-as 100

Router(config)# route-map set-peer-address permit 10
Router(config-route-map)# set ip next-hop peer-address


Misconceptions:

None


Related Commands:

ip policy route-map
match ip address
match length
route-map
set default interface
set ip default next-hop verify-availability
set ip next-hop

� Cisco Systems, Inc. 2001, 2002, 2003
World Wide Education

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)