找回密码
 注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 9969|回复: 1

在Cisco路由器上配置OSPFv3路由协议(进阶篇)

[复制链接]
满天星 发表于 2011-1-3 13:57:35 | 显示全部楼层 |阅读模式
在之前已有一篇关于在Cisco路由器上配置OSPFv3基本功能的教程:
在Cisco路由器上配置OSPFv3路由协议

该教程除了说明配置上与IPv4中OSPFv2配置的不同外,没有什么特殊之处,无法体现IPv6网络下OSPFv3的各种强大功能,因OSPF是目前网络中使用相当广泛的路由协议,因此本帖以OSPFv3为例,讲述在IPv6网络下OSPFv3的二种新功能,这是OSPFv2中所完全不具备的,本教程不涉及枯燥的协议原理与报文格式,仅以最终表现的效果来向大家展示。
如需深入了解OSPFv3协议原理及报文格式的朋友,建议参考RFC 5340(已废除原有的RFC 2740)

在Cisco路由器上配置OSPFv3路由协议(进阶篇)
     下面我们将以Cisco路由器为例来演示如何配置IPv6下的OSPFv3路由协议,本次实验采用四台Router及一个Switch,router1.ipv6bbs.cn与router2.ipv6bbs.cn、router3.ipv6bbs.cn、router4.ipv6bbs.cn的一个接口通过一个Switch相连,处于一条链路上(IPv4中一般称为同一个子网中)。
新功能之一:请大家仔细看:所有router的接口IPv6地址,他们均在不同的一个网段,这样也能建立邻居?图没画错吧?在IPv4下它显然是不可能的,但在IPv6下却没有任何问题。不仅仅OSPFv3路由协议如此,RIPng、ISISv6、EIGRPv6等各种IPv6下的路由协议均是如此。这些都归功于IPv6下无处不在的链路本地地址(fe80::/10),所有邻居均是通过link-local地址建立,因此即使他们的全球单播地址不在一个网段也能建立邻居。
新功能之二:router1.ipv6bbs.cn只与router2.ipv6bbs.cn建立邻居,而router3.ipv6bbs.cn只与router4.ipv6bbs.cn建立邻居。这个在IPv4下是比较麻烦的,可以通过设置认证来实现,但是IPv6下却非常容易,通instance id来识别,它是报文格式中所必须的一个字段,默认均为0,只有相同id的才能建立邻居。
OK,二个最基本的原理已经介绍完了,请根据后面的组网图及配置进行配置,OSPFv3的强大功能不仅仅是本文中列举的这二点。
   
实验组网图与IPv6地址分配

    各设备的接口IPv6地址地址与接口编号请对照下图查看:
     



配置思路与流程说明:

  • 在每台设备上开启IPV6功能:ipv6 unicast-routing
  • 在每台设备上创建OSPFv3进程号1:ipv6 router  ospf   1
  • 为每台设备的OSPFv3进程配置唯一的router-id:router-id  1.1.1.1
              注意:此处的router-id与IPv4中的OSPF一样,仍未32位的IPv4地址形式,但仅标识ID,无IPv4中地址的意义
  • 在相应接口下开启IPv6:ipv6 enable,并配置IPv6地址:ipv6 address  1::1/64
  • 在相应的接口下使能OSPFv3路由协议,并配置该接口需加入的OSPFv3区域号:ipv6 ospf 1 area 0 instance  200



router1.ipv6bbs.cn的配置步骤:

router1.ipv6bbs.cn con0 is now available
Press RETURN to get started.
router1.ipv6bbs.cn>enable
router1.ipv6bbs.cn#configure  terminal
Enter configuration commands, one per line.  End with CNTL/Z.
router1.ipv6bbs.cn(config)#ipv6 unicast-routing
router1.ipv6bbs.cn(config)#ipv6 router ospf 1
router1.ipv6bbs.cn(config-rtr)#
*Dec 25 14:57:46.395: %OSPFv3-4-NORTRID: OSPFv3 process 1 could not pick a router-id,
please configure manually
router1.ipv6bbs.cn(config-rtr)#router-id  1.1.1.1
router1.ipv6bbs.cn(config-rtr)#exit
router1.ipv6bbs.cn(config)#interface  FastEthernet  1/0
router1.ipv6bbs.cn(config-if)#ipv6 enable
router1.ipv6bbs.cn(config-if)#ipv6 address 1::1/64
router1.ipv6bbs.cn(config-if)#ipv6 ospf 1 area 0 instance  100
router1.ipv6bbs.cn(config-if)#no shutdown
router1.ipv6bbs.cn(config-if)#
*Dec 25 14:58:31.215: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Dec 25 14:58:32.215: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
router1.ipv6bbs.cn(config-if)#



router2.ipv6bbs.cn的配置步骤:

router2.ipv6bbs.cn con0 is now available
Press RETURN to get started.
router2.ipv6bbs.cn>enable
router2.ipv6bbs.cn#configure  terminal
Enter configuration commands, one per line.  End with CNTL/Z.
router2.ipv6bbs.cn(config)#ipv6 unicast-routing
router2.ipv6bbs.cn(config)#ipv6 router ospf 1
router2.ipv6bbs.cn(config-rtr)#
*Dec 25 14:58:54.259: %OSPFv3-4-NORTRID: OSPFv3 process 1 could not pick a router-id,
please configure manually
router2.ipv6bbs.cn(config-rtr)#router-id  2.2.2.2
router2.ipv6bbs.cn(config-rtr)#exit
router2.ipv6bbs.cn(config)#interface  fastEthernet  1/0
router2.ipv6bbs.cn(config-if)#ipv6 enable
router2.ipv6bbs.cn(config-if)#ipv6 address 2::2/64
router2.ipv6bbs.cn(config-if)#ipv6 ospf 1 area 0 instance  100
router2.ipv6bbs.cn(config-if)#no shutdown
router2.ipv6bbs.cn(config-if)#
*Dec 25 15:00:10.491: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Dec 25 15:00:11.491: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
*Dec 25 15:00:13.923: %OSPFv3-5-ADJCHG: Process 1, Nbr 1.1.1.1 on FastEthernet1/0 from LOADING to FULL, Loading Done
router2.ipv6bbs.cn(config-if)#



router3.ipv6bbs.cn的配置步骤:

router3.ipv6bbs.cn con0 is now available
Press RETURN to get started.
router3.ipv6bbs.cn>enable
router3.ipv6bbs.cn#configure  terminal
Enter configuration commands, one per line.  End with CNTL/Z.
router3.ipv6bbs.cn(config)#ipv6 unicast-routing
router3.ipv6bbs.cn(config)#ipv6 router ospf 1
router3.ipv6bbs.cn(config-rtr)#
*Dec 25 15:01:34.071: %OSPFv3-4-NORTRID: OSPFv3 process 1 could not pick a router-id,
please configure manually
router3.ipv6bbs.cn(config-rtr)#router-id  3.3.3.3
router3.ipv6bbs.cn(config-rtr)#exit
router3.ipv6bbs.cn(config)#interface  fastEthernet  1/0
router3.ipv6bbs.cn(config-if)#ipv6 enable
router3.ipv6bbs.cn(config-if)#ipv6 address 3::3/64
router3.ipv6bbs.cn(config-if)#ipv6 ospf 1 area 0 instance  200
router3.ipv6bbs.cn(config-if)#no shutdown
router3.ipv6bbs.cn(config-if)#
router3.ipv6bbs.cn(config-if)#
*Dec 25 15:02:09.359: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Dec 25 15:02:10.359: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
router3.ipv6bbs.cn(config-if)#


router4.ipv6bbs.cn的配置步骤:

router4.ipv6bbs.cn con0 is now available
Press RETURN to get started.
router4.ipv6bbs.cn>enable
router4.ipv6bbs.cn#configure  terminal
Enter configuration commands, one per line.  End with CNTL/Z.
router4.ipv6bbs.cn(config)#ipv6 unicast-routing
router4.ipv6bbs.cn(config)#ipv6 router ospf 1
router4.ipv6bbs.cn(config-rtr)#
*Dec 25 15:05:13.371: %OSPFv3-4-NORTRID: OSPFv3 process 1 could not pick a router-id,
please configure manually
router4.ipv6bbs.cn(config-rtr)#router-id  4.4.4.4
router4.ipv6bbs.cn(config-rtr)#exit
router4.ipv6bbs.cn(config)#interface  fastEthernet  1/0
router4.ipv6bbs.cn(config-if)#ipv6 enable
router4.ipv6bbs.cn(config-if)#ipv6 address 4::4/64
router4.ipv6bbs.cn(config-if)#ipv6 ospf 1 area 0 instance  200
router4.ipv6bbs.cn(config-if)#no shutdown
router4.ipv6bbs.cn(config-if)#
*Dec 25 15:06:38.187: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Dec 25 15:06:39.187: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
router4.ipv6bbs.cn(config-if)#
router4.ipv6bbs.cn(config-if)#
*Dec 25 15:06:41.423: %OSPFv3-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet1/0 from LOADING to FULL, Loading Done
router4.ipv6bbs.cn(config-if)#^Z


查看各设备IPv6路由表与OSPFv3邻居状态

所有设备之间的OSPFv3已按照组网图配置完毕,我们可以在router1.ipv6bbs.cn上查看OSPFv3邻居,
并查看IPv6路由表,ping  router2.ipv6bbs.cn通讯正常,但ping router3.ipv6bbs.cn及router4.ipv6bbs.cn上面的接口ipv6地址,因为路由不可达,所以无法ping通

router1.ipv6bbs.cn#show ipv6 ospf neighbor

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
2.2.2.2           1   FULL/BDR        00:00:38    4               FastEthernet1/0
router1.ipv6bbs.cn#
router1.ipv6bbs.cn#ping ipv6 2::2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/282/744 ms
router1.ipv6bbs.cn#ping ipv6 3::3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3::3, timeout is 2 seconds:

% No valid source address for destination
Success rate is 0 percent (0/1)
router1.ipv6bbs.cn#ping ipv 4::4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4::4, timeout is 2 seconds:

% No valid source address for destination
Success rate is 0 percent (0/1)
router1.ipv6bbs.cn#show ipv6 route
IPv6 Routing Table - default - 4 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - Neighbor Discovery
       O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
C   1::/64 [0/0]
     via FastEthernet1/0, directly connected
L   1::1/128 [0/0]
     via FastEthernet1/0, receive
O   2::/64 [110/1]
     via FastEthernet1/0, directly connected
L   FF00::/8 [0/0]
     via Null0, receive
router1.ipv6bbs.cn#


查看router2.ipv6bbs.cn上面的OSPFv3邻居状态:

router2.ipv6bbs.cn#show ipv6 ospf neighbor

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
1.1.1.1           1   FULL/DR         00:00:31    4               FastEthernet1/0
router2.ipv6bbs.cn#


查看router3.ipv6bbs.cn上面的OSPFv3邻居状态与IPv6路由表,并ping其它设备的接口IPv6地址,与router1.ipv6bbs.cn上原因类似:

router3.ipv6bbs.cn#show ipv6  ospf  neighbor

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
4.4.4.4           1   FULL/BDR        00:00:35    4               FastEthernet1/0
router3.ipv6bbs.cn#ping ipv6 4::4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4::4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/232/628 ms
router3.ipv6bbs.cn#ping ipv 1::1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1::1, timeout is 2 seconds:

% No valid source address for destination
Success rate is 0 percent (0/1)
router3.ipv6bbs.cn#show ipv6 route
IPv6 Routing Table - default - 4 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1
       I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
       EX - EIGRP external, ND - Neighbor Discovery
       O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
C   3::/64 [0/0]
     via FastEthernet1/0, directly connected
L   3::3/128 [0/0]
     via FastEthernet1/0, receive
O   4::/64 [110/1]
     via FastEthernet1/0, directly connected
L   FF00::/8 [0/0]
     via Null0, receive
router3.ipv6bbs.cn#show ipv6 ospf neighbor

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
4.4.4.4           1   FULL/BDR        00:00:36    4               FastEthernet1/0
router3.ipv6bbs.cn#



查看router4.ipv6bbs.cn上面的OSPFv3邻居状态:

router4.ipv6bbs.cn#show ipv6 ospf neighbor

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
3.3.3.3           1   FULL/DR         00:00:36    4               FastEthernet1/0
router4.ipv6bbs.cn#

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
gc4543 发表于 2011-6-2 13:37:21 | 显示全部楼层
感谢分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|IPv6BBS ( 京ICP备13024693号 | 京公网安备11010802012238 )

GMT+8, 2024-3-19 17:45 , Processed in 0.024325 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表