Set ip nexthop BGP

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

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 peer-address

IP address of the next hop to which packets are output. The next hop must be an adjacent router.

(Optional) Sets the next hop to be the BGP peering address.

Defaults

This command is disabled by default.

Command Modes

Route map configuration

Command History Release

Modification

11.0

This command was introduced.

12.0

The keyword peer-address was added.

Usage Guidelines

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 command 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 set ip next-hop 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. This means that the same route map can be applied to multiple BGP peers to override third-party next hops.

When set ip next-hop 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. This command has finer granularity than the per-neighbor neighbor next-hop-self command, since you can set the next hop for some routes, but not others. The neighbor next-hop-self 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:

set ip next-hop set interface set ip default next-hop set default interface

Examples In the following example, packets with a Level 3 length of 3 to 50 bytes are output to the router at IP

address 172.16.2.2:

interface serial 0 ip policy route-map thataway route-map thataway match length 3 5 0 set ip next-hop 172.16.2.2

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 AS 300 for the router (10.1.1.1) in remote AS 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 AS 100 over their mutual connection to the LAN:

router bgp 2 00

neighbor 10.1.1.3 remote-as 100

neighbor 10.1.1.3 route-map set-peer-address out neighbor 10.1.1.1 remote-as 100 route-map set-peer-address permit 10 set ip next-hop peer-address

Related Commands Command ip policy route-map match ip address match length neighbor next-hop-self route-map set default interface set interface set ip default next-hop

Description

Identifies a route map to use for local policy routing.

Distributes any routes that have a destination network number address that is permitted by a standard or extended access list, or performs policy routing on packets.

Bases policy routing on the Level 2 length of a packet.

Disables next-hop processing of BGP updates on the router.

Defines the conditions for redistributing routes from one routing protocol to another, or enables policy routing.

Indicates where to output packets that pass a match clause of a route map for policy routing and that have no explicit route to the destination.

Indicates where to output packets that pass a match clause of a route map for policy routing.

Indicates where to output packets that pass a match clause of a route map for policy routing and for which the Cisco IOS software has no explicit route to a destination.

I BGP Commands_

set metric-type internal I

Continue reading here: Set metrictype internal

Was this article helpful?

+1 0