Skip to content

Commit 4e60f0d

Browse files
authored
Template change for BGP monitors on T2 (sonic-net#14844)
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
1 parent b6b31df commit 4e60f0d

File tree

17 files changed

+78
-9
lines changed

17 files changed

+78
-9
lines changed

dockers/docker-fpm-frr/frr/bgpd/templates/monitors/peer-group.conf.j2

+23-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@
22
! template: bgpd/templates/BGPMON/peer-group.conf.j2
33
!
44
neighbor BGPMON peer-group
5+
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
6+
neighbor BGPMON update-source Loopback4096
7+
{% else %}
58
neighbor BGPMON update-source {{ loopback0_ipv4 | ip }}
6-
neighbor BGPMON route-map FROM_BGPMON in
7-
neighbor BGPMON route-map TO_BGPMON out
8-
neighbor BGPMON send-community
9-
neighbor BGPMON maximum-prefix 1
9+
{% endif %}
10+
11+
address-family ipv4
12+
neighbor BGPMON activate
13+
neighbor BGPMON route-map FROM_BGPMON in
14+
neighbor BGPMON route-map TO_BGPMON out
15+
neighbor BGPMON send-community
16+
neighbor BGPMON maximum-prefix 1
17+
exit-address-family
18+
19+
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
20+
address-family ipv6
21+
neighbor BGPMON activate
22+
neighbor BGPMON route-map FROM_BGPMON in
23+
neighbor BGPMON route-map TO_BGPMON out
24+
neighbor BGPMON send-community
25+
neighbor BGPMON maximum-prefix 1
26+
exit-address-family
27+
{% endif %}
1028
!
1129
! end of template: bgpd/templates/BGPMON/peer-group.conf.j2
1230
!
31+

dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ vni {{ vnet_metadata['vni'] }}
1212
{% block interfaces %}
1313
! Enable nht through default route
1414
ip nht resolve-via-default
15+
ipv6 nht resolve-via-default
1516
! Enable link-detect (default disabled)
1617
{% for (name, prefix) in INTERFACE|pfx_filter %}
1718
interface {{ name }}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2+
"CONFIG_DB__DEVICE_METADATA": {
3+
"localhost": {
4+
"type": "LeafRouter"
5+
}
6+
},
27
"loopback0_ipv4": "1.1.1.1/32"
3-
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"CONFIG_DB__DEVICE_METADATA": {
3+
"localhost": {
4+
"type": "SpineRouter"
5+
}
6+
}
7+
}

src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/result_all.conf

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
!
44
neighbor BGPMON peer-group
55
neighbor BGPMON update-source 1.1.1.1
6-
neighbor BGPMON route-map FROM_BGPMON in
7-
neighbor BGPMON route-map TO_BGPMON out
8-
neighbor BGPMON send-community
9-
neighbor BGPMON maximum-prefix 1
6+
address-family ipv4
7+
neighbor BGPMON activate
8+
neighbor BGPMON route-map FROM_BGPMON in
9+
neighbor BGPMON route-map TO_BGPMON out
10+
neighbor BGPMON send-community
11+
neighbor BGPMON maximum-prefix 1
12+
exit-address-family
1013
!
1114
! end of template: bgpd/templates/BGPMON/peer-group.conf.j2
1215
!
16+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
!
2+
! template: bgpd/templates/BGPMON/peer-group.conf.j2
3+
!
4+
neighbor BGPMON peer-group
5+
neighbor BGPMON update-source Loopback4096
6+
address-family ipv4
7+
neighbor BGPMON activate
8+
neighbor BGPMON route-map FROM_BGPMON in
9+
neighbor BGPMON route-map TO_BGPMON out
10+
neighbor BGPMON send-community
11+
neighbor BGPMON maximum-prefix 1
12+
exit-address-family
13+
address-family ipv6
14+
neighbor BGPMON activate
15+
neighbor BGPMON route-map FROM_BGPMON in
16+
neighbor BGPMON route-map TO_BGPMON out
17+
neighbor BGPMON send-community
18+
neighbor BGPMON maximum-prefix 1
19+
exit-address-family
20+
!
21+
! end of template: bgpd/templates/BGPMON/peer-group.conf.j2
22+
!

src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ agentx
1717
!
1818
! Enable nht through default route
1919
ip nht resolve-via-default
20+
ipv6 nht resolve-via-default
2021
! Enable link-detect (default disabled)
2122
interface Ethernet0
2223
link-detect

src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/interfaces.conf

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
!
22
! Enable nht through default route
33
ip nht resolve-via-default
4+
ipv6 nht resolve-via-default
45
! Enable link-detect (default disabled)
56
interface Ethernet0
67
link-detect

src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ vni 20
2828
!
2929
! Enable nht through default route
3030
ip nht resolve-via-default
31+
ipv6 nht resolve-via-default
3132
! Enable link-detect (default disabled)
3233
interface Ethernet0
3334
link-detect

src/sonic-config-engine/tests/sample_output/py2/frr.conf

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ agentx
2020
!
2121
! Enable nht through default route
2222
ip nht resolve-via-default
23+
ipv6 nht resolve-via-default
2324
! Enable link-detect (default disabled)
2425
interface PortChannel03
2526
link-detect

src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ vni 9000
2626
!
2727
! Enable nht through default route
2828
ip nht resolve-via-default
29+
ipv6 nht resolve-via-default
2930
! Enable link-detect (default disabled)
3031
interface Ethernet8
3132
link-detect

src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ vni 8000
2626
!
2727
! Enable nht through default route
2828
ip nht resolve-via-default
29+
ipv6 nht resolve-via-default
2930
! Enable link-detect (default disabled)
3031
interface Ethernet8
3132
link-detect

src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ log facility local4
2323
!
2424
! Enable nht through default route
2525
ip nht resolve-via-default
26+
ipv6 nht resolve-via-default
2627
! Enable link-detect (default disabled)
2728
interface PortChannel03
2829
link-detect

src/sonic-config-engine/tests/sample_output/py3/frr.conf

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ agentx
2020
!
2121
! Enable nht through default route
2222
ip nht resolve-via-default
23+
ipv6 nht resolve-via-default
2324
! Enable link-detect (default disabled)
2425
interface PortChannel01
2526
link-detect

src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ vni 9000
2626
!
2727
! Enable nht through default route
2828
ip nht resolve-via-default
29+
ipv6 nht resolve-via-default
2930
! Enable link-detect (default disabled)
3031
interface Ethernet0
3132
link-detect

src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ vni 8000
2626
!
2727
! Enable nht through default route
2828
ip nht resolve-via-default
29+
ipv6 nht resolve-via-default
2930
! Enable link-detect (default disabled)
3031
interface Ethernet0
3132
link-detect

src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ log facility local4
2323
!
2424
! Enable nht through default route
2525
ip nht resolve-via-default
26+
ipv6 nht resolve-via-default
2627
! Enable link-detect (default disabled)
2728
interface PortChannel01
2829
link-detect

0 commit comments

Comments
 (0)