Configuring the Next_Hop Attribute


The Next_Hop attribute records the next hop that a route passes through. The Next_Hop attribute of BGP is different from that of an IGP because it may not be the neighbor IP address. A BGP speaker processes the Next_Hop attribute based on the following rules:

  • When advertising a route to an EBGP peer, a BGP speaker sets the Next_Hop attribute of the route to the address of the local interface through which the BGP peer relationship is established with the peer.

  • When advertising a locally originated route to an IBGP peer, the BGP speaker sets the Next_Hop attribute of the route to the address of the local interface through which the BGP peer relationship is established with the peer.

  • When advertising a route learned from an EBGP peer to an IBGP peer, the BGP speaker does not change the Next_Hop attribute of the route.

Configure the Router as the Next Hop for Routes Sent

When an Autonomous System Boundary Router (ASBR) forwards the route learned from an EBGP peer to an IBGP peer, the ASBR does not change the next hop of the route by default. When the IBGP peer receives this route, it finds the next hop unreachable, sets the route to inactive, and does not use this route to guide traffic forwarding. To enable the IBGP peer to use this route to guide traffic forwarding, configure the ASBR to set its IP address as the next hop of the route when the ASBR forwards this route to the IBGP peer. After the IBGP peer receives the route from the ASBR, it finds the next hop of the route reachable, sets the route to active, and uses this route to guide traffic forwarding.

admin@XorPlus# set protocols bgp neighbor 2.2.2.2 ipv4-unicast next-hop-self
admin@XorPlus# commit

Apply a Routing Policy to Routes Advertised

The set protocols bgp neighbor route-map command applies a route map to incoming or outgoing routes. It can be used to configure the route map for modifying the Next_Hop attribute of the route.

admin@XorPlus# set protocols bgp neighbor 2.2.2.2 ipv4-unicast in route-map map1
admin@XorPlus# commit

Copyright © 2024 Pica8 Inc. All Rights Reserved.