OSPF和OSPFv3实验
1、拓扑图如下(各种地址已标出)
2、IPV6和IPV4的地址规划
设备名称 | 接口 | 地址 |
R1 | Loopback 0 | 2011:091::1/128 |
Loopback 1 | 2111:091::1/128 | |
FastEthernet 1/0 | 2123:091::1/64 | |
192.91.123.1/24(ipv4) | ||
FastEthernet 2/0 | 2019:091::1/64 | |
192.91.17.1/24(ipv4) | ||
R2 | Loopback 0 | 2022:091::1/128 |
FastEthernet 1/0 | 2123:091::2/64 | |
192.91.123.2/24(ipv4) | ||
Serial 0/0 | 2048:091::2/64 | |
192.91.27.2/24(ipv4) | ||
R3 | Loopback 0 | 2033:091::1/128 |
Serial 0/0.1 | 2356:091::3/64 | |
192.91.4.3/24(ipv4) | ||
FastEthernet 1/0 | 2123:091::3/64 | |
2188:091::3/64 | ||
192.91.123.3/24(ipv4) | ||
R5 | Loopback 0 | 2055:091::1/128 |
Serial 0/0.1 | 2356:091::5/64 | |
192.91.4.5/24(ipv4) | ||
R6 | Loopback 0 | 2066:091::1/128 |
Serial 0/1.1 | 2356:091::6/64 | |
192.91.4.6/24(ipv4) | ||
R7 | Loopback 0 | 2077:091::1/128 |
Serial 0/0 | 2048:091::7/64 | |
192.91.27.7/24(ipv4) | ||
FastEthernet 1/0 | 2027:091::7/64 | |
192.91.78.7/24(ipv4) | ||
FastEthernet 2/0 | 2019:091::7/64 | |
192.91.17.7/24(ipv4) | ||
R8 | Loopback 0 | 2088:091::1/128 |
FastEthernet 1/0 | 2027:091::8/64 | |
192.91.78.8/24(ipv4) |
3、连通性测试 使用R5 ping所有路由器
IPV6:
R5 ping R1
R5 ping R2
R5 ping R3
R5 ping R6
R5 ping R7
R5 ping R8
IPV4:
R5 ping R3、R6(帧中继)
R5 ping R1
R5 ping R2
R5 ping R7、R8
4、帧中继的配置
将R4当成帧中继交换机
R4的配置如下:
R4(config)#frame-relay switching
R4(config)#int s0/0
R4(config-if)#no shu
R4(config-if)#clock rate 128000
R4(config-if)#encapsulation frame-relay
R4(config-if)#frame-relay lmi-type cisco
R4(config-if)#frame-relay intf-type dce
R4(config-if)#frame-relay route 305 interface s0/1 503
R4(config-if)#frame-relay route 306 interface s0/2 603
R4(config)#int s0/1
R4(config-if)#no shu
R4(config-if)#clock rate 128000
R4(config-if)#encapsulation frame-relay
R4(config-if)#frame-relay lmi-type cisco
R4(config-if)#frame-relay intf-type dce
R4(config-if)#frame-relay route 503 interface s0/0 305
R4(config)#int s0/2
R4(config-if)#encapsulation frame-relay
R4(config-if)#no shu
R4(config-if)#clock rate 128000
R4(config-if)#encapsulation frame-relay
R4(config-if)#frame-relay lmi-type cisco
R4(config-if)#frame-relay intf-type dce
R4(config-if)#frame-relay route 603 interface s0/0 306
R5的配置如下:
R5(config)#ipv6 unicast-routing
R5(config)#int s0/0
R5(config-if)#encapsulation frame-relay
R5(config-if)#no shu
R5(config)#int s0/0.1 multipoint
R5(config-subif)#no shu
R5(config-subif)#frame-relay map ipv6 2356:091::3 503 broadcast
R5(config-subif)#frame-relay map ipv6 2356:091::6 503 broadcast
R5(config-subif)#frame-relay map ipv6 FE80::CE03:19FF:FEE0:10 503 broadcast
R5(config-subif)#frame-relay map ipv6 FE80::CE06:6FF:FE98:10 503 broadcast
R6的配置如下:
R6(config)#int s0/1
R6(config-if)#encap frame-relay
R6(config-if)#no shu
R6(config)#int s0/1.1 multipoint
R6(config-subif)#no shu
R6(config-subif)#frame-relay map ipv6 2356:091::3 603 broadcast
R6(config-subif)#frame-relay map ipv6 2356:091::5 603 broadcast
R6(config-subif)#frame-relay map ipv6 2356:091::6 603 broadcast
R6(config-subif)#frame-relay map ipv6 FE80::CE05:6FF:FE4C:10 603 broadcast
R6(config-subif)#frame-relay map ipv6 FE80::CE03:19FF:FEE0:10 603 broadcast
R6(config-subif)#exit
ipv6帧中继配置完成
ipv4帧中继配置如下
R5的ipv4配置
R5(config)#int s0/0.1 multipoint
R5(config-subif)#frame-relay map ip 192.91.4.3 503 broadcast
R5(config-subif)#frame-relay map ip 192.91.4.6 503 broadcast
R5(config-subif)#frame-relay map ip 192.91.4.5 503 broadcast
R6的ipv4配置
R6(config)#int s0/1.1 multipoint
R6(config-subif)#frame-relay map ip 192.91.4.3 603 broadcast
R6(config-subif)#frame-relay map ip 192.91.4.5 603 broadcast
R6(config-subif)#frame-relay map ip 192.91.4.6 603 broadcast
R3的ipv4配置
R3(config)#int s0/0.1 multipoint
R3(config-subif)#frame-relay map ip 192.91.4.6 306 broadcast
R3(config-subif)#frame-relay map ip 192.91.4.5 305 broadcast
R3(config-subif)#frame-relay map ip 192.91.4.3 305 broadcast
R4的ipv4配置已经在ipv6的配置中配完,故无需再配置
5、OSPF和NSSA的配置
R1的配置如下:
R1(config)#ipv6 router ospf 1
R1(config-rtr)#router-id
R1(config-rtr)#router-id 1.1.1.1
R1(config-rtr)#area 1 nssa 将R1的OSPF 1中的area 1划为NSSA
R1(config)#int f1/0
R1(config-if)#ipv6 ospf 1 area 0
R1(config)#int f2/0
R1(config-if)#ipv6 ospf 1 area 1
R2、R3、R5、R6、R7同理
因为R3、R5、R7是有帧中继的,要将帧中继配置进OSPF,要手动配置邻居local地址
R3(config)#int s0/0.1 mul
R3(config-subif)#ipv6 ospf neighbor FE80::CE06:6FF:FE98:10
R3(config-subif)#ipv6 ospf neighbor FE80::CE05:6FF:FE4C:10
在 R1上查看 R7生成的这类 LSA:
ipv4用的OSPF2中的area 1划为NSSA
R1(config)router ospf 2
R1(config-rtr)#router-id
R1(config-rtr)#router-id 1.1.1.11
R1(config-rtr)#network 192.91.17.0 0.0.0.255 area1 宣告网段
R1(config-rtr)#network 192.91.123.0 0.0.0.255 area1 宣告网段
R1(config-rtr)#area 1 nssa
R2、R3、R5、R6、R7同理
在R1上查看R7生成的LSA:
6、路由汇总
R1的配置如下:
R1(config)#int f1/0
R1(config-if)#ipv6 ospf 1 area 0
R1(config)#int f2/0
R1(config-if)#ipv6 ospf 1 area 1
R2、R3、R5、R6、R7同理
外部路由汇总
R1(config)#ipv6 router ospf 1
R1(config-rtr)#summary-prefix 2111:091::0/64
R2、R3、R5、R6、R7同理
区域间路由汇总
R3(config)#ipv6 router ospf 1
R3(config-rtr)#area 0 range 2011:091::0/64
R1、R2、R5、R6、R7同理
7、RIPng和RIP的配置
R8的配置如下:
R8(config)#ipv6 router rip yeslab
R8(config)#int f1/0
R8(config-if)#ipv6 rip yeslab enable
R8(config)#int loopback 0
R8(config-if)#ipv6 rip yeslab enable
R7的配置如下:
R7(config)#ipv6 router ospf 1
R7(config)#int f1/0
R7(config-if)#ipv6 rip yeslab enable
R7(config-rtr)#redistribute rip yeslab metric 1
R7(config)#ipv6 router rip yeslab
R7(config-rtr)#redistribute ospf 1 metric 8
R7(config-rtr)#redistribute connected
查看R8 rip路由表
ipv4的RIP的配置
R8的配置如下:
R8(config)#router rip
R8(config-router)#network 192.91.78.0
R8(config-router)#no auto-summary
R7的配置如下:
R7(config)#router rip
R7(config-router)#network 192.91.78.0
R7(config-router)#no auto-summary
R7(config-router)#redistribute ospf 2 metric 3
R7(config-router)#redistribute connected
查看R8 RIP路由表
8、路由注入
R7(config-router)#area 1 nssa default-information-originate
通过路由汇总、RIPng的配置和路由注入后,查看R3的OSPF邻居和R5路由表、R3的OSPF 邻居
R5的ipv6路由表
R5的ipv4路由表
可以发现R5学习到了R1、R2、R3、R6、R7、R8 的ipv6和ipv4地址
实现了全网互通。
9、总结
通过这次的OSPFv3的作业,使我学会了ipv6帧中继的配置,ipv6 ospfv3与ipv4 ospf 的配置区别、RIPng在OSPFv3中的重发布。在RIPng与OSPFv3的重发布学习路由表中,遇到了一些问题,导致R7重发布后R8也无法学习到别的路由器的路由表、后面通过进入OSPF 1中redistribute ospf 1 metric 这个命令学习到了路由表。