Start dev (#4)
* Add Netbox configuration and plugins * Add Containerlab topology * Add template * Update Documentation
This commit is contained in:
44
templates/leaves.j2
Normal file
44
templates/leaves.j2
Normal file
@@ -0,0 +1,44 @@
|
||||
{# Interface Configuration #}
|
||||
{% for interface in device.interfaces.all() %}
|
||||
interface {{ interface.name }}
|
||||
{%- if interface.description %}
|
||||
description {{ interface.description }}
|
||||
{%- endif %}
|
||||
no shutdown
|
||||
no switchport
|
||||
ip address {{ ipam.IPAddress.objects.get(assigned_object_id=interface.id).address }}
|
||||
mtu 9214
|
||||
!
|
||||
{% endfor %}
|
||||
|
||||
{# BGP Configuration #}
|
||||
{% set loopback_interface = device.interfaces.get(name='Loopback0') %}
|
||||
{% set router_id = ipam.IPAddress.objects.get(assigned_object_id=loopback_interface.id).address %}
|
||||
router bgp {{ device.custom_field_data.ASN }}
|
||||
router-id {{ router_id }}
|
||||
maximum-paths 4 ecmp 4
|
||||
neighbor SPINE_GROUP peer group
|
||||
neighbor SPINE_GROUP allowas-in 1
|
||||
neighbor SPINE_GROUP ebgp-multihop 4
|
||||
neighbor SPINE_GROUP send-community extended
|
||||
neighbor SPINE_GROUP maximum-routes 12000
|
||||
{%- for interface in device.interfaces.all() %}
|
||||
{%- if interface.connected_endpoints and interface.name != 'Ethernet3' %}
|
||||
{%- for remote_interface in interface.connected_endpoints %}
|
||||
{%- set remote_ip = ipam.IPAddress.objects.get(assigned_object_id=remote_interface.id) %}
|
||||
neighbor {{ remote_ip.address }} peer group SPINE_GROUP
|
||||
neighbor {{ remote_ip.address }} remote-as {{ remote_interface.device.custom_field_data.ASN }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
!
|
||||
address-family ipv4
|
||||
{%- for interface in device.interfaces.all() %}
|
||||
{%- if interface.connected_endpoints and interface.name != 'Ethernet3' %}
|
||||
{%- for remote_interface in interface.connected_endpoints %}
|
||||
{%- set remote_ip = ipam.IPAddress.objects.get(assigned_object_id=remote_interface.id) %}
|
||||
neighbor {{ remote_ip.address }} activate
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
!
|
||||
Reference in New Issue
Block a user