IPV6路由配置

  • 格式:doc
  • 大小:60.00 KB
  • 文档页数:8

1

IPv6地址及其基本路由的配置

首先看IPV6地址的表达方式

2001:0000:0000:0000:0000:2E78:0000:0001

用十六进制表达,分8段,其中0可以省略,以上地址可以写成如下形式:

2001: 0: 0: 0: 0:2E78: 0: 1

更简略的写法是:

2001::2E78: 0: 1

注意,省略连续的几段0的时候,只能省一个地方为::,否则将不知道省略了多少位。

好了,以下地址是合法的IPV6地址:

(1) ::

(2) ::1

等等……

拓扑

2

PC1地址:2001::10/64 网关:2001::1/64

PC2地址:2002::10/64 网关:2002::1/64

路由器的地址配置

R1:

R1>en

R1#

R1#conf t

R1(config)#ipv6 unicast-routing //启用IPv6单播路由

R1(config)#interface fastEthernet 0/0

R1(config-if)#ipv6 address 2001::1/64 //配置IPv6地址,注意子网掩码的表达方式

R1(config-if)#no shu

R1(config)#interface serial 0/0/0

R1(config-if)#ipv6 address 2000::1/64

R1(config-if)#clock rate 64000 //依然要配时钟,IP协议版本的升级不影响第二层

R1(config-if)#no shu

R2:

R2>en

R2#conf t

R2(config)#ipv6 unicast-routing

R2(config)#int f 0/0

R2(config-if)#ipv6 address 2002::1/64

R2(config-if)#no shu

R2(config-if)#int s 0/0/0

R2(config-if)#ipv6 add 2000::2/64

R2(config-if)#no shu

3

R2 ping R1

R2#

R2#ping 2000::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2000::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 31/40/78 ms

PC1ping网关:

PC1>ping 2001::1

Pinging 2001::1 with 32 bytes of data:

Reply from 2001::1: bytes=32 time=62ms TTL=255

Reply from 2001::1: bytes=32 time=32ms TTL=255

Reply from 2001::1: bytes=32 time=31ms TTL=255

Reply from 2001::1: bytes=32 time=31ms TTL=255

Ping statistics for 2001::1:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 31ms, Maximum = 62ms, Average = 39ms

方法一:配置IPv6静态路由

R1(config)#ipv6 unicast-routing

R1(config)#ipv6 route 2002::/64 2000::2

R2(config)#ipv6 unicast-routing

R2(config)#ipv6 route 2001::/64 2000::1

测试:

PC2>ping 2001::10 4

Pinging 2001::10 with 32 bytes of data:

Reply from 2001::10: bytes=32 time=94ms TTL=126

Reply from 2001::10: bytes=32 time=93ms TTL=126

Reply from 2001::10: bytes=32 time=94ms TTL=126

Reply from 2001::10: bytes=32 time=94ms TTL=126

Ping statistics for 2001::10:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 93ms, Maximum = 94ms, Average = 93ms

方法二:配置RIPng

注:首先要把之前的静态路由NO掉,这个非常重要,因为静态理由的管理距离是1,而即将配置的RIP的管理距离是120,显然,静态路由的可信度比RIP路由的可信度高,因此,只有静态路由会出现在路由表。

R1(config)#no ipv6 route 2002::/64 2000::2 //no掉之前的静态路由

R1(config)#interface f 0/0

R1(config-if)#ipv6 rip 1 enable //启用RIP,进程号为1

R1(config-if)#exit

R1(config)#int s 0/0/0

R1(config-if)#ipv6 rip 1 enable

R2(config)#no ipv6 route 2001::/64 2000::1 ////no掉之前的静态路由

R2(config)#int f 0/0

R2(config-if)#ipv6 rip 1 enable

R2(config-if)#exit

R2(config)#int s 0/0/0

R2(config-if)#ipv6 rip 1 enable

R2#show ipv6 route

IPv6 Routing Table - 6 entries

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

U - Per-user Static route, M - MIPv6

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 5

ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

D - EIGRP, EX - EIGRP external

C 2000::/64 [0/0]

via ::, Serial0/0/0

L 2000::2/128 [0/0]

via ::, Serial0/0/0

R 2001::/64 [120/2]

via FE80::201:96FF:FE04:C01, Serial0/0/0

C 2002::/64 [0/0]

via ::, FastEthernet0/0

L 2002::1/128 [0/0]

via ::, FastEthernet0/0

L FF00::/8 [0/0]

via ::, Null0

在路由表中看到R路由,说明RIPng工作正常。

方法三:配置OSPF v3

注:上个实验配置的RIPng不用NO掉,因为我们即将配置的OSPF v3的管理距离是110,比RIPng的要小,可信度要高,如果OSPFv3正常工作,其路由将出现在理由表,而RIPng的结果不被采纳。

R1(config)#ipv6 router ospf 100

R1(config-rtr)#router-id 1.1.1.1 //必须设置路由ID

R1(config-rtr)#exit

R1(config)#int f 0/0

R1(config-if)#ipv6 ospf 100 area 0 //启用OSPF,并指定进程号100和区域0

R1(config-if)#exit

R1(config)#int s 0/0/0

R1(config-if)#ipv6 ospf 100 area 0

R2(config)#ipv6 router ospf 100

R2(config-rtr)#router-id 2.2.2.2

R2(config-rtr)#exit

R2(config)#int f 0/0

R2(config-if)#ipv6 ospf 100 area 0

R2(config-if)#exit