Configuring BGP

To configure BGP (Border Gateway Protocol) dynamic routing protocol on a virtual router, use the following command:

Admin@nodename# set network virtual-router <virtual-router-name> bgp

Specify the parameters:

Parameter

Description

enabled

Enable/disable an OSPF router:

  • on

  • off

router-id

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

If the BGP is disabled (enabled off), the router-id value can be deleted (none).

asn

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.

multiple-path

Enable/disable traffic balancing to routes with the same cost:

  • on

  • off

redistribute

BGP route redistribution:

  • connected: redistribute routes to the networks directly connected to UserGate

  • kernel: redistribute routes added by the administrator.

  • ospf: redistribute routes received via the OSPF protocol.

networks

A list of networks that belong to this autonomous system. Format: <ip/mask>.

routemaps

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

To create a routemap or change parameters for an existing routemap, use the following commands:

Admin@nodename# set network virtual-router <virtual-router-name> bgp routemaps new Admin@nodename# set network virtual-router <virtual-router-name> bgp routemaps <routemap-name>

Routemap parameters:

  • name: routemap name.

  • description: routemap description.

  • action: action:

    • allow: allow data that matches the routemap conditions to pass through

    • block: deny data that matches the routemap conditions to pass through.

  • match-by: match condition to apply a routemap. Match by:

    • ip: IP address.

    • aspath: AS path.

    • community: Community.

  • next-hop: set next hop value for filtered routes to the specified IP address.

  • weight: set the weight for filtered routes to the specified value.

  • metric: set the metric for filtered routes to the specified value.

  • preference: set the preference for filtered routes to the specified value.

  • as-prepend: set the AS-prepend value, which is a list of autonomous systems being added for this route.

  • community: set the BGP community value for filtered routes.

  • append-community: append community.

  • ip-match: add all required IP addresses when selecting IP address matching.

  • as-path-match: add all required autonomous network numbers when selecting AS path matching. 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-match: add the strings of all desired BGP communities when matching by Community is selected.

filters

Filters allow you to filter routes when redistributing.

To create a filter or change parameters for an existing one, use the following commands:

Admin@nodename# set network virtual-router <virtual-router-name> bgp filters new Admin@nodename# set network virtual-router <virtual-router-name> bgp filters <filter-name>

Parameters:

  • name: the filter name.

  • description: the filter description.

  • action: action:

    • allow: allow data that matches the routemap conditions to pass through

    • block: deny data that matches the routemap conditions to pass through.

  • filter-by: conditions on application of the filter. The following actions are available:

    • ip: filter by the IP address.

    • aspath: filter by the AS path.

  • ip-filter: add all desired IP addresses when IP address filtering is selected. 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-filter: add all required autonomous network numbers when selecting filtering by AS path.

neighbors

BGP neighbors.

To add new neighbors or change data for existing ones, use the following commands:

Admin@nodename# set network virtual-router <virtual-router-name> bgp neighbors new Admin@nodename# set network virtual-router <virtual-router-name> bgp neighbors <host-ip>

Parameters:

  • enabled: enable/disable use of the neighbor:

    • on

    • off

  • description: BGP neighbor description.

  • host: neighbor IP address.

  • remote-asn: neighbor's autonomous system number.

  • weight: weight of routes received from this neighbor.

  • ttl: maximum allowed hop number to this neighbor.

  • allowas-in: allows receiving and processing routes even if the router detects its own autonomous system number on the AS Path in the aggregation route.

    • on

    • off

  • allowas-in-number: how many times the autonomous BGP neighbor's system number can be included in the AS Path. Available values: from 0 to 10 (0 is the origin).

  • bfd: Add a bfd profile (Bidirectional Forwarding Detection). Bfd profiles are created in the element library, read more in the Configuring Libraries section.

  • next-hop-self: if the neighbor is a BGP, replace the next-hop-self value with its own IP address:

    • on

    • off

  • ebgp-multihop: the connection to this BGP neighbor is not direct (more than one hop):

    • on

    • off

  • route-reflector-client: determine if a BGP neighbor is a Route reflector client:

    • on

    • off

  • soft-reconfiguration: use soft reconfiguration (without disconnecting) to update the configuration:

    • on

    • off

  • default-originate: announce the default route to a neighbor:

    • on

    • off

  • send-community: redirect the community to BGP neighbors.

    • on

    • off

  • enable-auth: enable/disable authentication for the neighbor.

    • on

    • off

  • password: the neighbor authentication password.

  • filter-in: restrict routing information received from neighbors.

  • filter-out: restrict routing information announced to neighbors.

  • routemap-in: restrict routing information that BGP receives from neighbors.

  • routemap-out: restrict routing information that BGP sends to neighbors.

To display BGP configuration in a virtual router, use the following command:

Admin@nodename# show network virtual-router <virtual-router-name> bgp

Example command to configure BGP in a virtual router:

Admin@nodename# set network virtual-router test_router bgp router-id 192.168.95.224 asn 1 networks [ 192.168.100.0/24 ] redistribute [ connected kernel ] Admin@nodename# show network virtual-router test_router name : test_router description : Test virtual router node-name : node_1 interfaces : port2; port3 ... bgp : enabled : off asn : 1 router-id : 192.168.95.224 redistribute : connected; kernel multiple-path : off networks : 192.168.100.0/24 routemaps : [] neighbors : [] filters : [] ...

To delete BGP router parameters, use the following command:

Admin@nodename# delete network virtual-router <virtual-router-name> bgp <parameter>

You can delete the following parameters:

  • Addresses of networks that belong to this autonomous system: networks.

  • Conditions on application of routemap: routemaps <routemap-name> ip-match | community-match | as-path-match.

  • Condition on application of filters: filters <filter-name> ip-filter | as-path-filter.

  • BGP neighbors and routemap filters: neighbors <host-ip> filter-in | filter-out | routemap-in | routemap-out.

  • BGP route redistribution options: redistribute [ connected | kernel ].