calico
calico copied to clipboard
Bird Template - "Skipping ourselves" not considering port
Expected Behavior
If a (node specific) peer is defined that points to the own ip address, but a different bgp port than calico is using, it should not be skipped
Current Behavior
Peer is skipped regardless of port. Excerpt of /etc/calico/confd/config/bird.cfg
:
# For peer /host/<redacted>/peer_v4/192.XX.YY.2
# Skipping ourselves (192.XX.YY.2)
# For peer /host/.<redacted>/peer_v4/192.XX.YY.2-38179
# Skipping ourselves (192.XX.YY.2)
Possible Solution
There should also be a check of peer port matches own bgp port, and only in this case, skip it
- https://github.com/projectcalico/calico/blob/master/confd/etc/calico/confd/templates/bird.cfg.template#L207
- https://github.com/projectcalico/calico/blob/master/confd/etc/calico/confd/templates/bird.cfg.template#L249
That seems reasonable enough. Will think it through to see if I can spot any reason that won't work.
Could you share a bit more information on your use case? Why do you need to peer with another agent on the local machine?
We are experimenting with AS per rack. Some nodes are at the same time router (of the spine/leaf topology) as well as calico route reflector servers. So what we are trying to achieve is that the route reflector peer with the leaf routers