本文檔提供了將開放最短路徑優先3版(OSPFv3)路由重分發到IPv6多協定BGP的示例。OSPFv3擴展了OSPF版本2,以便支援IPv6路由字首和較大尺寸的IPv6地址。多協定BGP是一種增強型BGP,它承載多個網路層協定地址系列(如IPv6地址系列)和IP組播路由的路由資訊。
嘗試此組態之前,請確保符合以下要求:
本文件所述內容不限於特定軟體和硬體版本。
本檔案中的組態是根據搭載Cisco IOS®軟體版本12.4(15)T1的Cisco 3700系列路由器。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
在本示例中,路由器R2和R3通過串列介面連線,並且配置了多協定BGP。路由器R2和R3使用OSPFv3與其本地路由器R1和R4通訊。在路由器中建立環回地址以生成網路。同時運行BGP和OSPFv3的路由器R2和R3,使用redistribute命令將OSPFv3路由重分發到BGP。所有路由器都配置了IPv6地址。
註:使用Command Lookup Tool(僅限註冊客戶)查詢有關本文檔中使用的命令的更多資訊。
本檔案會使用以下網路設定:
本檔案會使用以下設定:
路由器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 |
初始版本 |