Enable BGP support
User Plane Gateway (UPG) supports Border Gateway Protocol (BGP) with the BIRD2Opens in a new tab daemon, which runs in a VPPTool as a sidecar container. UPG exports the User Equipment (UE) IP addresses, and the BGP daemon can announce them to edge gateways.
The UPG pod with BGP support includes an init container and several main containers:
- Main container
fpp - BGP daemon container using VPPTool
bird2 - BGP metrics exporter container using VPPTool
bird2-exporter
UPG uses the Vector Packet Processing (VPP) Linux Control Plane (LCP) pluginOpens in a new tab. This plugin allows VPP to integrate with applications that use the Linux kernel network stack. In the BGP support use case, the BGP daemon inserts routes learned from BGP peering into the VPP routing table. In the other direction, the BGP daemon announces the exported UE IP addresses to edge gateways.
Configuration
The following diagram shows the UPG deployment with the BGP support:
In the basic Packet Gateway (PGW) example, the BGP daemon is connected to the SGI interface. The LCP interface is directly attached to SGI, and the BGP daemon peers with the CGW shown in the diagram.
For the full UPG configuration with BGP enabled, see the PGW configuration example with BGPOpens a file. To configure BGP, follow the instructions in the next sections.
Configure networking
First, configure networking. Make sure to provide the following values:
- spec.instances.{name}.networking.sgi.interface - name of the interface to connect the BGP daemon to
- spec.instances.{name}.networking.sgi.ipv4.addresses - SGI interface IPs used in the BGP configuration
See the example of networking configuration:
Enable BGP
Use this section of the UPGDeployment CR, applied to the Management Cluster, to enable BGP deployment:
If you set spec.bgp.enabled to true, the UPG pod gets the bird2 and bird2-exporter VPPTool resources as sidecar containers, connected through the /run/bird shared volume. In spec.bgp.netnsPath, you can specify a common Linux network namespace. UPG uses this network namespace and spec.bgp.table to export the UE IP addresses. UPG creates the LCP pair for the interface that spec.bgp.interface names. In this example, sgi corresponds to spec.instances.{name}.networking.sgi.interface.
The spec.bgp.exportInterface parameter sets the Linux interface in spec.bgp.netnsPath that the exported UE IP routes point to. The default is lo. The BGP daemon reads the routes from the kernel table. It announces them with its own next hop, independent of the interface.
The interface must exist in the network namespace and be up. If it does not, the kernel rejects the IPv4 routes. Do not use an LCP interface such as lcp0. The LCP plugin would import every UE IP route into VPP, and VPP would then send an Address Resolution Protocol (ARP) request on sgi for each UE IP address.
Important
If VPP restarts inside a running UPG pod, the exported UE IP routes stay on the export interface in spec.bgp.table. UPG does not remove them afterward, so the BGP daemon keeps announcing UE IP addresses whose sessions no longer exist on this UPG. To remove these routes, recreate the UPG pod, which drops all sessions of the UPG instance. For details, see the known issue in the UPG 3.2.0 release notes.
You can set VPPTools used for BGP:
You can use the following VPPTool examples, if they are not already deployed in the Core Cluster:
Define the UPGConfig representation
The UPGDeployment CR values defined in the spec.bgp section are mapped to the UPGConfig Custom Resource in spec.ueip.nsExport:
Use debug CLI
Note
Configuration applied through UPGConfig overrides the CLI configuration.
You can configure the export of UE IP addresses at runtime using vppctl commands. To enable the export of UE IP routes, run:
Replace the placeholders:
{NETNS_PATH}: the Linux network namespace, for example/run/vpptools/netns{TABLE_ID}: the kernel table, for example213{INTERFACE_NAME}: the Linux interface that the exported routes point to, for examplelo
Use this command to deactivate the export of UE IP addresses:
Configure BGP
Provide the BGP daemon configuration in spec.instances.{name}.bgp.config as a BIRD2 configuration file. The configuration is exposed as a ConfigMap and attached to the UPG deployment. The UPG image includes a script that checks for configuration updates and restarts the BGP daemon if any changes are detected.
Add the following BGP configuration to the UPG instance:
Sample BIRD2 configuration:
Verification
Check the number of containers
The UPG pod with BGP support includes three containers:
- Main FPP container (
fpp) - Container with a running BIRD process (
tool-bird2) - Container that exposes metrics in the Prometheus format (
tool-bird2-exporter)
Check the number of containers to verify if BGP is up and running.
Check UE IP exposure
To check whether UPG publishes UE IP addresses, run the following vppctl command:
See the output example:
The tool-bird2 container logs of UPG list the exported UE IP addresses. See the sample log message:
To check the list of exported UE IP addresses, use the Linux command ip route in the tool-bird2 container:
The table number (213) must match spec.bgp.table from Enable BGP.
Sample output:
Note
If UPG has no sessions yet, the routing table might not exist, because UPG adds a UE IP route for each session.
Check the applied BGP configuration
To check if the BGP configuration and peering are active, run this command in the fpp container of the UPG pod:
The table number (213) must match spec.bgp.table from Enable BGP.
The table shows the routes that UPG learned over BGP, for example 10.40.0.0/24.
UE IP addresses do not appear in this table, because UPG exports them on lo, which has no LCP pair.
See the output example:
To check BGP peering on the tool-bird2 container, use the birdc diagnostic tool to get the state:
- See the BGP routes exchanges between peers:
- Show the local protocols and BGP peering state
- See the detailed information about BGP:
See the output example: