50. Configuring Basic MP-BGP 4 and Aggregate Addressing

1、掌握基于 IPv6 的 MP-BGP4 配置。

2、配置 MP-BGP4 地址聚合。

 

实验拓扑图:

image.png



配置各台路由器的 IPv6 地址,并且使用 ping 命令确认直连接口的互通性

 

根据拓扑在三台路由器上配置MP-BGP4路由协议:

R1(config)#router bgp 64512

R1(config-router)#bgp router-id 1.1.1.1          --->为BGP指定RouterID,虽然MP-BGP4可以为IPv6提供路由,但还要一个32

R1(config-router)#neighbor 2001:ab1:0:2::2 remote 64512  位长度的RouterID,如果不配置则会导致BGP邻居关系无法创建,也可

R1(config-router)#no synchronization               以为本地路由器配置一个IPv4地址的回环口,类似OSPF的方法。

R1(config-router)#address-family ipv6           --->进入IPv6地址簇

R1(config-router-af)#neighbor 2001:ab1:0:2::2 activate--->在IPv6地址簇下激活邻居对等体关系

R1(config-router-af)#network 2001:ab1:0:8::/64

R1(config-router-af)#network 2001:ab1:0:9::/64

R1(config-router-af)#network 2001:ab1:0:a::/64

R1(config-router-af)#network 2001:ab1:0:b::/64

R1(config-router-af)#network 2001:ab1:0:2::/64

R1(config-router-af)#exit

 

R2(config)#router bgp 64512

R2(config-router)#bgp router-id 2.2.2.2

R2(config-router)#no synchronization

R2(config-router)#neighbor 2001:ab1:0:2::1 remote 64512

R2(config-router)#neighbor 2001:ab1:0:3::2 remote 64513

R2(config-router)#address-family ipv6

R2(config-router-af)#neighbor 2001:ab1:0:2::1 activate

R2(config-router-af)#neighbor 2001:ab1:0:3::2 activate

R2(config-router-af)#network 2001:ab1:0:2::/64

R2(config-router-af)#network 2001:ab1:0:3::/64

R2(config-router-af)#exit

 

R3(config)#router bgp 64513

bgp router-id 3.3.3.3

R3(config-router)#no synchronization

R3(config-router)#neighbor 2001:ab1:0:3::1 remote 64512

R3(config-router)#address-family ipv6

R3(config-router-af)#neighbor 2001:ab1:0:3::1 activate

R3(config-router-af)#network 2001:ab1:0:3::/64

R3(config-router-af)#network 2001:ab1:0:4::/64

R3(config-router-af)#exit

 

查看路由表并测试:

R3#show ipv6 route

IPv6 Routing Table - 10 entries

Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP

       U - Per-user Static route, M - MIPv6

       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary

       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2

       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

       D - EIGRP, EX - EIGRP external

B   2001:AB1:0:2::/64 [20/0]

     via FE80::C801:CFF:FE28:0, Serial1/0

C   2001:AB1:0:3::/64 [0/0]

     via ::, Serial1/0

L   2001:AB1:0:3::2/128 [0/0]

     via ::, Serial1/0

C   2001:AB1:0:4::/64 [0/0]

     via ::, Loopback0

L   2001:AB1:0:4::1/128 [0/0]

     via ::, Loopback0

B   2001:AB1:0:8::/64 [20/0]

     via FE80::C801:CFF:FE28:0, Serial1/0

B   2001:AB1:0:9::/64 [20/0]

     via FE80::C801:CFF:FE28:0, Serial1/0

B   2001:AB1:0:A::/64 [20/0]

     via FE80::C801:CFF:FE28:0, Serial1/0

B   2001:AB1:0:B::/64 [20/0]

     via FE80::C801:CFF:FE28:0, Serial1/0

L   FF00::/8 [0/0]

     via ::, Null0

R3#ping 2001:ab1:0:8::1

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:AB1:0:8::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 28/55/76 ms

 

在R2上查看MP-BGP4邻居关系:

R2#show bgp summary

BGP router identifier 2.2.2.2, local AS number 64512

BGP table version is 1, main routing table version 1

 

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

2001:AB1:0:2::1 4 64512       7      8       1    0    0 00:02:17       0

2001:AB1:0:3::2 4 64513       6      7       1    0    0 00:01:37       0

  ---->邻居已经建立

 

查看MP-BGP4的IPv6数据库:

R2#show bgp ipv6 unicast  

BGP table version is 8, local router ID is 2.2.2.2

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

* i2001:AB1:0:2::/64

                    2001:AB1:0:2::1          0    100      0 i

*>                  ::                       0        32768 i

*  2001:AB1:0:3::/64

                    2001:AB1:0:3::2          0            0 64513 i

*>                  ::                       0        32768 i

*> 2001:AB1:0:4::/64

                    2001:AB1:0:3::2          0            0 64513 i

*>i2001:AB1:0:8::/64

                    2001:AB1:0:2::1          0    100      0 i

*>i2001:AB1:0:9::/64

                    2001:AB1:0:2::1          0    100      0 i

*>i2001:AB1:0:A::/64

                    2001:AB1:0:2::1          0    100      0 i

*>i2001:AB1:0:B::/64

                    2001:AB1:0:2::1          0    100      0 i

 

在R2上配置路由聚合:

R2(config)#router bgp 64512

R2(config-router)#address-family ipv6

R2(config-router-af)#aggregate-address 2001:ab1:0:8::/62 summary-only

R2(config-router-af)#exit

 

再看R3上的路由表:

R3#show ipv6 route

IPv6 Routing Table - 7 entries

Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP

       U - Per-user Static route, M - MIPv6

       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary

       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2

       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

       D - EIGRP, EX - EIGRP external

B   2001:AB1:0:2::/64 [20/0]

     via FE80::C801:CFF:FE28:0, Serial1/0

C   2001:AB1:0:3::/64 [0/0]

     via ::, Serial1/0

L   2001:AB1:0:3::2/128 [0/0]

     via ::, Serial1/0

C   2001:AB1:0:4::/64 [0/0]

     via ::, Loopback0

L   2001:AB1:0:4::1/128 [0/0]

     via ::, Loopback0

B   2001:AB1:0:8::/62 [20/0]

     via FE80::C801:CFF:FE28:0, Serial1/0   ---->和汇总是一样的,说法不一样而已

L   FF00::/8 [0/0]

     via ::, Null0

 

在R3上查看聚合路由属性:

R3#show bgp ipv6 2001:AB1:0:8::/62 

BGP routing table entry for 2001:AB1:0:8::/62, version 10

Paths: (1 available, best #1, table Global-IPv6-Table)

  Not advertised to any peer

  64512, (aggregated by 64512 2.2.2.2)  ---->显示是谁聚合了这个路由

    2001:AB1:0:3::1 (FE80::C801:CFF:FE28:0) from 2001:AB1:0:3::1 (2.2.2.2)

      Origin IGP, metric 0, localpref 100, valid, external, atomic-aggregate, best

 

测试:

R3#ping 2001:ab1:0:8::1          

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:AB1:0:8::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 24/44/68 ms

R3#ping 2001:ab1:0:b::1

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:AB1:0:B::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/48/96 ms

 

完成~。



发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

桂ICP备19000498号-3