This is a follow up of [1] [1] https://review.opendev.org/c/openstack/ovn-bgp-agent/+/903407 Change-Id: Ifda13d090b1e298ae8b5393a313c2ea4df105fcb
2.4 KiB
BGP Advertisement
The OVN BGP Agent (both SB and NB drivers) is in charge of triggering FRR (IP routing protocol suite for Linux which includes protocol daemons for BGP, OSPF, RIP, among others) to advertise/withdraw directly connected routes via BGP. To do that, when the agent starts, it ensures that:
FRR local instance is reconfigured to leak routes for a new VRF. To do that it uses
vtysh shell. It connects to the existsing FRR socket (--vty_socketoption) and executes the next commands, passing them through a file (-c FILE_NAMEoption):router bgp {{ bgp_as }} address-family ipv4 unicast import vrf {{ vrf_name }} exit-address-family address-family ipv6 unicast import vrf {{ vrf_name }} exit-address-family router bgp {{ bgp_as }} vrf {{ vrf_name }} bgp router-id {{ bgp_router_id }} address-family ipv4 unicast redistribute connected exit-address-family address-family ipv6 unicast redistribute connected exit-address-familyThere is a VRF created (the one leaked in the previous step), by default with name
bgp-vrf.There is a dummy interface type (by default named
bgp-nic), associated to the previously created VRF device.Ensure ARP/NDP is enabled at OVS provider bridges by adding an IP to it.
Then, to expose the VMs/LB IPs as they are created (or upon
initialization or re-sync), since the FRR configuration has the
redistribute connected option enabled, the only action
needed to expose it (or withdraw it) is to add it (or remove it) from
the bgp-nic dummy interface. Then it relies on Zebra to do
the BGP advertisement, as Zebra detects the addition/deletion of the IP
on the local interface and advertises/withdraws the route:
$ ip addr add IPv4/32 dev bgp-nic $ ip addr add IPv6/128 dev bgp-nicNote
As we also want to be able to expose VM connected to tenant networks (when
expose_tenant_networksorexpose_ipv6_gua_tenant_networksconfiguration options are enabled), there is a need to expose the Neutron router gateway port (cr-lrp on OVN) so that the traffic to VMs in tenant networks is injected into OVN overlay through the node that is hosting that port.