natesales / pathvector

Declarative routing platform that automates BGP route optimization and control plane configuration with secure and repeatable routing policy.
https://pathvector.io
MIT License
218 stars 28 forks source link

Adding interface and comments to peers config file. #227

Open Dennis-de-Houx opened 5 months ago

Dennis-de-Houx commented 5 months ago

Adding the following to the peers settings:

Add a general warning to the config file that this file is autogenerated

Examples of yaml file:

cat /etc/pathvector.yml
...
peers:
  Exchange Frankfurt RR:
    comments:
      - "IXP: Exchange"
      - "Location: Frankfurt"
      - "Datacenter: Super Deluxe Datacenter"
    description: "Peering: Exchange - Frankfurt (AS65501) [40Gbit]"
    asn: 65501
    multihop: false
    template: routeserver
    enforce-peer-nexthop: false
    enforce-first-as: false
    listen6: 2a0e:1234:5678:90ab:666::1337
    interface: ens22
    neighbors:
      - 2a0e:1234:5678:90ab:666::1
...

Result of generated config file:

cat /etc/bird/AS65501_EXCHANGE_FRANKFURT_RR.conf
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !!!                THIS FILE IS AUTOGENERATED BY PATHVECTOR               !!!
# !!!  DO NOT EDIT THIS FILE, CHANGES WILL BE OVERRIDEN ON NEXT GENERATION  !!!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#####
# BGP Session: Exchange Frankfurt RR AS65501
#
# IXP: Exchange
# Location: Frankfurt
# Datacenter: Super Deluxe Datacenter
#
#####
define AS65501_EXCHANGE_FRANKFURT_RR_IMPORT_v4 = 500;
define AAS65501_EXCHANGE_FRANKFURT_RR_IMPORT_v6 = 50000;
define AS65501_EXCHANGE_FRANKFURT_RR_PFX_v4 = -empty-;
define AS65501_EXCHANGE_FRANKFURT_PFX_v6 = -empty-;

protocol bgp EXCHANGE_FRANKFURT_RR_AS65501_v6 {
    local 2a0e:1234:5678:90ab:666::1337 as ASN port 179;
    interface "ens22";
    neighbor 2a0e:1234:5678:90ab:666::1 as 24381 port 179;
    description "Peering: Exchange - Frankfurt (AS65501) [40Gbit]";
...