fortinet-solutions-cse / sdwan-advpn-reference

Jinja Orchestrator for Fortinet SD-WAN/ADVPN
56 stars 12 forks source link

fix BGP communities for regions with 4-byte ASN #21

Closed dmitryperets closed 11 months ago

dmitryperets commented 11 months ago

FOS supports 4-byte Autonomous System Numbers (ASNs), but it doesn't support using them in BGP communities (rfc5668).

For this reason, a new optional parameter is introduced:

{% set short_community_as = '65000' %}

Its effect is the following:

For example, Jinja applies the following community (in "03-Edge-Routing.j2" and "03-Hub-Routing.j2"):

  edit "SLA_OK"
    config rule
      edit 1
        set set-community "{{ community_as }}:99"
      next
    end
  next

For a region with a 2-byte ASN = 65001, the SLA_OK community will simply have a value of "65001:99". For a region with a 4-byte ASN > 65536, the SLA_OK community will use the new parameter. Its default value is "65000", so that the SLA_OK community will, by default, have a value of "65000:99" for such regions.