BGP实验第9-10选路原则

Lab Select Path 9-10

Platform:cisco iou

实验目的:理解BGP第九,第十选路原则。
9、如果配置了“maximum-path N”。而且从同一个AS的对等体收到多条外部路由,侧可以将N条路由加入到路由表中,使EBGP负载分担。
10、EBGP路径优先于最老的路由。

先看看第十条原则:
Step 1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
Step 2、R2,R3,R4上运行ISIS,以及在其之间运行IBGP;R1和R2,R1和R3之间运行EBGP。
R1--------------------------------------------------------
router bgp 1
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 neighbor 12.1.1.2 remote-as 234
 neighbor 13.1.1.3 remote-as 234
 no auto-summary
--------------------------------------------------------
R2--------------------------------------------------------
router isis 
 net 49.0001.2222.2222.2222.00
!
router bgp 234
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 3.3.3.3 remote-as 234
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 3.3.3.3 next-hop-self
 neighbor 4.4.4.4 remote-as 234
 neighbor 4.4.4.4 update-source Loopback0
 neighbor 4.4.4.4 next-hop-self
 neighbor 12.1.1.1 remote-as 1
 no auto-summary

interface Loopback0
 ip address 2.2.2.2 255.255.255.255
 ip router isis 

interface Serial0/1
 ip address 24.1.1.2 255.255.255.0
 ip router isis 
-------------------------------------------------------------
R3------------------------------------------------------------
router isis 
 net 49.0001.3333.3333.3333.00
!
router bgp 234
 no synchronization
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 234
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 next-hop-self
 neighbor 4.4.4.4 remote-as 234
 neighbor 4.4.4.4 update-source Loopback0
 neighbor 4.4.4.4 next-hop-self
 neighbor 13.1.1.1 remote-as 1
 no auto-summary

interface Loopback0
 ip address 3.3.3.3 255.255.255.255
 ip router isis 

interface Serial0/1
 ip address 34.1.1.3 255.255.255.0
 ip router isis 
----------------------------------------------------------------
R4---------------------------------------------------------------
router isis 
 net 49.0001.4444.4444.4444.00
!
router bgp 234
 no synchronization
 bgp router-id 4.4.4.4
 bgp log-neighbor-changes
 network 4.4.4.4 mask 255.255.255.255
 neighbor 2.2.2.2 remote-as 234
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 next-hop-self
 neighbor 3.3.3.3 remote-as 234
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 3.3.3.3 next-hop-self
 no auto-summary

interface Loopback0
 ip address 4.4.4.4 255.255.255.255
 ip router isis 
!
interface Serial0/0
 ip address 34.1.1.4 255.255.255.0
 ip router isis 

interface Serial0/1
 ip address 24.1.1.4 255.255.255.0
 ip router isis 

------------------------------------------------------------------
Step 3、在R1上sh ip bgp 观察去R4的路由。
R1#sh ip bgp 
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*  4.4.4.4/32       13.1.1.3                               0 234 i
*>                  12.1.1.2                               0 234 i
R1#sh ip bgp su
BGP router identifier 1.1.1.1, local AS number 1
BGP table version is 3, main routing table version 3
2 network entries using 202 bytes of memory
3 path entries using 144 bytes of memory
2 BGP path attribute entries using 120 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 490 total bytes of memory
BGP activity 2/0 prefixes, 3/0 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.1.1.2        4   234       8       8        3    0    0 00:03:38        1
13.1.1.3        4   234       6       7        3    0    0 00:01:28        1

R1(config-router)#maximum-paths 2

R1#sh ip route 
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets C       1.1.1.1 is directly connected, Loopback0      4.0.0.0/32 is subnetted, 1 subnets B       4.4.4.4 [20/0] via 13.1.1.3, 00:00:10                 [20/0] via 12.1.1.2, 00:00:10      12.0.0.0/24 is subnetted, 1 subnets C       12.1.1.0 is directly connected, Serial0/0      13.0.0.0/24 is subnetted, 1 subnets C       13.1.1.0 is directly connected, Serial0/1