From 29cd4ee90ebd024da45d88c5336753a48414dd70 Mon Sep 17 00:00:00 2001 From: FAELIX SALT Date: Thu, 2 Apr 2020 22:24:38 +0000 Subject: [PATCH] need to be able to accept most-specific prefixes from downstreams --- vyos.conf.j2 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/vyos.conf.j2 b/vyos.conf.j2 index 89cc66f..a26f090 100644 --- a/vyos.conf.j2 +++ b/vyos.conf.j2 @@ -1214,7 +1214,7 @@ policy { continue {% if group['continue'] == 'next' %}{{ loop.index+1 }}{% else %}{{ group['continue'] }}{% endif %} {% endif %} set { - {% if 'set-community' in group %}community {{ group['set-community'] }}{% endif %} + {% if 'add-community' in group %}community "additive {{ group['add-community'] }}"{% elif 'set-community' in group %}community {{ group['set-community'] }}{% endif %} {% if 'set-local-preference' in group %}local-preference {{ group['set-local-preference'] }}{% endif %} } } @@ -1232,8 +1232,12 @@ policy { rule {{ loop.index }} { action permit prefix {{ prefix['prefix'] }} - {% if prefix.get('less-equal',None) != None %}le {{ prefix['less-equal'] }}{% endif %} - {% if prefix.get('greater-equal',None) != None %}ge {{ prefix['greater-equal'] }}{% endif %} + {% if prefix_data['bgpq3'].get('most-specific',False) %} + le 32 + {% else %} + {% if prefix.get('less-equal',None) != None %}le {{ prefix['less-equal'] }}{% endif %} + {% if prefix.get('greater-equal',None) != None %}ge {{ prefix['greater-equal'] }}{% endif %} + {% endif %} } {% endfor %} {% elif 'static' in prefix_data %} @@ -1263,8 +1267,12 @@ policy { rule {{ loop.index }} { action permit prefix {{ prefix['prefix'] }} - {% if prefix.get('less-equal',None) != None %}le {{ prefix['less-equal'] }}{% endif %} - {% if prefix.get('greater-equal',None) != None %}ge {{ prefix['greater-equal'] }}{% endif %} + {% if prefix_data['bgpq3'].get('most-specific',False) %} + le 128 + {% else %} + {% if prefix.get('less-equal',None) != None %}le {{ prefix['less-equal'] }}{% endif %} + {% if prefix.get('greater-equal',None) != None %}ge {{ prefix['greater-equal'] }}{% endif %} + {% endif %} } {% endfor %} {% elif 'static' in prefix_data %}