Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple next-hop self config stanzas generate a list #1362

Merged
merged 1 commit into from
Feb 10, 2021

Conversation

mirceaulinic
Copy link
Member

For example, for the following policy:

luca@bsr1.atl2> show configuration policy-options policy-statement INTERNAL-ATL2-RR-OUT
term LOCAL-BE {
    from {
        protocol static;
        community PACKET-BE;
    }
    then {
        local-preference 500;
        next-hop self;
        accept;
    }
}
term LOCAL-PUBLIC {
    from {
        protocol static;
        prefix-list ANNOUNCE-ATL2-V4;
    }
    then {
        local-preference 500;
        next-hop self;
        accept;
    }
}
term LOCAL-CUSTOMERS {
    from {
        protocol bgp;
        community PACKET-ATL2-CUSTOMER;
        route-filter 0.0.0.0/0 upto /24;
    }
    then {
        next-hop self;
        accept;
    }
}
term GLOBAL-IP {
    from {
        protocol bgp;
        community PACKET-ATL2-GLOBAL-IP;
    }
    then {
        next-hop self;
        accept;
    }
}
term EVPN-REJECT-DEFAULT {
    from {
        protocol evpn;
        route-filter 0.0.0.0/0 exact;
    }
    then reject;
}
term EVPN-PACKET-INTERNAL {
    from {
        family evpn;
        community PACKET-INTERNAL-RT;
    }
    then accept;
}
then reject;

nhs_policies[p] would be a list: [True, True, True, True].

Therefore, in case nhs_policies[p] is a list, then there's at least
one next-hop self knob configured in the policy, so it can be marked as
NHS-type policy.

For example, for the following policy:

```
luca@bsr1.atl2> show configuration policy-options policy-statement INTERNAL-ATL2-RR-OUT
term LOCAL-BE {
    from {
        protocol static;
        community PACKET-BE;
    }
    then {
        local-preference 500;
        next-hop self;
        accept;
    }
}
term LOCAL-PUBLIC {
    from {
        protocol static;
        prefix-list ANNOUNCE-ATL2-V4;
    }
    then {
        local-preference 500;
        next-hop self;
        accept;
    }
}
term LOCAL-CUSTOMERS {
    from {
        protocol bgp;
        community PACKET-ATL2-CUSTOMER;
        route-filter 0.0.0.0/0 upto /24;
    }
    then {
        next-hop self;
        accept;
    }
}
term GLOBAL-IP {
    from {
        protocol bgp;
        community PACKET-ATL2-GLOBAL-IP;
    }
    then {
        next-hop self;
        accept;
    }
}
term EVPN-REJECT-DEFAULT {
    from {
        protocol evpn;
        route-filter 0.0.0.0/0 exact;
    }
    then reject;
}
term EVPN-PACKET-INTERNAL {
    from {
        family evpn;
        community PACKET-INTERNAL-RT;
    }
    then accept;
}
then reject;
```

`nhs_policies[p]` would be a list: `[True, True, True, True]`.

Therefore, in case `nhs_policies[p]` is a list, then there's at least
one next-hop self knob configured in the policy, so it can be marked as
NHS-type policy.
@coveralls
Copy link

coveralls commented Jan 19, 2021

Coverage Status

Coverage increased (+0.002%) to 81.103% when pulling eff855f on issue-1359 into 036ddc3 on develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants