pierky / arouteserver

A tool to automatically build (and test) feature-rich configurations for BGP route servers.
https://arouteserver.readthedocs.org/
GNU General Public License v3.0
284 stars 46 forks source link

New-line character missing on OpenBGPd template #97

Closed stkonst closed 2 years ago

stkonst commented 2 years ago

Hi @pierky

It seems that we are missing a new-line character at the OpenBGPd template, as the output that is generated for the functions is quite 'compact':

# Prefix: global blacklist
# Reject inbound routes when 'from group clients prefix-set global_black_list_pref' - reject code: 3
allow quick from group clients prefix-set global_black_list_pref set { localpref 1 community delete NO_ADVERTISE ext-community delete $INTCOMM_PREF_OK_ROA ext-community delete $INTCOMM_ROUTE_OK_WL ext-community delete $INTCOMM_PREF_OK_ARINDB ext-community delete $INTCOMM_PREF_OK_REGISTROBRDB ext-community delete $INTCOMM_ORIGIN_OK ext-community delete $INTCOMM_ORIGIN_KO ext-community delete $INTCOMM_PREFIX_OK ext-community delete $INTCOMM_PREFIX_KO ext-community delete $INTCOMM_IRR_REJECT ext-community delete $INTCOMM_RPKI_UNKNOWN ext-community delete $INTCOMM_RPKI_INVALID ext-community delete $INTCOMM_RPKI_VALID  ext-community delete $INTCOMM_NO_EXPORT ext-community delete $INTCOMM_NO_ADVERTISE  community 65500:0 large-community 65500:0:0 community 65500:3 large-community 65500:0:3}

Could we perhaps convert it to the following output, as it improves readability and troubleshooting ?

# Prefix: global blacklist
# Reject inbound routes when 'from group clients prefix-set global_black_list_pref' - reject code: 3
allow quick from group clients prefix-set global_black_list_pref set {
    localpref 1
    community delete NO_ADVERTISE
    ext-community delete $INTCOMM_PREF_OK_ROA
    ext-community delete $INTCOMM_ROUTE_OK_WL
    ext-community delete $INTCOMM_PREF_OK_ARINDB
    ext-community delete $INTCOMM_PREF_OK_REGISTROBRDB
    ext-community delete $INTCOMM_ORIGIN_OK
    ext-community delete $INTCOMM_ORIGIN_KO
    ext-community delete $INTCOMM_PREFIX_OK
    ext-community delete $INTCOMM_PREFIX_KO
    ext-community delete $INTCOMM_IRR_REJECT
    ext-community delete $INTCOMM_RPKI_UNKNOWN
    ext-community delete $INTCOMM_RPKI_INVALID
    ext-community delete $INTCOMM_RPKI_VALID
    ext-community delete $INTCOMM_NO_EXPORT
    ext-community delete $INTCOMM_NO_ADVERTISE
    community 65500:0
    large-community 65500:0:0
    community 65500:3
    large-community 65500:0:3
}

Thanks in advance

pierky commented 2 years ago

(I've edited the original text to make it more readable.)