實驗拓撲
實驗需求
R1、R2完成接口IPv6地址的配置;
R1、R2按圖示運行OSPF。R2的三個Loopback接口并不直接激活OSPFv3,而是以重發布的形式注入;
在R1、R2上分別執行OSPF路由匯總,使得雙方的路由表中關于對方的Loopback只學習到一條匯總路由。
實驗步驟及配置
R1、R2完成接口IPv6地址的配置
R1的配置如下:
?
[R1]?ipv6 [R1]?interface?gigabitEthernet0/0/0 [R1-GgabitEthernet0/0/0]?ipv6?enable [R1-GgabitEthernet0/0/0]?ipv6?address?2001:1?64 [R1-GgabitEthernet0/0/0]?quit [R1]?interface?loopback1 [R1-LoopBack1]?ipv6?enable [R1-LoopBack1]?ipv6?address?20011::FFFF?64 [R1]?interface?loopback2 [R1-LoopBack2]?ipv6?enable [R1-LoopBack2]?ipv6?address?20012::FFFF?64 [R1]?interface?loopback3 [R1-LoopBack3]?ipv6?enable [R1-LoopBack3]?ipv6?address?20013::FFFF?64
?
R2的配置如下:
?
[R2]?ipv6 [R2]?interface?gigabitEthernet0/0/0 [R2-GgabitEthernet0/0/0]?ipv6?enable [R2-GgabitEthernet0/0/0]?ipv6?address?2001:2?64 [R2-GgabitEthernet0/0/0]?quit [R2]?interface?loopback1 [R2-LoopBack1]?ipv6?enable [R2-LoopBack1]?ipv6?address?20011::FFFF?64 [R2]?interface?loopback2 [R2-LoopBack2]?ipv6?enable [R2-LoopBack2]?ipv6?address?20012::FFFF?64 [R2]?interface?loopback3 [R2-LoopBack3]?ipv6?enable [R2-LoopBack3]?ipv6?address?20013::FFFF?64
?
R1、R2運行OSPFv3
R1的配置如下:
?
[R1]?ospfv3?1 [R1-ospfv3-1]?router-id?1.1.1.1 [R1-ospfv3-1]?quit [R1]?interface?gigabitEthernet0/0/0 [R1-GgabitEthernet0/0/0]?ospfv3?1?area?0 [R1]?interface?loopback?1 [R1-LoopBack1]?ospfv3?1?area?1 [R1]?interface?loopback?2 [R1-LoopBack2]?ospfv3?1?area?1 [R1]?interface?loopback?3 [R1-LoopBack3]?ospfv3?1?area?1
?
R2的配置如下:
?
[R2]?ospfv3?1 [R2-ospfv3-1]?router-id?2.2.2.2 [R2-ospfv3-1]?import-route?direct??#將直連路由重發布到OSPF [R2-ospfv3-1]?quit [R2]?interface?gigabitEthernet0/0/0 [R2-GgabitEthernet0/0/0]?ospfv3?1?area?0
?
完成上述配置后,查看一下R1、R2的路由表:
?
[R1]?display?ipv6?routing-table?protocol?ospfv3 Public?Routing?Table?:?OSPFv3 Summary?Count?:?7 OSPFv3?Routing?Table's?Status?:? Summary?Count?:?3 Destination?:?20011::?PrefixLength?:?64 NextHop?:?FE80:FCFF4314?Preference?:?150 Cost?:?1?Protocol?:?OSPFv3ASE RelayNextHop?:?::?TunnelID?:?0x0 Interface?:?GigabitEthernet0/0/0?Flags?:?D Destination?:?20012::?PrefixLength?:?64 NextHop?:?FE80:FCFF4314?Preference?:?150 Cost?:?1?Protocol?:?OSPFv3ASE RelayNextHop?:?::?TunnelID?:?0x0 Interface?:?GigabitEthernet0/0/0?Flags?:?D Destination?:?20013::?PrefixLength?:?64 NextHop?:?FE80:FCFF4314?Preference?:?150 Cost?:?1?Protocol?:?OSPFv3ASE RelayNextHop?:?::?TunnelID?:?0x0 Interface?:?GigabitEthernet0/0/0?Flags?:?D
?
R1已經通過OSPFv3學習到R2的三個Loopback接口路由。
?
[R2]?display?ipv6?routing-table?protocol?ospfv3 Public?Routing?Table?:?OSPFv3 Summary?Count?:?4 OSPFv3?Routing?Table's?Status?:? Summary?Count?:?3 Destination?:?20011::FFFF?PrefixLength?:?128 NextHop?:?FE80:FCFF416B?Preference?:?10 Cost?:?1?Protocol?:?OSPFv3 RelayNextHop?:?::?TunnelID?:?0x0 Interface?:?GigabitEthernet0/0/0?Flags?:?D Destination?:?20012::FFFF?PrefixLength?:?128 NextHop?:?FE80:FCFF416B?Preference?:?10 Cost?:?1?Protocol?:?OSPFv3 RelayNextHop?:?::?TunnelID?:?0x0 Interface?:?GigabitEthernet0/0/0?Flags?:?D Destination?:?20013::FFFF?PrefixLength?:?128 NextHop?:?FE80:FCFF416B?Preference?:?10 Cost?:?1?Protocol?:?OSPFv3 RelayNextHop?:?::?TunnelID?:?0x0 Interface?:?GigabitEthernet0/0/0?Flags?:?D
?
R2也已經學習到了R1的Loopback接口路由,這些路由在R2的路由表中以/128掩碼的形式存在,這是正常的,因為缺省情況下OSPF將Loopback接口視為stub host,因此以主機路由的形式通告之。
R1、R2部署OSPFv3路由匯總
首先在R1上部署路由匯總,將Area 1內的路由匯總成2001:/32。R1的配置如下:
?
[R1]?ospfv3?1 [R1-ospfv3-1]?area?1 [R1-ospfv3-1-area-0.0.0.1]?abr-summary?2001:?32
?
完成上述配置后,R2的路由表就變精簡了,R1不會再將自己Loopback接口的路由以明細的方式通告出去,而是通告一條匯總路由:2001:/32:
?
[R2]?display?ipv6?routing-table?protocol?ospf Public?Routing?Table?:?OSPFv3 Summary?Count?:?2 OSPFv3?Routing?Table's?Status?:? Summary?Count?:?1 Destination?:?2001:?PrefixLength?:?32 NextHop?:?FE80:FCFF416B?Preference?:?10 Cost?:?1?Protocol?:?OSPFv3 RelayNextHop?:?::?TunnelID?:?0x0 Interface?:?GigabitEthernet0/0/0?Flags?:?D
?
接著在ASBR R2上執行路由匯總,這種路由匯總方式是對注入到OSPF的外部路由進行的路由匯總,匯總后的路由是2001:/32,R2的配置如下:
?
[R2]?ospfv3?1 [R2-ospfv3-1]?asbr-summary?2001:?32
?
完成上述配置后R1的路由表也精簡了:
?
[R1]?display?ipv6?routing-table?protocol?ospfv3 Public?Routing?Table?:?OSPFv3 Summary?Count?:?5 OSPFv3?Routing?Table's?Status?:? Summary?Count?:?1 Destination?:?2001:?PrefixLength?:?32 NextHop?:?FE80:FCFF4314?Preference?:?150 Cost?:?2?Protocol?:?OSPFv3ASE RelayNextHop?:?::?TunnelID?:?0x0 Interface?:?GigabitEthernet0/0/0?Flags?:?D
?
審核編輯:湯梓紅
評論
查看更多