Support for Border Gateway Protocol (BGP) Communities

A BGP community is a group of prefixes that share some common property and can be configured with the BGP community attribute. The BGP Community attribute is an optional transitive attribute of variable length. The attribute consists of a set of four octet values that specify a community. The community attribute values are encoded with an Autonomous System (AS) number in the first two octets, with the remaining two octets defined by the AS. A prefix can have more than one community attribute. A BGP speaker that sees multiple community attributes in a prefix can act based on one, some or all the attributes. A router has the option to add or modify a community attribute before the router passes the attribute on to other peers.

The local preference attribute is an indication to the AS which path is preferred in order to reach a certain network. When there are multiple paths to the same destination, the path with the higher preference is preferred (the default value of the local preference attribute is 100).

Common Community Attributes

For example to set the community attribute, no-export, to all route prefixes matching prefix subnet100, use the following syntax:

CLI network-admin@Leaf1 > vrouter-route-map-add vrouter-name vr1 name rmap1 seq 10 action permit match-prefix subnet100 community-attribute no-export

 

To set the community attribute, 65002:200 to all route prefixes matching prefix subnet100, use the following syntax:

CLI network-admin@Leaf1 > vrouter-route-map-add vrouter-name vr1 name peer vr2 action permit seq 20 match-prefix subnet99 community-attribute-generic 65002:200

Community Lists

BGP community list is a user defined BGP communities attribute list. The BGP community list can be used for matching or manipulating BGP communities attribute in updates. This is used on the receive side of the BGP updates to match what is set in the received updates. Community lists can be used in route-map with match-community keyword to apply any policy on the receive side.

To set the community list permitting the community value 300 for AS 65002, use the following syntax:

CLI network-admin@Leaf1 > vrouter-community-list-add vrouter-name vr2 style standard name clist300 action permit community-attribute 65002:300

 

To set an expanded community list that denies updates with community values 1 through 99 in autonomous System 50000, use the following syntax:

CLI network-admin@Leaf1 > vrouter-community-list-add vrouter-name vr1 style expanded name c199 action deny community-attribute 50000:[0-9][0-9]

The Netvisor commands for vrouter-route-maps-* support additional parameters for BGP communities:

CLI network-admin@Leaf1 > vrouter-route-map-add

match-community match-community-string

Specify the community string to match. (BGP only)

exact-match|no-exact-match

Specify if the community string is an exact match or not. (BGP only)

community-attribute-generic community-attribute-generic-string

Specify a generic community attribute such as AA:NN. (BGP only)

additive|no-additive

Specify if a given community is appended to existing communities value.

comm-list-del vrouter community-list name 

Specify if you want to remove community values from BGP community attributes.

New commands support creating BGP Communities:

CLI network-admin@Leaf1 > vrouter-community-list-add

vrouter-name name-string

Specify a vRouter to add the community list.

Add the following community list parameters:

style standard|expanded

Specify the style of the community list.

name name-string

Specify a name for the community list.

action permit|deny

Specify the action for the community list.

community-attribute community-attribute-string

Specify the community attribute.

CLI network-admin@Leaf1 > vrouter-community-list-remove

vrouter-name name-string

Specify a vRouter to remove the community list.

Add the following community list parameters:

style standard|expanded

Specify the style of the community list.

name name-string

Specify a name for the community list.

action permit|deny

Specify the action for the community list.

community-attribute community-attribute-string

Specify the community attribute.

CLI network-admin@Leaf1 > vrouter-community-list-show

vrouter-name name-string

Displays the vRouter name.

Add the following community list parameters:

style standard|expanded

Displays the style of the community list.

name name-string

Displays a name for the community list.

action permit|deny

Displays the action for the community list.

community-attribute community-attribute-string

Displays the community attribute.

 

Configuring Open Shortest Path First (OSPF)

Open Shortest Path First (OSPF) is a robust link-state interior gateway protocol (IGP). It uses the concept of Areas which allows further segmentation on the network.

OSPF uses link-state information to make routing decisions, and make route calculations using the shortest path first (SPF) algorithm. Each vRouter configured for OSPF floods link-state advertisements throughout the area that contains information about the interfaces attached to the router and routing metrics.

You can add more configuration options, such as hello intervals, for OSPF using the vrouter-interface-config commands. In addition, you can add stub or not-so-stubby areas to the OSPF configuration.

You can also manually change the OSPF cost for the configuration. Cost is the metric used by OSPF to judge the feasibility of a path. If you specify 0 as the cost, the vRouter automatically calculates the cost based on the bandwidth of the interface.


 

Informational Note:   For switches with ONVL, the only available VNET is a global VNET created when a fabric is created for the first time. Use tab complete in the CLI to display the VNET and continue the configuration.

In this example, you configure OSPF for two vRouters with an area of 5. The network has the following configuration:

Figure 2: OSPF

OSPF-topology.png

1. First, create the vRouter for Router1.

vrouter-create name vrouter1  fabricname-global router-type hardware

Add vRouter interfaces to the vRouter:

vrouter-interface-add vrouter-name vrouter1 ip 10.0.3.1 netmask 24 vlan 35 if data nic-enable

vrouter-interface-add vrouter-name vrouter1 ip 172.37.0.17 netmask 16 vlan 55 if data nic-enable

Add the subnets, 10.0.3.0/24 and 172.37.0.0/16, to VLAN33 with the area 0:

vrouter-ospf-add vrouter-name vrouter1 network 10.0.3.0/24 ospf-area 0

Add the second IP address with the area 0.

vrouter-ospf-add vrouter-name vrouter1 network 172.37.0.0/16 ospf-area 0

Add interfaces for OSPF hello intervals of 30 seconds:

vrouter-interface-config-add name router1 nic eth0.35 ospf-hello-interval 30 ospf-cost 0

vrouter-interface-config-add name router1 nic eth0.55 ospf-hello-interval 30 ospf-cost 0

If you specify 0 as the cost value, the vRouter calculates the OSPF cost automatically based on the bandwidth of the interface.

When you modify the OSPF hello interval, the ospf-dead-interval is automatically reset to 4 times the hello interval.

 

Display the configuration by using the vrouter-ospf-show command:

vrouter-ospf-show layout vertical

vrouter-name:            vrouter1

network:                 10.0.3.0

netmask:                 24

ospf-area:               0

vrouter-name:            vrouter1

network:                 172.37.0.0

netmask:                 16

ospf-area:               0

stub-area:               11

stub-type:               stub

ospf-hello-interval:     30

metric:                  34

 

The metric value can reflect the cost of routes advertised as OSPF routes. It may also reflect the cost of routes advertised with other protocols.