Skip to content
Open
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
23 changes: 23 additions & 0 deletions dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
ip prefix-list PL_LoopbackV4 permit {{ lo0_ipv4 }}/32
{% endif %}
!
{# Check if the device is a disaggregated T2 device #}
{% set disagg_t2 = "false" %}
{% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('type' in DEVICE_METADATA['localhost']) %}
{% if DEVICE_METADATA['localhost']['type'].lower() in ['lowerspinerouter', 'upperspinerouter', 'fabricspinerouter']%}
{% set disagg_t2 = "true" %}
{% endif%}
{% endif %}
{% if get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback0") != 'None' %}
{% if ( ('localhost' in DEVICE_METADATA) and ('bgp_adv_lo_prefix_as_128' in DEVICE_METADATA['localhost']) and
(DEVICE_METADATA['localhost']['bgp_adv_lo_prefix_as_128'] == 'true') ) %}
Expand Down Expand Up @@ -57,6 +64,14 @@ route-map V6_CONNECTED_ROUTES permit 10
!
route-map HIDE_INTERNAL permit 10
set community no-export
{% if disagg_t2 == "true" %}
{% if constants.bgp.hide_internal_community is defined %}
on-match next
!
route-map HIDE_INTERNAL permit 20
set community {{ constants.bgp.hide_internal_community }} additive
{% endif %}
{% endif %}
{% if constants.bgp.peers is defined and constants.bgp.peers.internal is defined and constants.bgp.peers.internal.community is defined %}
on-match next
route-map HIDE_INTERNAL permit 20
Expand All @@ -68,6 +83,14 @@ route-map HIDE_INTERNAL permit 20
{% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('bgp_asn' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['bgp_asn'].lower() != 'none') and (DEVICE_METADATA['localhost']['bgp_asn'].lower() != 'null') %}
router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
!
{% if disagg_t2 == "true" %}
{% if (BGP_DEVICE_GLOBAL is defined) and ('CONFED' in BGP_DEVICE_GLOBAL) and ('asn' in BGP_DEVICE_GLOBAL['CONFED'] ) %}
bgp confederation identifier {{ BGP_DEVICE_GLOBAL['CONFED']['asn'] }}
{% endif %}
{% if (BGP_DEVICE_GLOBAL is defined) and ('CONFED' in BGP_DEVICE_GLOBAL) and ('peers' in BGP_DEVICE_GLOBAL['CONFED'] ) %}
bgp confederation peers {{ BGP_DEVICE_GLOBAL['CONFED']['peers'] | replace(';', ' ') }}
{% endif %}
{% endif %}
{% block bgp_init %}
bgp log-neighbor-changes
bgp suppress-fib-pending
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
{% elif neighbor_addr | ipv6 %}
neighbor {{ neighbor_addr }} peer-group VOQ_CHASSIS_V6_PEER
{% endif %}
neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }}
neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }}
neighbor {{ neighbor_addr }} timers 2 7
neighbor {{ neighbor_addr }} timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
! template: bgpd/templates/voq_chassis/peer-group.conf.j2
!
neighbor VOQ_CHASSIS_V4_PEER peer-group
{% if 'bgp_asn' in CONFIG_DB__DEVICE_METADATA['localhost'] %}
neighbor VOQ_CHASSIS_V4_PEER remote-as {{ CONFIG_DB__DEVICE_METADATA['localhost']['bgp_asn'] }}
{% endif %}
neighbor VOQ_CHASSIS_V6_PEER peer-group
{% if 'bgp_asn' in CONFIG_DB__DEVICE_METADATA['localhost'] %}
neighbor VOQ_CHASSIS_V6_PEER remote-as {{ CONFIG_DB__DEVICE_METADATA['localhost']['bgp_asn'] }}
{% endif %}

address-family ipv4
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %}
neighbor VOQ_CHASSIS_V4_PEER allowas-in 1
Expand Down
1 change: 1 addition & 0 deletions files/image_config/constants/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ constants:
internal_community_match_tag: 201
route_do_not_send_appdb_tag: 202
route_eligible_for_fallback_to_default_tag: 203
hide_internal_community: 55555:55555
families:
- ipv4
- ipv6
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
!
! template: bgpd/bgpd.main.conf.j2
!
! bgp multiple-instance
!
! BGP configuration
!
! TSA configuration
!
ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32
!
ip prefix-list V4_P2P_IP permit 0.0.0.0/0 ge 31 le 31
!
ipv6 prefix-list V6_P2P_IP permit ::/0 ge 126 le 126
!
route-map V4_CONNECTED_ROUTES permit 10
match ip address prefix-list V4_P2P_IP
call HIDE_INTERNAL
!
route-map V6_CONNECTED_ROUTES permit 10
match ipv6 address prefix-list V6_P2P_IP
call HIDE_INTERNAL
!
route-map HIDE_INTERNAL permit 10
set community no-export
!
router bgp 65001
!
bgp confederation identifier 65000
bgp confederation peers 65001
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
bgp router-id 55.55.55.55
!
network 55.55.55.55/32
!
address-family ipv4
redistribute connected route-map V4_CONNECTED_ROUTES
exit-address-family
address-family ipv6
redistribute connected route-map V6_CONNECTED_ROUTES
exit-address-family
!
! end of template: bgpd/bgpd.main.conf.j2
!
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"DEVICE_METADATA": {
"localhost": {
"bgp_asn": "65001",
"sub_role": "FrontEnd",
"type": "UpperSpineRouter"
}
},
"BGP_DEVICE_GLOBAL": {
"CONFED" : {
"asn": "65000",
"peers": "65001"
}
},
"LOOPBACK_INTERFACE": {
"Loopback0|55.55.55.55/32": {},
"Loopback1|fc00::1/128": {}
},
"constants": {
"bgp": {
"multipath_relax": {},
"graceful_restart": {},
"maximum_paths": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
!
! template: bgpd/bgpd.main.conf.j2
!
! bgp multiple-instance
!
! BGP configuration
!
! TSA configuration
!
ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32
!
router bgp 65001
!
bgp confederation identifier 65000
bgp confederation peers 65001
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
bgp router-id 55.55.55.55
!
network 55.55.55.55/32
!
! end of template: bgpd/bgpd.main.conf.j2
!
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"DEVICE_METADATA": {
"localhost": {
"bgp_asn": "65001",
"type": "FabricSpineRouter"
}
},
"BGP_DEVICE_GLOBAL": {
"CONFED" : {
"asn": "65000",
"peers": "65001"
}
},
"LOOPBACK_INTERFACE": {
"Loopback0|55.55.55.55/32": {},
"Loopback1|fc00::1/128": {}
},
"constants": {
"bgp": {
"multipath_relax": {},
"graceful_restart": {},
"maximum_paths": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
!
! template: bgpd/bgpd.main.conf.j2
!
! bgp multiple-instance
!
! BGP configuration
!
! TSA configuration
!
ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32
!
router bgp 65001
!
bgp confederation identifier 65000
bgp confederation peers 65001 65002
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
bgp router-id 55.55.55.55
!
network 55.55.55.55/32
!
! end of template: bgpd/bgpd.main.conf.j2
!
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"DEVICE_METADATA": {
"localhost": {
"bgp_asn": "65001",
"type": "LowerSpineRouter"
}
},
"BGP_DEVICE_GLOBAL": {
"CONFED" : {
"asn": "65000",
"peers": "65001;65002"
}
},
"LOOPBACK_INTERFACE": {
"Loopback0|55.55.55.55/32": {},
"Loopback1|fc00::1/128": {}
},
"constants": {
"bgp": {
"multipath_relax": {},
"graceful_restart": {},
"maximum_paths": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
!
! template: bgpd/bgpd.main.conf.j2
!
! bgp multiple-instance
!
! BGP configuration
!
! TSA configuration
!
ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32
!
router bgp 65001
!
bgp confederation identifier 65000
bgp confederation peers 65001
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
bgp router-id 55.55.55.55
!
network 55.55.55.55/32
!
! end of template: bgpd/bgpd.main.conf.j2
!
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"DEVICE_METADATA": {
"localhost": {
"bgp_asn": "65001",
"type": "UpperSpineRouter"
}
},
"BGP_DEVICE_GLOBAL": {
"CONFED" : {
"asn": "65000",
"peers": "65001"
}
},
"LOOPBACK_INTERFACE": {
"Loopback0|55.55.55.55/32": {},
"Loopback1|fc00::1/128": {}
},
"constants": {
"bgp": {
"multipath_relax": {},
"graceful_restart": {},
"maximum_paths": {}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER
neighbor 10.10.10.10 remote-as 555
neighbor 10.10.10.10 description internal1
neighbor 10.10.10.10 timers 2 7
neighbor 10.10.10.10 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER
neighbor fc00::01 remote-as 555
neighbor fc00::01 description internal1
neighbor fc00::01 timers 2 7
neighbor fc00::01 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER
neighbor 10.10.10.10 remote-as 555
neighbor 10.10.10.10 description internal1
neighbor 10.10.10.10 timers 2 7
neighbor 10.10.10.10 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER
neighbor fc00::01 remote-as 555
neighbor fc00::01 description internal1
neighbor fc00::01 timers 2 7
neighbor fc00::01 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER
neighbor 10.10.10.10 remote-as 555
neighbor 10.10.10.10 description internal1
neighbor 10.10.10.10 timers 2 7
neighbor 10.10.10.10 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER
neighbor 10.10.10.10 remote-as 555
neighbor 10.10.10.10 description internal1
neighbor 10.10.10.10 timers 2 7
neighbor 10.10.10.10 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER
neighbor fc00::01 remote-as 555
neighbor fc00::01 description internal1
neighbor fc00::01 timers 2 7
neighbor fc00::01 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER
neighbor fc00::01 remote-as 555
neighbor fc00::01 description internal1
neighbor fc00::01 timers 2 7
neighbor fc00::01 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER
neighbor 10.10.10.10 remote-as 555
neighbor 10.10.10.10 description internal1
neighbor 10.10.10.10 timers 2 7
neighbor 10.10.10.10 timers connect 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
bgp bestpath peer-type multipath-relax
!
neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER
neighbor 10.10.10.10 remote-as 555
neighbor 10.10.10.10 description internal1
neighbor 10.10.10.10 timers 2 7
neighbor 10.10.10.10 timers connect 10
Expand Down
Loading
Loading