Ccip BGP ch11 Configuring Basic BGP Functions and Attributes
Ccip BGP ch11 Configuring Basic BGP Functions and Attributes
Attributes
1. The above diagram shows how to stop AS3 from becoming a transit area.
2. In order to use an access-list to filter a specific prefix and a specific mask, you
could use a prefix-list which is the easiest and best method, as you can choose
the bits to match with any particular prefix-length.
3. As mentioned above, in order to match a specific prefix with a specific mask,
prefix lists are best but you can also do it with an ACL; but the ACL must be
extended.
1. Example: access-list 101 permit ip host 172.16.0.0 host 255.255.0.0
4. At first you may think you can just use a standard access-list to do this; let's say
you want to match exactly 192.168.0.0/16 (meaning be 192.168.0.0 and also
have the prefix-length of /16. So you write an ACL like the following: access-
list 1 permit ip 172.16.0.0 0.0.255.255
1. This however matches everything that starts with 172.16.0.0.
5. f
5. Identifying and Filtering Routes Based on the AS_PATH
1. Use an as-path access-list to permit routes that originate from the local AS using
a regular express. ^ means the beginning of the AS_PATH and $ means the end
of the AS_PATH. Together, it means no AS_PATH which is the same thing as
locally originated routes, as the AS_PATH is not attached to the route until it's
passed to an EBGP peer.
2. Use a filter-list router bgp sub-command in conjunction with an as-path access-
list to prevent AS3 from becoming a transit AS.
3. Use the following to verify that your regular expression works as intended;
displaying all the paths that match the specified regular expression.
1. show ip bgp regexp regular-expression
1. The above shows RTA and RTF connecting via OSPF for the IGP in AS3. RTF
has a customer (C1) connecting via RIP. C1 is pointing a default towards AS3
and advertising all routes to AS3 via RIP - RTF is then redistributing those RIP
routes into OSPF. RTA has an EBGP session with RTC, and RTA is injecting all
routes known via OSPF.
2. In the above configuration you can see that RTF configured s2/1 to be a passive-
interface. When passive-interface is used with RIP it stops RIP from sending
updates on that interface, however RIP can still receive updates. Passive-
interface if used on EIGRP or OSPF stops hello packets and neighbor
adjacencies, and therefore stops routing advertisements.
3. Redistributing -
1. Subnets must be a parameter that accompanies the redistribute command
when redistributing into OSPF in order to redistribute classless networks.
2. default-metric is a useful router subcommand to use when redistributing
when granularity is not needed. Using a route-map to set metrics will
override the default-metric.
3. match external 1 external 2 part of the redistribute command above for ospf
being redistributed into BGP is used to redistribute not only the internal
OSPF routes, but also both types of external routes. By default, OSPF will
not redistribute external routes into BGP unless specified.
4. Above is an example of router RTA filtering outbound advertisements to
neighbor 172.16.20.1 using a route-map called BLOCKROUTES, which is using
access-list 1 as the criteria for the route map deny statement.
5. As shown above, instead of redistributing you can also use the network router
subcommand. network network mask mask. For classful networks a mask isn't
necessary. Unlike IGPs, the network command must match the exact network
found in the local router's RIB in order for it to be advertised. The origin code is
included when using the network command, whereas redistributing leaves the
origin code incomplete marking it with a ?.
3. RTC now configures the backdoor changing the AD of the EBGP learned route
from 20 to 200, allowing the RTM to install the route because the OSPF learned
route (with an AD of 110) is now more desirable.
1. (You may need to look at diagram 11-6 a few pages up to fully understand) Here
we have the bgp table of RTF (above) and RTA (below). RTF has learned about
192.68.11.0/24 with two possible paths with next hop 172.16.20.1 being the best.
It's important to ensure that you have ip reachability to the next-hop otherwise
the route would be unusable. In this example the EBGP NEXT-HOP (be default)
has been preserved. There's two ways to ensure you have connectivity to this
particular next hop. The first way; RTA is advertising the ISP link where the
EBGP NEXT-HOP is in OSPF, so RTF knows how to reach it that way. If you
look at the configuration examples above, you'll see that RTA made S0 a passive-
interface in OSPF configuration as there's no reason to send OSFP hello's to
RTC. The other method is to configure next-hop-self in RTA's BGP neighbor
command going to RTF to use RTA as the next-hop for 192.68.11.0/24 instead of
preserving the EBGP NEXT-HOP.
2. Notice that RTA's route to 192.68.11.0 has only one path while RTA has two
possible paths for 192.68.10.0. This is because RTF is using RTA's route to
192.68.11.0 as the best route and therefore is not advertising it's other path to
RTA. This is typical BGP behavior.
3. The AS_PATH Attribute
1. RTF's BGP table; in this example we look at the route for 192.68.11.0 with one
path being learned via IBGP and the other path learned via EBGP. The IBGP
learned route is best due to the path being shorter. The IBGP learned route only
has to get to AS1 and that's it, while the EBGP path would have to go through
AS2 to get to AS1 making it longer and therefore less desirable.
2. AS_PATH Manipulation
1. RTC has created a route map, prepending to the AS_PATH attribute being
advertised to RTA with two extra AS numbers. Specifically, looking at route
192.68.11.0 again, RTF now prefers the path through AS2. See below the BGP
table of RTF for route 192.68.11.0
3. Using Private ASs
1. RTA is using a private AS. RTC is able to remove the private AS information
from advertisements out to other ASes using the neighbor a.b.c.d remove-
private-AS command to keep the private information from leaking into the
internet. See the diagram above and the configurations and show commands
below.
4. The LOCAL_PREF Attribute
3. Above is RTC's bgp table entry for 172.16.65.0/26 showing the no-export
community has indeed been advertised to RTC; below is proof that RTD was not
advertised the route due to the no export community attribute.
VII. BGP-4 Aggregation
1. Aggregate Only, Suppressing the More-Specific
1. The above diagram is showing RTA and RTF both using the aggregate-address
172.16.0.0 255.255.0.0 summary-only bgp router subcommand in order to
aggregate their more specific routes, and only advertise the aggregate
suppressing the more specific routes.
2. RTA's bgp table, shown below, is showing that RTA has originated (NEXT-HOP
0.0.0.0) the aggregate, and also showing that the more specific routes are being
suppressed indicated by the "s" in front of the routes.
3. RTC's BGP table is showing that it has received the aggregate, and no other
specific routes, and is showing that it has two paths to the aggregate due to RTF's
advertisement of the aggregate as well.
4. RTC's is showing the bgp table entry specifically for the 172.16.0.0 aggregate.
The numbers in front of both paths are showing the AS-PATH. The best entry is
showing a 3 for the AS-PATH, and the entry right below it is showing a 2 and 3.
The line "aggregated by 3 172.16.2.254" shows the AS and the Router-ID of the
router that originated the aggregate. Also notice the atomic-aggregate PA,
meaning that the aggregate has lost all it's subordinate AS-PATH PA information
and the only AS-PATH information left is that of the aggregate itself, revealing
only where the aggregate came from and not where the subordinate routes came
from, if any of the routes came from varying ASes.
5. The above and below configuration snippet shows RTA and RTF advertising an
aggregate based off of a static route going to the null0 interface. This is another
way of advertising an aggregate; however one would have to manually suppress
the subordinate routes if needed by filtering them.
2. Aggregate Plus More-Specific Routes
1. The above diagram is showing AS3 routers RTA and RTF is advertising an
aggregate along with more specific routes. The two configuration examples
below are showing that RTA and RTF are configured with aggregate-address
172.16.0.0 255.255.0.0 with no summary-only command.
2. Below is RTC's BGP table showing that the AS3 routers are not only advertising
the aggregate but also the subordinate routes.
3. Here you see RTF is now configuring a route-map. Sequence 10 of the route-
map is matching access-list 101 which is permitting the aggregate address
172.16.0.0. Sequence 20 of the route map is matching all over routes and setting
the community no-export to tell the neighboring AS not to advertise the
subordinate routes to any other AS.
4. Below, RTC has been configured with the send-community bgp neighbor
command pointing towards RTD, so that RTC advertises the no-export
community coming from AS3, otherwise the routes going from RTC to RTD
would not have the no-export community and would therefore advertise the
subordinate routes to all other ASes.
5. As a best practice, the send-community neighbor command should be
configured on RTD pointing to RTC as well... even though RTC is not
connecting directly to any other AS so the only router we need to worry about in
this situation is RTD, so RTD is getting the community advertised from both
RTC and RTF.
6. As you can see below the subordinate route has no-export from both paths, and
the aggregate can be advertised normally to any other AS.
7. Lastly, you can see that RTG has only received the advertisement the aggregate
from AS3.
3. Aggregate with a Subset of the More-Specific Routes
1. The below diagram in this example is showing that the AS3 routers, RTA and
RTF, are both advertising the aggregate 172.16.0.0/16, but also are both
advertising a subset of subordinate routes. RTA will suppress subordinate route
172.16.220.0 and advertise all of the other subordinate routes, while RTF will
only advertise the subordinate route 172.16.220.0 with the aggregate, but no
other subordinate routes. See the configurations below to see how this is
accomplished.
2. As mentioned above, RTA and RTF are advertising a subset of subordinate routes
along with the aggregate. This is accomplished by creating a suppress-map; an
option for the router bgp aggregate subcommand. RTA creates access-list 1 to
match 172.16.220.0 for the route-map SUPPRESS, and then uses the route-map
on the aggregate-address 172.16.0.0 255.255.0.0 suppress-map SUPPRESS in
order to suppress 172.16.220.0 and advertise all other subordinate routes to AS1.
3. RTA's bgp table blow showing that the suppress-map worked in suppressing
192.16.220.0 indicated by the "s" next do 172.16.220.0
4. RTF's configuration below is showing the same type of configuration, except in
this case RTF is suppressing ALL subordinate routes except for 192.16.220.0.
5. Below is the bgp table of RTF showing that the suppress map is doing what it's
supposed to be doing which is to suppress all of the subordinate routes except for
192.16.220.0
6. Below is the BGP table of RTD showing that there is only one path for
172.16.220.0 which is next-hop 192.68.5.1 (RTF). If for some reason one of the
links to AS1 is broken, the aggregate route will backup the subordinate routes.
7. After suppressing certain routes and you then decide that one or some of the
suppressed routes should actually be advertised to AS1, instead of editing the
suppress map you could instead use an unsuppress-map. The unsuppress map is
configured the same way using an access-list or some other list to permit the
route(s) and then configure a route-map to match the routes based on the access
list. The only difference aside from the fact that this is meant for unsuppressing
is the fact that the unsuppress map is configured on a neighbor instead of
configured under the aggregate-address command.
4. Loss of Information Inside Aggregates
1. In the diagram below, AS3 router, RTA, is aggregating AS1's and AS2's routes of
192.68.11.0 and 192.68.10.0, and advertising this aggregate to AS5.
2. The problem with aggregating is that the aggregate loses the subordinate routing
information, specifically the AS-PATH information of the subordinate routes.
Below is RTA's configuration for aggregating AS2 and AS2's routes.
3. Below is AS5's router, RTK's BGP table, showing the aggregate 192.68.0.0/16.
Notice that the AS-PATH PA is only showing AS3. This is an example of the
loss of the AS-PATH information of the subordinate routes.
5. After revising RTA's configuration using the as-set command, as shown below in
RTK's BGP table, it is now showing an as-set, a summary of the AS-PATH
information from the other ASes as part of the AS-PATH information in the
aggregate. This is an important consideration as the AS-PATH PA is used for
EBGP's loop prevention. However, another fact to consider is that every time
there's an update in any of the subordinate ASes, the aggregate will be updated.
So, if there's many subordinate ASes, the aggregate could be updated many times
in a short amount of time causing there to be instability in the aggregate.
6. One other consideration with AS-SET: all PAs will be carried over...
5. Changing the Aggregate's Attributes
1. Based on the diagram above, RTC is sending the community no-export for route
192.68.11.0, of which is one of the routes that RTA is aggregating.
4. To remedy this situation, RTA has now been configured with an attribute map;
another form of a route-map, changing the community from no-export to none.
5. RTA's BGP table entry for aggregate 192.68.0.0 is now showing no community
and can now be advertised.
6. Forming the Aggregate Based on a Subnet of Specific Routes
1. In the diagram below, AS3 is forming the aggregate 192.68.0.0. In normal
operation the aggregate would be automatically formed based on all subordinate
routes that fit into 192.68.0.0, including AS1's route to 192.68.11.0 and AS2's
route to 192.68.10.0. However, AS3 wants to be able to advertise the aggregate
to AS1, and therefore needs to form the aggregate on AS2's route only.
2. Below is an example on how you would configure the aggregate only on AS2's
route, which is called an advertise-map, another form of a route-map. Access-
list 1 is permitting 192.68.10.0, which is used for the route-map
SELECT_MORE_SPECIF_ROUTES. The route map is then used as the
advertise-map for the creation of the aggregate.
3. Below you can see RTA's BGP table for entry 192.68.0.0, the aggregate. As you
can see the path information only shows AS 2. When this is advertised to AS1,
the EBGP loop prevention will not drop the aggregate, as planned.