5

unable to advertise a route to ebgp peer and modify next-hop address. on receive router this can be resolved by configuring a import policy that matches on community and sets next hop to proper address; however, curious what i'm overlooking.

root@juniper.mx5# show logical-systems arouter protocols bgp       
accept-remote-nexthop;
local-address 10.10.200.46;
group external-65534 {
    traceoptions {
        file arouter-bgp-update;
        flag update;
        flag route;
        flag packets;
    }
    description root-ls;
    export internal-rtbh;
    peer-as 65534;
    neighbor 10.10.200.45;
}

group external-65422 {
    description arouter-ls;
    accept-remote-nexthop;
    local-address 10.10.200.45;
    peer-as 65422;
    neighbor 10.10.200.46;
}

root@juniper.mx5# show logical-systems arouter routing-options static | find 172.16.22.100 
route 172.16.22.100/32 {
    discard;
    tag 65422;
}


root@juniper.mx5# show logical-systems arouter policy-options policy-statement internal-rtbh 
from {
    protocol static;
    tag 65422;
}
then {
    local-preference 400;
    origin igp;
    community add no-export;
    next-hop 192.0.2.13;
    accept;
}


root@juniper.mx5# run show route logical-system arouter advertising-protocol bgp 10.10.200.45 extensive 

inet.0: 26 destinations, 26 routes (26 active, 0 holddown, 0 hidden)
* 172.16.22.100/32 (1 entry, 1 announced)
 BGP group external-65534 type External
     Nexthop: Self
     Flags: Nexthop Change
     AS path: [65422] I
     Communities: no-export


root@juniper.mx5# run show route logical-system brouter receive-protocol bgp 10.10.200.46 extensive 

inet.0: 40 destinations, 40 routes (40 active, 0 holddown, 0 hidden)
* 172.16.22.100/32 (1 entry, 1 announced)
     Accepted
     Nexthop: 10.10.200.46
     AS path: 65422 I
     Communities: no-export
6

The way eBGP works is that it will always set the next-hop to the directly connected address of the sending router (except for multihop sessions or when the original next-hop is in the same subnet). As you can see in your output the router is sending the route with Nexthop: Self, not with the nexthop you have configured. You can find the decision tree for next-hop generation in the BGP RFC4271

As a workaround you could change the session to use eBGP multihop, which has a no-nexthop-change option:

set protocols bgp group external-65534 multihop no-nexthop-change

Using eBGP multihop has other drawbacks like no fast external failover.

Normally you would just leave the next-hop unchanged and set a BGP community. The receiver would then set the correct next-hop by matching the community. That's how remote triggered blackholing (RTBH) works between eBGP peers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.