本文档提供了将开放最短路径优先第3版(OSPFv3)路由重分发到IPv6的多协议BGP的示例。OSPFv3在OSPF第2版上展开,以支持IPv6路由前缀和较大的IPv6地址。多协议 BGP 是一种增强型 BGP,可以为多个网络层协议地址系列(如 IPv6 地址系列)及 IP 多播路由传送路由信息。
尝试进行此配置之前,请确保满足以下要求:
本文档不限于特定的软件和硬件版本。
本文档中的配置基于Cisco 3700系列路由器和Cisco IOS®软件版本12.4(15)T1。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
在本例中,路由器R2和R3通过串行接口连接,并配置了多协议BGP。路由器R2和R3使用OSPFv3与本地路由器R1和R4通信。在路由器中创建环回地址以生成网络。同时运行BGP和OSPFv3的路由器R2和R3使用redistribute命令将OSPFv3路由重分发到BGP。所有路由器都配置了IPv6地址。
注意:使用命令查找工具(仅限注册客户)可查找有关本文档中使用的命令的详细信息。
本文档使用以下网络设置:
本文档使用以下配置:
路由器 R1 |
---|
! version 12.4 ! hostname R1 ! ip cef ! ipv6 unicast-routing !--- Enables the forwarding of IPv6 packets. ! interface Loopback0 no ip address ipv6 address 2222::1/128 ipv6 ospf 1 area 0 !--- Enables OSPFv3 on the interface and associates !--- the interface loopback0 to area 0. ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address 1010:1:1:1::1/64 ipv6 ospf 1 area 0 !--- Associates the Interface Fa0/0 to area 0. ! ipv6 router ospf 1 router-id 1.1.1.1 !--- Router R1 uses 1.1.1.1 as router ID. log-adjacency-changes ! end |
路由器 R2 |
---|
! version 12.4 ! hostname R2 ! ip cef ! ipv6 unicast-routing ! interface Loopback0 no ip address ipv6 address 2010::1/128 ipv6 ospf 1 area 1 ! interface Loopback1 no ip address ipv6 address 2011::1/128 ipv6 ospf 1 area 1 ! interface Loopback99 no ip address ipv6 address 5050:55:55:55::55/128 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address 1010:1:1:1::2/64 ipv6 ospf 1 area 0 ! interface Serial0/0 no ip address ipv6 address 3030:1:1:1::10/64 clock rate 2000000 ! router bgp 65000 bgp router-id 1.1.1.1 no bgp default ipv4-unicast !--- Without configuring "no bgp default ipv4-unicast" only !--- IPv4 will be advertised. bgp log-neighbor-changes neighbor 3030:1:1:1::11 remote-as 65000 neighbor 3030:1:1:1::11 update-source Serial0/0 ! address-family ipv6 neighbor 3030:1:1:1::11 activate network 5050:55:55:55::55/128 redistribute connected redistribute ospf 1 match internal external 1 external 2 !--- This redistributes all OSPF routes into BGP. no synchronization exit-address-family ! ipv6 router ospf 1 router-id 2.2.2.2 log-adjacency-changes ! end |
路由器 R3 |
---|
! version 12.4 ! hostname R3 ! ip cef ! ipv6 unicast-routing ! interface Loopback0 no ip address ipv6 address 1111::1/128 ipv6 ospf 1 area 1 ! interface Loopback1 no ip address ipv6 address 1112::1/128 ipv6 ospf 1 area 1 ! interface Loopback99 no ip address ipv6 address 6060:66:66:66::66/128 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address 2020:1:1:1::2/64 ipv6 ospf 1 area 0 ! interface Serial0/0 no ip address ipv6 address 3030:1:1:1::11/64 clock rate 2000000 ! router bgp 65000 bgp router-id 2.2.2.2 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 3030:1:1:1::10 remote-as 65000 neighbor 3030:1:1:1::10 update-source Serial0/0 ! address-family ipv6 neighbor 3030:1:1:1::10 activate network 6060:66:66:66::66/128 redistribute connected redistribute ospf 1 match internal external 1 external 2 no synchronization exit-address-family ! ipv6 router ospf 1 router-id 3.3.3.3 log-adjacency-changes ! end |
路由器R4 |
---|
! version 12.4 ! hostname R4 ! ip cef ! ipv6 unicast-routing ! interface Loopback0 no ip address ipv6 address 3333::1/128 ipv6 ospf 1 area 0 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address 2020:1:1:1::1/64 ipv6 ospf 1 area 0 ! ipv6 router ospf 1 router-id 5.5.5.5 log-adjacency-changes ! end |
使用本部分可确认配置能否正常运行。
命令输出解释程序(仅限注册用户)(OIT) 支持某些 show 命令。使用 OIT 可查看对 show 命令输出的分析。
以下show命令用于检验配置:
要检验OSPFv3是否配置正确,请在路由器R1和R4中使用show ipv6 route ospf命令。
show ipv6 route ospf |
---|
在路由器 R1 中 R1#show ipv6 route ospf IPv6 Routing Table - 6 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 OI 2010::1/128 [110/10] via FE80::C001:16FF:FEDC:0, FastEthernet0/0 OI 2011::1/128 [110/10] via FE80::C001:16FF:FEDC:0, FastEthernet0/0在路由器R4中 R4#show ipv6 route ospf IPv6 Routing Table - 6 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 OI 1111::1/128 [110/10] via FE80::C002:16FF:FEDC:0, FastEthernet0/0 OI 1112::1/128 [110/10] via FE80::C002:16FF:FEDC:0, FastEthernet0/0 |
要验证OSPFv3路由是否重分发到BGP,请在路由器R2和R3中使用show ipv6 route bgp命令。
show ipv6 route bgp |
---|
在路由器 R2 中 R2#show ipv6 route bgp IPv6 Routing Table - 14 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 1111::1/128 [200/0] via 3030:1:1:1::11 B 1112::1/128 [200/0] via 3030:1:1:1::11 B 2020:1:1:1::/64 [200/0] via 3030:1:1:1::11 B 3333::1/128 [200/10] via 3030:1:1:1::11 !--- The above routes are OSPFv3 routes !--- that are redistributed in to BGP. B 6060:66:66:66::66/128 [200/0] via 3030:1:1:1::11在路由器 R3 中 R3#show ipv6 route bgp IPv6 Routing Table - 14 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 1010:1:1:1::/64 [200/0] via 3030:1:1:1::10 B 2010::1/128 [200/0] via 3030:1:1:1::10 B 2011::1/128 [200/0] via 3030:1:1:1::10 B 2222::1/128 [200/10] via 3030:1:1:1::10 !--- The above routes are OSPFv3 routes !--- that are redistributed in to BGP. B 5050:55:55:55::55/128 [200/0] via 3030:1:1:1::10 |
版本 | 发布日期 | 备注 |
---|---|---|
1.0 |
27-Feb-2012 |
初始版本 |