Configuration Guide Vol. 3


14.1.5 BGP4 [SL-L3A]

<Structure of this section>

(1) BGP4 learned route filtering

In BGP4, you can filter every route that the protocol learns. By default, routes that are denied by the filter are not added to the routing table.

Notes

After you specify or change the BGP4 learned route filtering settings, execute the clear ip bgp * in or clear ip bgp * both operation command at the appropriate time. Route filtering will operate according to its previous settings until you execute the command.

If you execute clear ip bgp * in, the new route filtering settings apply to learned route filtering only. If you execute clear ip bgp * both, the new settings apply to learned route filtering and advertised route filtering.

(a) How and in which order filters are applied

Learned routes are filtered according to the filters specified in the distribute-list in and neighbor in commands. The filters specified in neighbor in apply only to routes learned from specific peers or peers belonging to a specific peer group. The table below describes the configuration commands used in BGP4 learned route filtering.

When the switch learns a route, it applies the configured filters in the order shown in the table below. If there are no applicable filters or every filter gives a permit result, the route is entered into the routing table as a valid route. The learned route is considered an invalid route if it is denied by even one filter.

Table 14-14: BGP4 learned route filtering configuration command

Command name

Parameter

Filtered routes

neighbor in (BGP4) (with route-map specified)

<IPv4> (peer address)

Filters routes learned from the specified peers.

neighbor in (BGP4) (with access-list or prefix-list specified)

<IPv4> (peer address)

Filters routes learned from the specified peers.

neighbor in (BGP4) (with route-map specified)

<Peer-Group> (peer group)

Filters routes learned from peers belonging to the specified peer groups.

neighbor in (BGP4) (with access-list or prefix-list specified)

<Peer-Group> (peer group)

Filters routes learned from peers belonging to the specified peer groups.

distribute-list in (BGP4)

No

Filters all routes learned by BGP4.

(b) Route attributes changeable by learned route filtering

The table below describes the attributes that can be changed by BGP4 learned route filtering.

Of the values below, BGP4 uses values other than the distance value to select prioritized routes. The distance value defines the relative priority of routing protocols.

Table 14-15: Routes that can be changed by BGP4 learned route filtering

Attribute

Default

Distance

The value specified by distance bgp.

If no value is specified, the following value is used:

Internal peer: 200

External peer: 20

Member AS peer: 200

MED attribute

The attribute value of the received route

LOCAL_PREF attribute

Internal peer: The attribute value of the received route.

External peer: The value specified by bgp default local-preference. If no value is specified, 100 is used.

Member AS peer: The attribute value of the received route.

AS_PATH attribute

The attribute value of the received route

COMMUNITIES attribute

The attribute value of the received route

ORIGIN attribute

The attribute value of the received route

Notes

An AS can only be added to the AS_PATH attribute of routes learned from an external peer. You cannot add an AS to the AS_PATH attribute of a route learned from an internal peer or a member AS peer.

(2) BGP4 advertised route filtering

In addition to the prioritized route in the routing table, the BGP4 protocol can advertise BGP4 routes that have been superseded by higher-prioritized routes from other routing protocols, and BGP4 routes generated by the network command. If a situation arises in which all three types of routes with the same destination network are to be advertised, the protocol selects one route to advertise, in the following order: the prioritized route, the superseded BGP4 route, and then the network-generated route.

If you do not configure advertised route filtering, only BGP4 routes are advertised. However, the protocol cannot advertise a route back to the peer from which it learned the route.

Notes

After you specify or change the BGP4 advertised route filtering settings, execute the clear ip bgp * out or clear ip bgp * both operation command at the appropriate time. Route filtering will operate according to its previous settings until you execute the command.

If you execute clear ip bgp * out, the new route filtering settings apply to advertised route filtering only. If you execute clear ip bgp * both, the new settings apply to learned route filtering and advertised route filtering.

(a) Route attributes changeable by advertised route filtering

The following table describes the attributes that can be changed by BGP4 advertised route filtering.

Table 14-16: BGP4 routes that can be changed by using advertised route filtering

Attribute

Default

MED attribute

Differs depending on the destination peer type and learning source protocol.

When advertising to an internal peer: If a BGP4 route is used, the metric is inherited. If a non-BGP4 route is used, the value specified by default-metric is inherited. If no value is specified, the route is advertised without a MED attribute value.

When advertising to an external peer: The value specified by default-metric is used. If no value is specified, the route is advertised without a MED attribute value.

When advertising to a member AS peer: If a BGP4 route is used, the metric is inherited. If a non-BGP4 route is used, the value specified by default-metric is inherited. If no value is specified, the route is advertised without a MED attribute value.

LOCAL_PREF attribute

If a BGP4 route is used, the LOCAL_PREF attribute is inherited.

If a non-BGP4 route is used, the value specified by bgp default local-preference is inherited. If no value is specified, 100 is used.

If the advertising destination peer is an external peer, the advertisement will not include a LOCAL_PREF attribute.

AS_PATH attribute

Inherits the value of the route in the routing table.

ORIGIN attribute

COMMUNITIES attribute

Notes
  • If you do not configure neighbor send-community, advertisements will not include a COMMUNITIES attribute.

(b) How and in which order filters are applied

The application of advertised route filtering involves the following steps:

  1. First, select the routes to be advertised by BGP4. Specify the learning source protocol of the routes you want to advertise. By specifying a route type in the redistribute command, you can limit advertised routes to those of a certain type. By specifying a route type in the redistribute command, you can limit advertised routes to those of a certain type.By specifying route-map, you can advertise only those routes that the associated filters permit. The redistribute command compares the route attributes in the routing table against the conditions.

    BGP4 routes are advertised regardless of whether you specify the redistribute command.

    You can also change the attributes of advertised routes by specifying the new values directly in the redistribute command, or by specifying route-map in the redistribute command that changes the route attributes.

  2. The MED and LOCAL_PREF attributes take on the default values determined by the protocol. If you used the redistribute command to change the attribute value, the route retains the attribute value assigned by the command.

    For details about the defaults for BGP advertised route attributes, see BGP4 route attributes changeable by 14-16 BGP4 advertised route filtering.

  3. The routes selected by the redistribute command are filtered by applying the filters specified in the distribute-list out and neighbor out commands. The filters specified in neighbor out apply only to routes advertised to specific peers or peers belonging to a specific peer group. If you specify a protocol, the filters apply only to routes learned by the specified protocol. The table below describes the configuration commands and the routes to which they apply.

    When advertising a route to a peer, the switch selects the applicable filters according to the advertising destination and learning source protocol, and then applies them in the order shown in the table. If there are no applicable filters or every filter gives a permit result, the route is advertised to the specified peer. The route is not advertised to the peer if it is denied by even one filter.

    If you specify route-map in a neighbor out or distribute-list out command, filtering takes place according to the default advertising attributes and the attributes after modification by the redistribute command.

    You can also change an attribute of an advertised route by specifying route-map in the neighbor out or distribute-list out command that performs the desired change.

    Table 14-17: BGP4 advertised route filtering configuration command

    Command name

    Parameter

    Filtered routes

    neighbor out (BGP4) (with route-map specified)

    <IPv4> (peer address)

    <Protocol>

    Filters routes advertised to a specific peer using a specific protocol.

    neighbor out (BGP4) (with access-list or prefix-list specified)

    <IPv4> (peer address)

    <Protocol>

    neighbor out (BGP4) (with route-map specified)

    <IPv4> (peer address)

    Filters routes advertised to a specific peer.

    neighbor out (BGP4) (with access-list or prefix-list specified)

    <IPv4> (peer address)

    neighbor out (BGP4) (with route-map specified)

    <Peer-Group> (peer group)

    <Protocol>

    Filters routes advertised to a member of a specific peer group using a specific protocol.

    neighbor out (BGP4) (with access-list or prefix-list specified)

    <Peer-Group> (peer group)

    <Protocol>

    neighbor out (BGP4) (with route-map specified)

    <Peer-Group> (peer group)

    Filters routes advertised to a member of a specific peer group.

    neighbor out (BGP4) (with access-list or prefix-list specified)

    <Peer-Group> (peer group)

    distribute-list out (BGP4)

    <Protocol>

    Filters routes matching a specific protocol regardless of their advertising destination.

    No

    Filters all routes regardless of their advertising destination.