<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

实验拓扑:

配置过程:

R1的配置:

R1(config)#int f0/0

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

R1(config-if)#no shutdown

R2的配置:

R2(config)#int f0/0

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

R2(config-if)#no shutdown

验证及理解:

查看配置

R2#show running-config int f0/0

Building configuration...

Current configuration : 117 bytes

!

interface FastEthernet0/0

no ip address

duplex half

ipv6 address 2001:1::2/64

end

使用ping命令验证其联通性

R2#

R2#ping 2001:1::2ping ipv6 2001:1::1

Type escape sequence to abort.

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

!!!!!

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

R2#

查看接口情况

R2#show ipv6 int f0/0

FastEthernet0/0 is up, line protocol is up

IPv6 is enabled, link-local address is FE80::C801:EFF:FE58:0 / /本地链路地址

Global unicast address(es):

2001:1::2, subnet is 2001:1::/64 //单播地址

Joined group address(es): //加入组地址

FF02::1 //所有节点的组播地址

FF02::1:FF00:2 / /单播地址的被请求的组播地址

FF02::1:FF58:0 //本地链路的被请求组播地址

MTU is 1500 bytes

ICMP error messages limited to one every 100 milliseconds

ICMP redirects are enabled

ND DAD is enabled, number of DAD attempts: 1

ND reachable time is 30000 millisecond s

查看IPv6邻居

R2#sh ipv6 neighbors

IPv6 Address Age Link-layer Addr State Interface

2001:1::1 3 ca00.0e98.0000 STALE Fa0/0

FE80::C800:EFF:FE98:0 2 ca00.0e98.0000 STALE Fa0/0

我们在给IPV6配置多个地址的时候是没有主次地址之分的这个与IPV4不同其在配置的时候有主次之分,ipv4在配置次地址时候需要在末尾加“secondary

例如:

R2(config)#int f0/0

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

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

R2#show running-config int f0/0

Building configuration...

Current configuration : 115 bytes

!

interface FastEthernet0/0

no ip address

duplex half

ipv6 address 2001:1::2/64

ipv6 address 2001:1::3/64

end

R2#

但是IPV6既然没有主次地址之分,那么两台路由器之间的通信采用的是哪个源地址呢?我们可以用实验来验证下

实验过程

R2#debug ipv6 packet

R2#ping 2001:1::1

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/20 ms

IPv6 unicast packet debugging is on

*Sep 5 11:38:42.791: IPV6: source 2001:1::3 (local)

*Sep 5 11:38:42.791: dest 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.791: traffic class 224, flow 0x0, len 72+8, prot 58, hops 255, originating

*Sep 5 11:38:42.795: IPv6: Sending on FastEthernet0/0

*Sep 5 11:38:42.815: IPV6: source 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.815: dest 2001:1::3

*Sep 5 11:38:42.819: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, forward to ulp

*Sep 5 11:38:42.819: IPV6: source 2001:1::3 (local)

*Sep 5 11:38:42.819: dest 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.823: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, originating

*Sep 5 11:38:42.823: IPv6: Sending on FastEthernet0/0

*Sep 5 11:38:42.847: IPV6: source 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.847: dest 2001:1::3

*Sep 5 11:38:42.847: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, forward to ulp

*Sep 5 11:38:42.847: IPV6: source 200

R2#1:1::3 (local)

*Sep 5 11:38:42.847: dest 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.847: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, originating

*Sep 5 11:38:42.847: IPv6: Sending on FastEthernet0/0

*Sep 5 11:38:42.855: IPV6: source 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.855: dest 2001:1::3

*Sep 5 11:38:42.855: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, forward to ulp

*Sep 5 11:38:42.855: IPV6: source 2001:1::3 (local)

*Sep 5 11:38:42.855: dest 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.855: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, originating

*Sep 5 11:38:42.855: IPv6: Sending on FastEthernet0/0

*Sep 5 11:38:42.859: IPV6: source 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.859: dest 2001:1::3

*Sep 5 11:38:42.859: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, forward to ulp

*Sep 5 11:38:42.859: IPV6: source 2001:1::3 (local)

*Sep 5 11:38:42.859:

R2# dest 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.859: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, originating

*Sep 5 11:38:42.859: IPv6: Sending on FastEthernet0/0

*Sep 5 11:38:42.867: IPV6: source 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.867: dest 2001:1::3

*Sep 5 11:38:42.867: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, forward to ulp

*Sep 5 11:38:42.867: IPV6: source 2001:1::3 (local)

*Sep 5 11:38:42.867: dest 2001:1::1 (FastEthernet0/0)

*Sep 5 11:38:42.867: traffic class 0, flow 0x0, len 100+14, prot 58, hops 64, originating

*Sep 5 11:38:42.867: IPv6: Sending on FastEthernet0/0

实验证明IPV6ping的过程中使用时ip地址较高的地址作为源地址.

二、 配置IPV6的静态路由

R1的配置:

R1(config)#int f0/0

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

R1(config-if)#no shutdown

R1(config)#int loopback 0

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

R1(config)#ipv6 unicast-routing

R2的配置:

R2(config)#int f0/0

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

R2(config-if)#no shutdown

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

R2(config)#ipv6 unicast-routing

查看ipv6路由表

R2#sh ipv6 route

IPv6 Routing Table - 5 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

C 2001:1::/64 [0/0]

via ::, FastEthernet0/0

L 2001:1::2/128 [0/0]

via ::, FastEthernet0/0

S 2001:3::/64 [1/0]

via 2001:1::1

L FE80::/10 [0/0]

via ::, Null0

L FF00::/8 [0/0]

via ::, Null0

R2#

ipv6的动态路由配置

R1的配置:

R1(config)#int f0/0

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

R1(config-if)#no shutdown

R1(config)#int loopback 0

R1(config)#ipv6 unicast-routing

R1(config)#int f0/0

R1(config-if)#ipv6 rip cisco enable

R1(config-if)#int lo 0

R1(config-if)#ipv6 rip cisco enable

R2的配置:

R2(config)#int f0/0

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

R2(config-if)#no shutdown

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

R2(config)#ipv6 unicast-routing

R2(config-rtr)#int f0/0

R2(config-if)#ipv6 rip cisco enable

R2(config-if)#int lo 0

R2(config-if)#ipv6 rip cisco enable

验证:

测试连通性

R1#ping 2001:4::1

Type escape sequence to abort.

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

!!!!!

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

R1#

查看路由表

R1#show ipv6 route

IPv6 Routing Table - 7 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

C 2001:1::/64 [0/0]

via ::, FastEthernet0/0

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

via ::, FastEthernet0/0

C 2001:3::/64 [0/0]

via ::, Loopback0

L 2001:3::1/128 [0/0]

via ::, Loopback0

R 2001:4::/64 [120/2]

via FE80::C801:EFF:FE98:0, FastEthernet0/0

L FE80::/10 [0/0]

via ::, Null0

L FF00::/8 [0/0]

via ::, Null0

R1#