sonic-buildimage/dockers/docker-fpm-frr
abdosi 7059f42385
[chassis/multi-asic] Make sure iBGP session established as directly connected (#16777)
What I did:
Make Sure for internal iBGP we are one-hop away (directly connected) by using Generic TTL security mechanism.

Why I did:
Without this change it's possible on packet chassis i-BGP can be established even if there no direct connection. Below is the example

- Let's say we have 3 LC's LC1/LC2/LC3 each having i-BGP session session with each other over Loopback4096
- Each LC's have static route towards other LC's Loopback4096 to establish i-BGP session
- LC1 learn default route 0.0.0.0/0 from it's e-BGP peers and send it over to LC2 and LC3 over i-BGP
- Now for some reason on LC2 static route towards LC3 is removed/not-present/some-issue we expect i-BGP session should go down between LC2 and LC3
- However i-BGP between LC2 and LC3 does not go down because of feature ip nht-resolve-via-default  where LC2 will use default route to reach Loopback4096 of LC3. As it's using default route BGP packets from LC2 towards LC3 will first route to LC1 and then go to LC3 from there.

Above scenario can result in packet mis-forwarding on data plane

How I fixed it:-

To make sure BGP packets between i-BGP peers are not going with extra routing hop enable using GTSM feature

neighbor PEER ttl-security hops NUMBER

This command enforces Generalized TTL Security Mechanism (GTSM), as specified in RFC 5082. With this command, only neighbors that are the specified number of hops away will be allowed to become neighbors. This command is mutually exclusive with ebgp-multihop.

We set hop count as 1 which makes FRR to reject BGP connection if we receive BGP packets if it's TTL < 255. Also setting this attribute make sure i-BGP frames are originated with IP TTL of 255.

How I verify:

Manual Verification of above scenario. See blow BGP packets receive with IP TTL 254 (additional routing hop) we are seeing FIN TCP flags as BGP is rejecting the connection

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
2023-10-10 11:51:40 -07:00
..
base_image_files [bgp]: Add sudo check for TSA/B/C command execution (#15288) 2023-06-03 23:47:26 +02:00
frr [chassis/multi-asic] Make sure iBGP session established as directly connected (#16777) 2023-10-10 11:51:40 -07:00
.dockerignore [docker-fpm-frr]:filter out the file of 'Dockerfile.j2' from the 'docker-fpm-frr' image. (#3507) 2019-09-27 12:43:44 -07:00
bgp_regex.json Add rsyslog plugin support for frr log (#16192) 2023-09-12 16:53:45 -07:00
docker_init.sh Timezone sync issue between the host and containers (#14000) 2023-06-25 16:36:09 -07:00
Dockerfile.j2 Load generic omprog in all dockers for rsyslog plugin support (#16601) 2023-09-20 16:27:42 -07:00
events_info.json Streaming structured events implementation (#11848) 2022-09-03 07:33:25 -07:00
snmp.conf [FRR] Enable SNMP support (#2981) 2019-06-19 01:24:42 -07:00
TS Changes to support TSA from supervisor (#14691) 2023-04-28 16:28:06 +08:00
TSA Fixes for errors seen in staging devices (#7171) 2021-04-08 15:16:43 -07:00
TSB Fixes for errors seen in staging devices (#7171) 2021-04-08 15:16:43 -07:00
TSC Fixes for errors seen in staging devices (#7171) 2021-04-08 15:16:43 -07:00
vtysh.conf [sonic-frr]: FRR 4.0 integration with SONiC (#2099) 2018-10-02 10:24:59 -07:00
zsocket.sh [FRR] Create a separate script to wait zebra to be ready to receive connections (#6519) 2021-01-27 12:36:02 -08:00