5.6.4. BGP

Dynamic routing protocols are used to signal which networks are currently connected to each of the routers. Routers communicate using routing protocols. UserGate updates the kernel routing table in accordance with the information it receives from the neighboring routers. Dynamic routing does not change how the kernel performs routing at the IP layer. The kernel keeps looking up routes to hosts and networks as well as default routes in its routing table. The only thing that changes is how routes are managed in the routing table: instead of the manual method, they are added and removed dynamically. Routes are only added to the virtual router in which the BGP protocol is configured.

BGP (Border Gateway Protocol) is a dynamic routing protocol classified as an External Gateway Protocol (EGP). Currently, it is the main dynamic routing protocol used on the Internet. The BGP protocol is designed to exchange routing and reachability information among autonomous systems (AS), which are groups of routers with common technical management and administration that use intra-domain routing protocols to determine routes within a group and an inter-domain routing protocol to determine routes for packet delivery to other ASs. The information transmitted includes the list of ASs that can be accessed via this system. The best routes are selected based on the rules that are in place in the network. For more details on how the BGP protocol works, see the relevant technical documentation.

To configure BGP in UserGate, follow these steps:

Task

Description

Step 1. Select a virtual router.

If there are several virtual routers, select the desired one.

Step 2. Enable the BGP router.

In the UserGate console, go to the Network --> Virtual routers section, select BGP in the menu, and configure the BGP router.

Step 3. Specify the filters and optional routemaps to limit the number of routes to receive.

In the Filters section, click Add and configure the Routemap and filter settings. Add as many routemaps/filters as required for BGP to work in your organization.

Step 4. Add at least one BGP neighbor (peer).

In the Neighbors section, click Add and configure the router settings for the neighboring AS. Add as many neighbors as required.

Important! RFC 8212 includes a mandatory requirement that export and import filters be added for each neighbor. Without import filters, the router will not receive routes from that neighbor, and without export filters, the router will not advertise routes to that neighbor.

If several IP addresses are assigned to the UserGate interface from which a connection is established to a neighbor, then when configuring a BGP neighbor, if there is no NAT rule that enforces the source address for a BGP session with this neighbor, you must specify the main one as the UserGate address (primary) IP address, i.e. the address that is first in the list in the interface settings.

To configure a BGP router, provide the following settings:

Name

Description

Enabled

Enables or disables this BGP router.

Router ID

The router's IP address. Must match one of the IP addresses assigned to the UserGate network interfaces that belong to this virtual router.

AS number

An autonomous system is a system of IP networks and routers managed by one or more operators that have a single routing policy. The autonomous system number identifies the router as belonging to that system.

Redistribute

Enables the routes towards networks directly connected to UserGate, static routes added by the administrator for this virtual router (kernel), or routes received using the OSPF protocol to be distributed to other BGP routers.

Multiple path

Enables traffic load balancing to routes with identical cost.

Networks

The list of networks that belong to this AS.

To add BGP neighbors, click Add and provide these settings:

Name

Description

Enabled

Enables or disables this neighbor.

Host

The neighbor's IP address.

Description

An arbitrary description for the neighbor.

Remote ASN

The neighbor's AS number.

Weight

The weight assigned to route data received from this neighbor.

TTL

The maximum allowed number of hops to this neighbor.

Announce self as next hop for BGP

Replace the next-hop-self value with own IP address, if the neighbor uses BGP.

Multihop for eBGP

Indicates that the connection to this neighbor is indirect (more than a single hop).

Route reflector client

Indicates if the neighbor is a route reflector client.

Soft reconfiguration

Use soft reconfiguration (without terminating connections) for configuration updates.

Default originate

Advertise the default route to this neighbor.

Authentication

Enables authentication for this neighbor. The authentication password is set here.

BGP neighbor filters

Limits the route information received from the neighbors or advertised to them.

Routemaps

Routemaps are used to manage routing tables and specify the match conditions under which routes are passed between domains.

A routemap allows filtering of routes on redistribution and modification of various route attributes. To create a routemap, provide the following settings:

Name

Description

Name

The routemap name.

Action

Sets the action for this routemap. Can take the following values:

  • Allow: allows data that matches the routemap conditions.

  • Block: blocks data that matches the routemap conditions.

Match by

Routemap conditions. Can take the following values:

  • IP. If this condition is selected, go to the IP addresses tab and add all required IP addresses for the condition.

  • AS path. If this condition is selected, go to the AS path tab and add all required AS numbers for the condition. POSIX 1003.2 regular expressions are allowed, supplemented by the underscore (_) character that is interpreted as:

  • A space.

  • A comma.

  • Start of line.

  • End of line.

  • AS set delimiter { and }.

  • AS confederation delimiter ( and ).

  • Community. If this condition is selected, go to the Community tab and add all required BGP community strings for the condition.

Set next hop

Set the next hop value for the filtered routes to this IP address.

Set weight

Set the weight for the filtered routes to this value.

Set metric

Set the metric for the filtered routes to this value.

Set preference

Set the preference for the filtered routes to this value.

Set AS prepend

Set the AS-prepend value, which is a list of autonomous systems added for this route.

Community

Set the BGP community value for the filtered routes.

Filters allow you to filter routes when redistributing. To create a filter, provide the following settings:

Name

Description

Name

The filter name.

Action

Sets the action for this filter. Can take the following values:

  • Allow: allows data that matches the filter conditions.

  • Block: blocks data that matches the filter conditions.

Filter by

Filter conditions. Can take the following values:

  • IP. If this condition is selected, go to the IP addresses tab and add all required IP addresses for the condition. The addresses can be specified in the following formats:

    • 10.0.0.0/8 for the 10.0.0.0/8 subnet only

    • 10.0.0.0/8:11 for routes where the first octet is 10 and the prefix is from 8 to 11

    • 10.0.0.0/8:11:13 for routes where the first octet is 10 and the prefix is from 11 to 13.

  • AS path. If this condition is selected, go to the AS path tab and add all required AS numbers for the condition.