找回密码
 注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 10494|回复: 2

在Cisco路由器上配置IPv6静态路由

[复制链接]
满天星 发表于 2010-9-5 21:29:26 | 显示全部楼层 |阅读模式
在Cisco路由器上配置IPv6静态路由
     下面我们将以Cisco路由器为例来演示如何配置IPv6静态路由,本次实验采用三台Router,router1.ipv6bbs.cn、router2.ipv6bbs.cn、router3.ipv6bbs.cn均配置IPv6静态路由,每台Router上均起一个Loopback1接口,通过配置静态路由保证三台路由器均可ping通所有设备上的loopback接口。在router1.ipv6bbs.cn与router3.ipv6bbs.cn这二台路由器中我们均只配置一条默认路由至router2.ipv6bbs.cn的直连接口IPv6地址。具体的组网图如下所示:
   
实验组网图与IPv6地址分配

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



配置思路与流程说明:

  • 在每台设备上开启IPV6功能:ipv6 unicast-routing
  • 在相应接口下开启IPv6并配置各接口IPv6地址:ipv6 enable,并配置IPv6地址:ipv6 address  1::1/128
  • 配置IPv6静态路由(::/0为默认路由):ipv6 route ::/0 1002::2



router1.ipv6bbs.cn的配置步骤:

router1.ipv6bbs.cn con0 is now available

Press RETURN to get started.

router1.ipv6bbs.cn>
router1.ipv6bbs.cn>enable
router1.ipv6bbs.cn#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
router1.ipv6bbs.cn(config)#ipv6 unicast-routing
router1.ipv6bbs.cn(config)#interface loopback1
router1.ipv6bbs.cn(config-if)#
*Aug 18 21:39:56.047: %LINK-3-UPDOWN: Interface Loopback1, changed state to up
*Aug 18 21:39:57.047: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
router1.ipv6bbs.cn(config-if)#ipv6 enable
router1.ipv6bbs.cn(config-if)#ipv6 address  1::1/128
router1.ipv6bbs.cn(config-if)#exit
router1.ipv6bbs.cn(config)#interface gigabitEthernet 0/0
router1.ipv6bbs.cn(config-if)#ipv6 enable
router1.ipv6bbs.cn(config-if)#ipv6 address 1002::1/64
router1.ipv6bbs.cn(config-if)#no shutdown
router1.ipv6bbs.cn(config-if)#
*Aug 18 21:41:12.455: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up
*Aug 18 21:41:13.455: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
router1.ipv6bbs.cn(config-if)#
router1.ipv6bbs.cn(config)#ipv6 route ::/0 1002::2
router1.ipv6bbs.cn(config)#exit
router1.ipv6bbs.cn#
router1.ipv6bbs.cn#show ipv6 route
IPv6 Routing Table - default - 5 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
S   ::/0 [1/0]
     via 1002::2
LC  1::1/128 [0/0]
     via Loopback1, receive
C   1002::/64 [0/0]
     via GigabitEthernet0/0, directly connected
L   1002::1/128 [0/0]
     via GigabitEthernet0/0, receive
L   FF00::/8 [0/0]
     via Null0, receive
router1.ipv6bbs.cn#



router2.ipv6bbs.cn的配置步骤:

router2.ipv6bbs.cn con0 is now available

Press RETURN to get started.

router2.ipv6bbs.cn>
router2.ipv6bbs.cn>enable
router2.ipv6bbs.cn#config t
Enter configuration commands, one per line.  End with CNTL/Z.
router2.ipv6bbs.cn(config)#ipv6 unicast-routing
router2.ipv6bbs.cn(config)#interface loopback1
router2.ipv6bbs.cn(config-if)#
*Aug 18 21:42:29.287: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
router2.ipv6bbs.cn(config-if)#ipv6 enable
router2.ipv6bbs.cn(config-if)#ipv6 address 2::2/128
router2.ipv6bbs.cn(config-if)#exit
router2.ipv6bbs.cn(config)#interface gigabitEthernet  0/0
router2.ipv6bbs.cn(config-if)#ipv6 enable
router2.ipv6bbs.cn(config-if)#ipv6 address 1002::2/64
router2.ipv6bbs.cn(config-if)#no shutdown
router2.ipv6bbs.cn(config-if)#
*Aug 18 21:44:07.651: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up
*Aug 18 21:44:08.651: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
router2.ipv6bbs.cn(config-if)#
*Aug 18 21:44:10.399: %OSPFv3-5-ADJCHG: Process 100, Nbr 1.1.1.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
router2.ipv6bbs.cn(config-if)#exit
router2.ipv6bbs.cn(config)#interface gigabitEthernet  1/0
router2.ipv6bbs.cn(config-if)#ipv6 enable
router2.ipv6bbs.cn(config-if)#ipv6  address 2003::1/64
router2.ipv6bbs.cn(config-if)#no shutdown
router2.ipv6bbs.cn(config-if)#
*Aug 18 21:44:58.571: %LINK-3-UPDOWN: Interface GigabitEthernet1/0, changed state to up
*Aug 18 21:44:59.571: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0, changed state to up
router2.ipv6bbs.cn(config-if)#exit
router2.ipv6bbs.cn(config)#
router2.ipv6bbs.cn(config)#ipv6 route 1::1/128 1002::1
router2.ipv6bbs.cn(config)#ipv6 route 3::3/128 2003::2
router2.ipv6bbs.cn(config)#exit
router2.ipv6bbs.cn#
router2.ipv6bbs.cn#show ipv6 route
IPv6 Routing Table - default - 8 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
S   1::1/128 [1/0]
     via 1002::1
LC  2::2/128 [0/0]
     via Loopback1, receive
S   3::3/128 [1/0]
     via 2003::2
C   1002::/64 [0/0]
     via GigabitEthernet0/0, directly connected
L   1002::2/128 [0/0]
     via GigabitEthernet0/0, receive
C   2003::/64 [0/0]
     via GigabitEthernet1/0, directly connected
L   2003::1/128 [0/0]
     via GigabitEthernet1/0, receive
L   FF00::/8 [0/0]
     via Null0, receive
router2.ipv6bbs.cn#



router3.ipv6bbs.cn的配置步骤:

router3.ipv6bbs.cn con0 is now available

Press RETURN to get started.

router3.ipv6bbs.cn>
router3.ipv6bbs.cn>en
router3.ipv6bbs.cn#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
router3.ipv6bbs.cn(config)#ipv6 unicast-routing
router3.ipv6bbs.cn(config)#ipv6 router rip  100
router3.ipv6bbs.cn(config-rtr)#exit
router3.ipv6bbs.cn(config)#interface loopback1
router3.ipv6bbs.cn(config-if)#
*Aug 18 21:46:54.855: %LINK-3-UPDOWN: Interface Loopback1, changed state to up
*Aug 18 21:46:55.855: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
router3.ipv6bbs.cn(config-if)#ipv6 enable
router3.ipv6bbs.cn(config-if)#ipv6 address 3::3/128
router3.ipv6bbs.cn(config-if)#ipv6 rip 100 enable
router3.ipv6bbs.cn(config-if)#exit
router3.ipv6bbs.cn(config)#interface gigabitEthernet  0/0
router3.ipv6bbs.cn(config-if)#ipv6 enable
router3.ipv6bbs.cn(config-if)#ipv6 address 2003::2/64
router3.ipv6bbs.cn(config-if)#ipv6  rip 100 enable
router3.ipv6bbs.cn(config-if)#no shutdown
router3.ipv6bbs.cn(config-if)#
router3.ipv6bbs.cn(config-if)#
*Aug 18 21:48:03.763: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up
*Aug 18 21:48:04.763: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
*Aug 18 21:48:06.731: %OSPFv3-5-ADJCHG: Process 100, Nbr 2.2.2.2 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
router3.ipv6bbs.cn(config-if)#exit
router3.ipv6bbs.cn(config)#ipv6 route ::/0 2003::1
router3.ipv6bbs.cn(config)#exit
router3.ipv6bbs.cn#show ipv6 route
IPv6 Routing Table - default - 5 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
S   ::/0 [1/0]
     via 2003::1
LC  3::3/128 [0/0]
     via Loopback1, receive
C   2003::/64 [0/0]
     via GigabitEthernet0/0, directly connected
L   2003::2/128 [0/0]
     via GigabitEthernet0/0, receive
L   FF00::/8 [0/0]
     via Null0, receive
router3.ipv6bbs.cn#


在各台设备上ping其它设备接口IPv6地址

所有设备的IPv6静态路由已配置完毕,我们在各台设备上ping其它设备上的的loopback接口ipv6地址,均能正常通讯

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 = 436/656/1040 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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 716/913/1284 ms
router1.ipv6bbs.cn#traceroute ipv6 3::3

Type escape sequence to abort.
Tracing the route to 3::3

  1 1002::2 772 msec 564 msec 284 msec
  2 2003::2 712 msec 856 msec 1008 msec
router1.ipv6bbs.cn#


在router2.ipv6bbs.cn上面ping其它设备上的loopback接口IPv6地址:

router2.ipv6bbs.cn#
router2.ipv6bbs.cn#ping ipv6 1::1

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

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3::3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 144/392/716 ms
router2.ipv6bbs.cn#


在router3.ipv6bbs.cn上面ping其它设备上的loopback接口IPv6地址:

router3.ipv6bbs.cn#
router3.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 = 4/122/276 ms
router3.ipv6bbs.cn#ping ipv6 1::1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 148/312/556 ms
router3.ipv6bbs.cn#traceroute ipv6 1::1

Type escape sequence to abort.
Tracing the route to 1::1

  1 2003::1 188 msec 24 msec 420 msec
  2 1002::1 432 msec 396 msec 216 msec
router3.ipv6bbs.cn#

本帖子中包含更多资源

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

×
ggj1314 发表于 2011-9-29 10:29:05 | 显示全部楼层
顶一下,我们上课讲到了这个说的
回复

使用道具 举报

wuzhidegang 发表于 2011-10-27 11:23:04 | 显示全部楼层
很好 ,谢谢
回复

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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