From e6b58a06f88c895c8f6f000687554fab27d1e93e Mon Sep 17 00:00:00 2001 From: Marek Isalski Date: Sat, 22 Feb 2020 15:18:17 +0000 Subject: [PATCH] add route-reflector and route-server; fix for NetBox 2.7.x --- vyos.conf.j2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vyos.conf.j2 b/vyos.conf.j2 index b064fd9..c4857d0 100644 --- a/vyos.conf.j2 +++ b/vyos.conf.j2 @@ -54,7 +54,7 @@ interfaces { } {% endif %} } -{% elif iface_data.get('form_factor',{}).get('label','') != 'Virtual' %} +{% elif iface_data.get('type',{}).get('label','') != 'Virtual' %} ethernet {{ iface_name }} { description "{{ iface_data['description'].replace('"','\\"') or "-" }}{% if iface_data['connected_endpoint'] and iface_data['connected_endpoint']['connection_status']['value'] %} ({% if iface_data['connected_endpoint']['device'] %}{{ iface_data['connected_endpoint']['name'] }} @ {{ iface_data['connected_endpoint']['device']['display_name'] }}{% endif %}){% endif %}" {% for address in iface_data['addresses'] %} @@ -233,7 +233,6 @@ protocols { address-family { {% if as_data['address-family'].get('ipv4-unicast',None) %} ipv4-unicast { - {% if as_data['address-family']['ipv4-unicast'].get('route-reflector-client',False) %}route-reflector-client{% endif %} redistribute { {% for redistribute, redist_data in as_data['address-family']['ipv4-unicast'].get('redistribute',{}).items() %} {{ redistribute }} { @@ -250,7 +249,6 @@ protocols { {% endif %} {% if as_data['address-family'].get('ipv6-unicast',None) %} ipv6-unicast { - {% if as_data['address-family']['ipv6-unicast'].get('route-reflector-client',False) %}route-reflector-client{% endif %} redistribute { {% for redistribute, redist_data in as_data['address-family']['ipv6-unicast'].get('redistribute',{}).items() %} {{ redistribute }} { @@ -279,6 +277,8 @@ protocols { address-family { {% if 'ipv4-unicast' in neighbor_data['address-family'] %} ipv4-unicast { + {% if neighbor_data['address-family']['ipv4-unicast'].get('route-reflector-client',False) %}route-reflector-client{% endif %} + {% if neighbor_data['address-family']['ipv4-unicast'].get('route-server-client',False) %}route-server-client{% endif %} {% if 'prefix-list' in neighbor_data['address-family']['ipv4-unicast'] %} prefix-list { {% if 'export' in neighbor_data['address-family']['ipv4-unicast']['prefix-list'] %}export {{ neighbor_data['address-family']['ipv4-unicast']['prefix-list']['export'] }}{% endif %} @@ -313,6 +313,8 @@ protocols { {% endif %} {% if 'ipv6-unicast' in neighbor_data['address-family'] %} ipv6-unicast { + {% if neighbor_data['address-family']['ipv6-unicast'].get('route-reflector-client',False) %}route-reflector-client{% endif %} + {% if neighbor_data['address-family']['ipv6-unicast'].get('route-server-client',False) %}route-server-client{% endif %} {% if 'prefix-list' in neighbor_data['address-family']['ipv6-unicast'] %} prefix-list { {% if 'export' in neighbor_data['address-family']['ipv6-unicast']['prefix-list'] %}export {{ neighbor_data['address-family']['ipv6-unicast']['prefix-list']['export'] }}{% endif %}