I'm trying to set the next hop of a BGP route to "self" in a export filter, but I can't seem to figure it out. Here's a sample of what I have setup:

    if ( source = RTS_INHERIT ) then {
        gw =;

protocol bgp SomeRouteReflectorClient {
        local as 65000;
        passive on;
        neighbor as 65000;
        rr client;
        export filter BGP_EXPORT_POLICY;
        import all;

The filter appears to be working correctly (it's matching the routes I expect). However, the gw =; does not work. I've set it to the address of the interface I would like the next hop to be set to, however, I get the following error:

<ERR> filters, line XX: Invalid gw address

Ideally, I would be a keyword for "self" (or there would be some other key word). I'm coming from a Cisco world, so I'm trying to lift and replace an existing setup wherein the next hop of locally originated routes by the route reflector are set to the BGP peer ip of the route reflector.

I don't think I can use next hop self; at the BGP peer level because then all routes get next hop self. The goal is that client to client routes do not get the next hop updated by the route reflector, only routes originated by the route reflector.


You can't use the gw parameter in export filters as it is only valid in import.

| improve this answer | |

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