• 沒有找到結果。

IPv6 第 12 章

12.3 配置 IPv6 路由

Success rate is 100 percent (5/5), round-trip min/avg/max = 4/13/24 ms

12.3 配置 IPv6 路由

和 IPv4 的网络一样,为了使数据包能在 IPv6 网络中正常地传输,需要部署 IPv6 的路由。前 面讨论过的大多数路由协议在版本升级后都能在 IPv6 的网络中使用,虽然名称有了相应的变化,

但基本的部署思路和工作原理都是相似的。本节以图 12-9 为例介绍各种情况下 IPv6 路由的实施方 法,图中的所有设备均已启用 IPv6 协议。

▲图 12-9 IPv6 路由

12Chapter

注意:所有路由器的串口 IPv6 地址采用手动的方式分配,路由器和主机的以太 口采用无状态自动配置的方式分配,PC1 和 PC2 使用 VPCS,各设备接口 IPv6 地址信息如下:

R1#show ipv6 interface brief FastEthernet0/0 [up/up]

FE80::C801:16FF:FE6C:8 FEC0:10:1:0:C801:16FF:FE6C:8

Serial1/1 [up/up]

FE80::C801:16FF:FE6C:8 FEC0:1:1::1

… R1#

R2#show ipv6 interface brief FastEthernet0/0 [up/up]

FE80::C802:17FF:FE74:8 FEC0:20:1:0:C802:17FF:FE74:8

Serial1/2 [up/up]

FE80::C802:17FF:FE74:8 FEC0:2:2::2

Serial1/3 [administratively down/down]

R2#

ISP#show ipv6 interface brief

Serial1/1 [up/up]

FE80::C803:16FF:FE64:0 FEC0:1:1::3

Serial1/2 [up/up]

FE80::C803:16FF:FE64:0 FEC0:2:2::3

Serial1/3 [administratively down/down]

ISP#

PC1> show

NAME IP/MASK GATEWAY MAC LPORT RHOST:PORT PC1 0.0.0.0/0 0.0.0.0 00:50:79:66:68:00 10002 127.0.0.1:10003 fe80::250:79ff:fe66:6800/64

fec0:10:1:0:2050:79ff:fe66:6800/64 eui-64

PC2> show

NAME IP/MASK GATEWAY MAC LPORT RHOST:PORT PC2 0.0.0.0/0 0.0.0.0 00:50:79:66:68:01 10001 127.0.0.1:10000 fe80::250:79ff:fe66:6801/64

fec0:20:1:0:2050:79ff:fe66:6801/64 eui-64

12 Chapter

12.3.1 配置 IPv6 静态路由

参照拓扑如图 12-9 所示,在 ISP 分别设置两条到 R1 和 R2 以太口的静态路由,配置过程如下:

ISP(config)#ipv6 route fec0:10:1::/64 serial 1/1 FE80::C801:16FF:FE6C:8 ISP(config)#ipv6 route fec0:20:1::/64 serial 1/2 FE80::C802:17FF:FE74:8

注意:在设置下一条地址时建议使用邻居设备的链路本地地址,这样做的好处是 当邻居或目标网络的全球单播地址发生变动时,路由信息可以不做对应的调整。

验证 ISP 的 IPv6 路由表,操作过程如下:

ISP#show ipv6 route IPv6 Routing Table - 8 entries

Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP

R1(config)#ipv6 route ::/0 serial 1/1 FE80::C803:16FF:FE64:0 R2(config)#ipv6 route ::/0 serial 1/2 FE80::C803:16FF:FE64:0

以 R1 为例验证设置的静态路由或默认路由信息,操作过程如下:

R1#show ipv6 route static IPv6 Routing Table - 7 entries

Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP

12Chapter

分别使用 ping 和 trace 命令测试 PC1 到 PC2 的连通性,操作过程如下:

PC1> ping fec0:20:1:0:2050:79ff:fe66:6801

fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=1 ttl=58 time=67.004 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=2 ttl=58 time=49.003 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=3 ttl=58 time=39.002 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=4 ttl=58 time=39.002 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=5 ttl=58 time=39.002 ms

PC1> trace fec0:20:1:0:2050:79ff:fe66:6801 trace to fec0:20:1:0:2050:79ff:fe66:6801, 64 hops max

1 fec0:10:1:0:c801:16ff:fe6c:8 5.000 ms 9.001 ms 9.000 ms

R1(config)#ipv6 router rip LAB R1(config-rtr)#exit

R1(config)#interface fastEthernet 0/0 R1(config-if)#ipv6 rip LAB enable R1(config-if)#exit

R1(config)#interface serial 1/1 R1(config-if)#ipv6 rip LAB enable R1(config-if)#exit

ISP(config)#ipv6 router rip LAB ISP(config-rtr)#exit

ISP(config)#interface serial 1/1 ISP(config-if)#ipv6 rip LAB enable ISP(config-if)#exit

ISP(config)#interface serial 1/2 ISP(config-if)#ipv6 rip LAB enable ISP(config-if)#end

R2(config)#ipv6 router rip LAB R2(config-rtr)#exit

R2(config)#interface fastEthernet 0/0 R2(config-if)#ipv6 rip LAB enable R2(config-if)#exit

12 Chapter

R2(config)#interface serial 1/2 R2(config-if)#ipv6 rip LAB enable R2(config-if)#exit

注意:上面的配置中,LAB 表示 RIPng 的路由进程,不同的路由器可以使用不 同的进程标识,建议自定义的进程名称、策略名称等都使用大写字母,以便和命 令关键字区分开。

以 ISP 为例验证 IPv6 的路由配置和路由表,操作过程如下:

ISP#show ipv6 protocols IPv6 Routing Protocol is "connected"

IPv6 Routing Protocol is "static"

IPv6 Routing Protocol is "rip LAB"

Interfaces:

Serial1/2 Serial1/1 Redistribution:

None

ISP#show ipv6 route rip IPv6 Routing Table - 8 entries

Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route

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

R FEC0:10:1::/64 [120/2]

via FE80::C801:16FF:FE6C:8, Serial1/1 R FEC0:20:1::/64 [120/2]

via FE80::C802:17FF:FE74:8, Serial1/2 ISP#

使用 ping 命令测试 PC1 到 PC2 的连通性,操作过程如下:

PC1> ping fec0:20:1:0:2050:79ff:fe66:6801

fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=1 ttl=58 time=93.005 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=2 ttl=58 time=49.003 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=3 ttl=58 time=49.003 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=4 ttl=58 time=49.003 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=5 ttl=58 time=49.002 ms PC1>

12.3.3 配置 OSPFv3

OSPFv3 是运行在 IPv6 网络的 OSPF 协议。运行 OSPFv3 的路由器使用物理接口的链路本地单 播地址作为源地址来发送 OSPF 报文。相同链路上的路由器互相学习与之相连的其他路由器的链路 本地地址,并在报文转发的过程中将这些地址当成下一跳信息使用。

Router ID 在 OSPFv3 中也用于标识路由器。与 OSPFv2 的 Router ID 不同,OSPFv3 的 Router ID 必须手工配置;如果没有手工配置 Router ID,OSPFv3 将无法正常运行。OSPFv3 在广播型网络和 NBMA 网络中选举 DR 和 BDR 的过程与 OSPFv2 相似。IPv6 使用组播地址 FF02::6 表示 AllDRouters,

12Chapter 链路划分到 area0、R1 的以太口划分到 area1、R2 的以太口划分到 area2,R1、R2、R3 的 RID 分 别为 1.1.1.1、2.2.2.2、3.3.3.3,在网络中部署 RIPng 路由协议,配置过程如下:

R1(config)#ipv6 router ospf 10 ---10 是 OSPF 的进程 ID--- R1(config-if)#ipv6 ospf 10 area 0 R1(config-if)#exit

ISP(config)#ipv6 router ospf 10 ISP(config-rtr)#router-id 3.3.3.3 ISP(config-rtr)#exit

ISP(config)#interface serial 1/1 ISP(config-if)#ipv6 ospf 10 area 0 ISP(config-if)#exit

ISP(config)#interface serial 1/2 ISP(config-if)#ipv6 ospf 10 area 0 ISP(config-if)#exit

R2(config)#ipv6 router ospf 10 R2(config-rtr)#router-id 2.2.2.2 R2(config-rtr)#exit

R2(config)#interface serial 1/2 R2(config-if)#ipv6 ospf 10 area 0 R2(config-if)#exit

R2(config)#interface fastEthernet 0/0 R2(config-if)#ipv6 ospf 10 area 2 R2(config-if)#exit

以 ISP 为例验证 IPv6 的路由配置、OSPFv3 邻居关系和路由表,操作过程如下:

ISP#show ipv6 protocols

IPv6 Routing Protocol is "connected"

IPv6 Routing Protocol is "static"

IPv6 Routing Protocol is "ospf 10"

Interfaces (Area 0):

Serial1/2 Serial1/1 Redistribution:

None

ISP#show ipv6 ospf neighbor

Neighbor ID Pri State Dead Time Interface ID Interface 2.2.2.2 1 FULL/ - 00:00:37 8 Serial1/2 1.1.1.1 1 FULL/ - 00:00:39 7 Serial1/1

12 Chapter

ISP#show ipv6 route ospf IPv6 Routing Table - 8 entries

Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP

fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=1 ttl=58 time=124.800 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=2 ttl=58 time=93.600 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=3 ttl=58 time=93.601 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=4 ttl=58 time=93.600 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=5 ttl=58 time=93.600 ms PC1>

12.3.4 配置 EIGRPv6

EIGRPv6 是在 IPv6 网络中应用的 EIGRP 协议,EIGRP 的大多数特性在 EIGRPv6 中都保留了,

比如它仍然是高级距离矢量路由协议,并且有一些链路状态路由协议的特征。邻居发现的过程仍然 使用 hello 来进行,它仍然使用可靠的传输协议来提供可靠的通信,并使用弥散更新算法(DUAL)

实现无环路的快速收敛。EIGRPv6 使用组播地址 FF02::A 传输来发送 hello 包和更新信息。

在 EIGRPv6 中,仍然使用路由器配置模式来启用路由协议,不同的是路由进程必须指定 RID 并用命令 no shutdown 激活,其他的配置方式和思路与 RIPng 一致。参照拓扑如图 12-9 所示,R1、

R2、R3 的 RID 分别为 1.1.1.1、2.2.2.2、3.3.3.3,在网络中部署 EIGRPv6 路由协议,配置过程如下:

R1(config)#ipv6 router eigrp 10 ---10 是 AS 号--- R1(config-if)#ipv6 eigrp 10 R1(config-if)#exit

ISP(config)#ipv6 router eigrp 10 ISP(config-rtr)#eigrp router-id 3.3.3.3 ISP(config-rtr)#no shutdown ISP(config-rtr)#exit

ISP(config)#interface serial 1/1 ISP(config-if)#ipv6 eigrp 10 ISP(config-if)#exit

ISP(config)#interface serial 1/2

12Chapter ISP(config-if)#ipv6 eigrp 10

ISP(config-if)#exit

R2(config)#ipv6 router eigrp 10 R2(config-rtr)#eigrp router-id 2.2.2.2 R2(config-rtr)#no shutdown R2(config-rtr)#exit

IPv6 Routing Protocol is "connected"

IPv6 Routing Protocol is "ND"

IPv6 Routing Protocol is "eigrp 10"

EIGRP-IPv6 Protocol for AS(10)

Metric weight K1=1, K2=0, K3=1, K4=0, K5=0

ISP#show ipv6 eigrp neighbors EIGRP-IPv6 Neighbors for AS(10)

H Address Interface Hold Uptime SRTT RTO Q Seq

fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=1 ttl=58 time=124.800 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=2 ttl=58 time=93.600 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=3 ttl=58 time=93.601 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=4 ttl=58 time=93.600 ms fec0:20:1:0:2050:79ff:fe66:6801 icmp6_seq=5 ttl=58 time=93.600 ms PC1>

12 Chapter

相關文件