Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions netsim/ansible/templates/bgp/eos.j2
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,11 @@ router bgp {{ bgp.as }}
{% for n in bgp.neighbors if n[af] is defined and n.activate[af] is defined and n.activate[af] %}
{% set peer = 'ebgp_intf_' + n.local_if if n.local_if is defined else n[af] %}
neighbor {{ peer }} activate
{% if n.type == 'ibgp' and bgp.next_hop_self|default(False) %}
{% set nhs = n.next_hop_self|default(False) %}
{% if nhs == 'ebgp' %}
neighbor {{ peer }} route-map next-hop-self-{{ af }} out
{% endif %}
{% if n.type == 'confed_ebgp' and bgp.next_hop_self|default(False) %}
neighbor {{ peer }} next-hop-self
{% endif %}
{% if n.type == 'localas_ibgp' %}
{% else %}
neighbor {{ peer }} next-hop-self
neighbor {{ peer }} route-reflector-client
{% endif %}
{% if n.local_if is defined and af == 'ipv4' %}
neighbor {{ peer }} next-hop address-family ipv6 originate
Expand Down
7 changes: 1 addition & 6 deletions netsim/ansible/templates/bgp/eos.macro.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@
{% if n._source_intf is defined %}
neighbor {{ peer }} update-source {{ n._source_intf.ifname }}
{% endif %}
{% if n.type == 'localas_ibgp' %}
neighbor {{ peer }} next-hop-peer
{% endif %}
{% if 'ibgp' in n.type %}
{% if bgp.rr|default('') and not n.rr|default('') %}
{% if n.rr_client|default(False) %}
neighbor {{ peer }} route-reflector-client
{% endif %}
{% endif %}
{% if n.type in bgp.community|default({}) %}
neighbor {{ peer }} send-community {%
Expand Down
10 changes: 3 additions & 7 deletions netsim/ansible/templates/bgp/frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,12 @@ router bgp {{ bgp.as }}
else False %}
{% if peer %}
neighbor {{ peer }} activate
{% if n.type in ['ibgp','confed_ebgp'] and bgp.next_hop_self|default(False) %}
neighbor {{ peer }} next-hop-self
{% if n.next_hop_self|default(False) %}
neighbor {{ peer }} next-hop-self{% if n.next_hop_self == 'all' %} force{% endif +%}
{% endif %}
{% if n.type == 'ibgp' and bgp.rr|default('') and not n.rr|default('') %}
{% if n.rr_client|default(False) %}
neighbor {{ peer }} route-reflector-client
{% endif %}
{% if n.type == 'localas_ibgp' %}
neighbor {{ peer }} route-reflector-client
neighbor {{ peer }} next-hop-self force
{% endif %}
{% if n.type in bgp.community|default({}) %}
no neighbor {{ peer }} send-community all
{% for c_type in bgp.community[n.type] %}
Expand Down
10 changes: 3 additions & 7 deletions netsim/ansible/templates/bgp/ios.macro.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@
{% macro neighbor_af(n,ip,bgp) %}
neighbor {{ ip }} activate
neighbor {{ ip }} advertisement-interval 0
{% if n.type in ['ibgp','confed_ebgp'] and bgp.next_hop_self|default(False) %}
neighbor {{ ip }} next-hop-self
{% if n.next_hop_self|default(False) %}
neighbor {{ ip }} next-hop-self{% if n.next_hop_self == 'all' %} all{% endif +%}
{% endif %}
{% if n.type == 'ibgp' and bgp.rr|default('') and not n.rr|default('') %}
{% if n.rr_client|default(False) %}
neighbor {{ ip }} route-reflector-client
{% endif %}
{% if n.type == 'localas_ibgp' %}
neighbor {{ ip }} route-reflector-client
neighbor {{ ip }} next-hop-self all
{% endif %}
{% if n.type in bgp.community|default({}) %}
{% for c_type in bgp.community[n.type] %}
neighbor {{ ip }} send-community {{ c_type }}
Expand Down