-
Notifications
You must be signed in to change notification settings - Fork 1.5k
frrcfgd: does not push 'ip protocol bgp route-map', resulting in incorrect default source address selection #14195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In case it's intentional that by default this is not configured, here's a patch that adds support for configuring it manually through the config DB: genesiscloud@c2ec9bf |
Is there any chance of pushing the above proposal upstream? |
@lukasstockner @matofeder Can you create a pull request for review? |
I'm on it |
Here's a PR: #20332 Who should I add as reviewers? |
I added this commit that should add ipv6 support for the The main differences from #20332 are:
|
For what it is worth, I ended up adding the following workaround on my switches. Posting it here in case it is of use to anyone else. /usr/local/bin/set-default-source-ip#!/bin/bash -x
# Set the default source address for BGP routes to the Loopback0 address.
# Assumes there is only a single IPv4 address configured on Loopback0.
# Workaround for https://github.com/sonic-net/sonic-buildimage/issues/14195
# [email protected] 2025
SRCIP=$(sonic-db-cli CONFIG_DB KEYS 'LOOPBACK_INTERFACE|Loopback0|*')
SRCIP=${SRCIP#LOOPBACK_INTERFACE|Loopback0|}
SRCIP=${SRCIP%/32}
if test -z "$SRCIP"; then
echo "ERROR: unable to determine Loopback0 IP address"
exit 1
fi
/usr/bin/vtysh \
--echo \
--command 'configure' \
--command 'route-map RM_SET_SRC permit 10' \
--command "set src ${SRCIP}" \
--command 'exit' \
--command 'ip protocol bgp route-map RM_SET_SRC' /etc/systemd/system/set-default-source-ip.service[Unit]
Description=Set default source IP for BGP routes
Requires=bgp.service
After=bgp.service
[Service]
ExecStart=/usr/local/bin/set-default-source-ip
Restart=on-failure
RestartSec=5
RemainAfterExit=true
[Install]
WantedBy=bgp.service
Enable with |
Description
When using the FRR configuration management framework, the route-map that ensures that locally originated traffic (e.g., ICMP errors) are sourced from the
Loopback0
address is no longer included in the FRR configuration by default, nor does it seem possible to manually create it from entries in ConfigDB.This results in 240.127.1.1 (assigned to
docker0
) inappropriately being used as the default source address for locally originated traffic that are routed to interfaces without IPv4 addresses assigned, which is the case for routes learned from unnumbered BGP neighbours, for example.Steps to reproduce the issue:
bgp
container:Describe the results you received:
The
ip protocol bgp route-map
configuration is missing:It is possible to take it one step further and establish some unnumbered BGP peerings where some routes are being learned. Observing the routing table with
ip route
will then reveal that thesrc
attribute is missing. Attempting, e.g.,ping <remote-ip-learned-from-unnumberd-BGP>
will use 240.127.1.1 as the source address and will therefore not receive any replies.Describe the results you expected:
A
ip protocol bgp route-map
should have been created to set the default source address to the one assigned toLoopback0
, this should have been visible in the output fromip route
, andping <remote-ip-learned-from-unnumberd-BGP>
should have used theLoopback0
address and should have received responses.Alternatively, the current behaviour could have been acceptable as the default, but only if there was some other way for the user to manually instruct
frrcfgd
to create the necessary FRR configuration from ConfigDB keys. However, after reading through the documentation and the templates I have come to the conclusion that this is currently not possible.Output of
show version
:Output of
show techsupport
:sonic_dump_sonic_20230310_092339.tar.gz
Additional information you deem important (e.g. issue happens only occasionally):
This is the template that renders the necessary FRR configuration when the FRR configuration management framework is not in use: zebra.set_src.conf.j2.
The text was updated successfully, but these errors were encountered: