Skip to content

Commit

Permalink
Template change for BGP monitors on T2 (sonic-net#14844)
Browse files Browse the repository at this point in the history
Why I did it
To support BGPMon sessions from each T2 linecard ASIC

Work item tracking
Microsoft ADO (number only): 17873174
How I did it
Added change in BGPMon configuration to use Loopback4096 as source interface, since this has a unique IP per ASIC.

How to verify it
Tested by manually setting up BGPMon session on T2 LC and verified that Loopback4096 could be used as source
  • Loading branch information
tjchadaga authored and root committed Jun 3, 2023
1 parent 4e5f088 commit aea8921
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@
! template: bgpd/templates/BGPMON/peer-group.conf.j2
!
neighbor BGPMON peer-group
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
neighbor BGPMON update-source Loopback4096
{% else %}
neighbor BGPMON update-source {{ loopback0_ipv4 | ip }}
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
{% endif %}

address-family ipv4
neighbor BGPMON activate
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
exit-address-family

{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
address-family ipv6
neighbor BGPMON activate
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
exit-address-family
{% endif %}
!
! end of template: bgpd/templates/BGPMON/peer-group.conf.j2
!

1 change: 1 addition & 0 deletions dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ vni {{ vnet_metadata['vni'] }}
{% block interfaces %}
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
{% for (name, prefix) in INTERFACE|pfx_filter %}
interface {{ name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"CONFIG_DB__DEVICE_METADATA": {
"localhost": {
"type": "LeafRouter"
}
},
"loopback0_ipv4": "1.1.1.1/32"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"CONFIG_DB__DEVICE_METADATA": {
"localhost": {
"type": "SpineRouter"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
!
neighbor BGPMON peer-group
neighbor BGPMON update-source 1.1.1.1
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
address-family ipv4
neighbor BGPMON activate
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
exit-address-family
!
! end of template: bgpd/templates/BGPMON/peer-group.conf.j2
!

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
!
! template: bgpd/templates/BGPMON/peer-group.conf.j2
!
neighbor BGPMON peer-group
neighbor BGPMON update-source Loopback4096
address-family ipv4
neighbor BGPMON activate
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
exit-address-family
address-family ipv6
neighbor BGPMON activate
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
exit-address-family
!
! end of template: bgpd/templates/BGPMON/peer-group.conf.j2
!
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ agentx
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface Ethernet0
link-detect
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface Ethernet0
link-detect
Expand Down
1 change: 1 addition & 0 deletions src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ vni 20
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface Ethernet0
link-detect
Expand Down
1 change: 1 addition & 0 deletions src/sonic-config-engine/tests/sample_output/py2/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ agentx
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface PortChannel03
link-detect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ vni 9000
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface Ethernet8
link-detect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ vni 8000
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface Ethernet8
link-detect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ log facility local4
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface PortChannel03
link-detect
Expand Down
1 change: 1 addition & 0 deletions src/sonic-config-engine/tests/sample_output/py3/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ agentx
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface PortChannel01
link-detect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ vni 9000
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface Ethernet0
link-detect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ vni 8000
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface Ethernet0
link-detect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ log facility local4
!
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
interface PortChannel01
link-detect
Expand Down

0 comments on commit aea8921

Please sign in to comment.