1) Manage distance and backdoor Routing
Distancebgpexternalinternallocal modifies the EBGPIBGPlocalbgp AD, thus affecting the routing;
There can be a separate link between the two AS to exchange the data volume between each other, but it is not advertised to other AS. In this case, you can add network192.1.12.2backdoor to the routers at both ends of the link, which is called "backdoor routing ": the backdoor attribute enables the router to select Routes learned from IGP rather than Routes learned from the IBGP neighbor. Because, by default, the Active Directory of the EBGP neighbor is 20, it always gives priority, instead of the routes transmitted by other ad igp routing protocols.
Backdoor routing is used to set the priority of IGP routes to higher than EBGP in some special cases.
For example, in the above topology, the 199.172.0.0 network segment in BB2 enters the OSPF route through redistribution. On R5 and R3, you will learn the IGP route from R4. At the same time, R5, as the IBGP neighbor of R4, will learn an IBGP route. Because the IBGP route management distance is large, routing is not affected on R5, but for R3, it learns an EBGP route from R5 and receives the IGP route of R4, r3 defines the next hop of 199.172.0.0 as R5, which generates a loop. To solve this problem, mount the backdoor parameter neiip-addressbackdoor after neighbor on R5 and R3.
The reason for this is nothing more than the next-hop attribute in the BGP learning entry. The default next hop rule is as follows. The next hop of the self-generated route is 0.0.0.0, after receiving the message from the EBGP route, change the next hop to the IP address of the EBGP peer, and do not change the next hop value when releasing the message to the IBGP. However, you can use next-hop-self to modify this rule and then advertise the next hop address to IBGP. Next-hop-unchanged can also be used to prevent the next hop value from being modified after receiving the EBGP route, such as the above loop problem, you can also declare Next-hop-unchanged on R5 and R4 to solve the Next hop attribute. You can also use route-map to change the attribute.
2) conditional route Injection
Bgpinject-maproutemap-nameexist-maproutemap-name [copy-attributes]
For the above topology, AS100 follows the best exit principle, that is, 172.16.1.0 goes through R2-> r00000000.2.0 go through R3-> R5
The following configuration methods are available:
1.MED, set MED on AS200 to enable AS100 to recognize
2.AS-PathPrepend: The 2.0 route advertised by R4 to R2, which is extended AS-path. Similarly, R5
3.Use conditional route Injection
First, there is a more refined route of 172.16.1.0/24 on the left side of as300.
Then, in as100 received route 172.16.0.0/16, normal may not go to the best path of the r2-4, may be from the r3-5ebgp
Therefore, the meaning of conditional route injection (bgpinject-maproute-mapnameexist-maproute-mapname) is:
When the 172.16.0.0/16bgp route appears in the r2bgp table and the next hop route update source is 192.168.24.4r4), forcibly insert a more refined bgp Route of 172.16.1.0/24 into your as100IBGP
In this way, the ibgp route selection of your r1 will change. It will receive both 172.16.0.0/16 and 172.16.1.0/24 from r2r3, but according to the longest matching principle of the route, he will select the 172.16.1.0/24 advertised by R2. The configuration is as follows:
R2:
Routerbgp100
Bgpinject-mapAS200-specificexist-mapAS200-aggregate/* call routing Diagram
Neighbor192.168.12.1remot-as100
Nei192.168.12.1send-community
Nei192.168.23.3remot-as100
Nei192.168.23.3send-community
Nei192.168.24.4remot-as200
Nei192.168.24.4send-community
Ipbgp-communitynex-format/* supports the new group attribute format of BGP.
Ipprefix-listAS200-R4permit192.168.24.4/32/* router interface address prefix list
IppreAggregatepre172.16.0.0/16/* prefix list of summary items of the class
IppreSpecificper172.16.1.0/24/* prefix list of detailed entries
Route-mapAS200-specficper10/* Do routing graph AS200-specfic and match all
Setipaddprespecpacific/* set the IP address to a specified prefix.
Setcommunity100: 200no-export/* set the group attribute to no-export (as other than the next hop as is not declared)
Route-mapAS200-aggregateper10/* routing diagram AS200-aggregate
MatipaddpreAggregate/* Route entry that matches the Aggregate prefix
Matiproute-sourceAS200-R4/* matching routing source is the route entry learned by the neighbor of the AS200-R4
The overall call process is understood as: matching the entries matching the second route graph (172.16.0.0/16 and 192.168.24.4/32 ), set it to the attribute of the first route chart (172.16.1.0/24 and no-export)
When 172.16.0.0/16bgp is displayed in the r2bgp table, And the next hop route update source is 192.168.24.4r4, forcibly insert a more refined bgp Route of 172.16.1.0/24 into your as100IBGP
In this way, the ibgp route selection of your r1 will change. It will receive both 172.16.0.0/16 and 172.16.1.0/24 from r2r3, but according to the longest matching principle of the route, he will select the 172.16.1.0/24 advertised by R2.
For the test, I did not even find the effect, and I did not find the relevant test data through the network search. Some experts passed by and saw them kneeling for help.
3) local_as attributes:
If the vroday Day of AS8 is migrated, it is assumed that Day and Night are merged into AS9 without modifying AS141 ~ The routers of AS143 (they still think that Day belongs to AS8). This migration requires a loca-as parameter. After the BGP process of Day is changed to 9, make the following changes to the pointing neighbor: neighbor192.1.12.2remot-as200
Neighbor192.1.12.2local-as8
But the AS-Path on 8 will be 89 ..... When performing As_path filtering, you need to add the local-as parameter. You can add the no-prepend parameter after the local-as parameter to modify this attribute.
R6--R2--R4 connection, R6 is BGP6, R2 is BGP12, R4 is BGP345, R2 is migrated to BGP6, the following Configuration:
R2 (config) # norouterb12
R2 (config) # routerb6
R2 (config-router) # bro2.2.2.2
R2 (config-router) # noau
R2 (config-router) # nosy
R2 (config-router) # nei192.1.24.4remot345
R2 (config-router) # nei192.1.26.6remot6
* Mar102: 25: 01.939: % BGP-3-NOTIFICATION: receivedfromneighbor192.1.24.42/2 (peerinwrongAS) 2bytes0006
R2 (config-router) # nei192.1.24.4local-?
& Lt; 1-65535 & gt; ASnumberusedaslocalAS
<Cr>
R2 (config-router) # nei192.1.24.4local-as12
View BGP neighbor creation:
R2 # showipbsu
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
1.1.1.1412020.neveridle
192.1.24.443458710000: 02: 140
192.1.26.64688000neverActive
We can find that before nei192.1.24.4local-as12 is configured, the neighbor relationship on R4 is still the EBGP neighbor of BGP12, but R2 has changed the bgp as number, so the neighbor relationship reports an error, (peerinwrongAS)
After nei192.1.24.4local-as12 is configured, R2 is successfully transitioned to AS6 and established a neighbor relationship with R4 in as6.
Edit recommendations]