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

Use switch ID to generate the switch bgp_as number in combination with a new bgp prefix #4108

Closed
1 task done
chrisgerdener opened this issue Jun 12, 2024 · 2 comments
Closed
1 task done
Labels
type: enhancement New feature or request

Comments

@chrisgerdener
Copy link

Enhancement summary

Since we give our switches bgp_as numbers when defining them as nodes, it would be nice to automatically utilize the switch ID to generate a fitting bgp number, similar to what is done with IP addresses and loopback pools.

Ideally you could define a bgp prefix, either for as.dot (which we use) or decimal notation and then simply add the value of the switch ID onto it.

Which component of AVD is impacted

eos_designs

Use case example

As stated, making use of the ID to simplify bgp_as number assignment for nodes.

Describe the solution you would like

There would be one new key "bgp_as_prefix" that is defined once for all switches and then a routine that adds the switch ID to the prefix.

Today, the bgp_as number is defined for each node individually

  • name: SWITCHNAME
    id: 11
    bgp_as: "12345.00011"

For this feature request I imagine it simplified

bgp_as_prefix: "12345.00"

  • name: SWITCHNAME
    id: 11

resulting in the same bgp_as number of "12345.00011" being configured.

Describe alternatives you have considered

No response

Additional context

No response

Contributing Guide

  • I agree to follow this project's Code of Conduct
@chrisgerdener chrisgerdener added the type: enhancement New feature or request label Jun 12, 2024
@ClausHolbechArista
Copy link
Contributor

ClausHolbechArista commented Jun 12, 2024

Hi Chris, I think we can do that already.
Try setting bgp_as: "12345.0-65535". I know it won't configure the leading zeroes, but that will not be shown in EOS either, so I think this will be what you want.
Note that we do not tackle the dot-notation in eos_designs yet, so you will have to add that yourself to with structured config like:

custom_structured_configuration_router_bgp:
  as_notation: asdot

details: https://avd.sh/en/devel/roles/eos_cli_config_gen/docs/input-variables.html?h=asdot#router-bgp

We are tracking to get asdot support in eos_designs (#3659), but it has not been picked up yet.

Please confirm if this works and close the issue if so. Please use discussions for general question.

Thanks!

@chrisgerdener
Copy link
Author

Hi Claus,

This solution does work. Next time I will make a discussion post first. Many thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants