R1参考配置:
ipv6 unicast-routing
interface FastEthernet0/0
no ip address
ipv6 address 2001::1/64
ipv6 ospf 100 area 0
ipv6 router ospf 100
router-id 1.1.1.1
(//如果在R1上不手工指定router-id,ospf进程会在R1上的ipv4地址中找到一个,但是由于R1上没有ipv4的地址,所以就没有router-id,这是不行的,但是R2、R4就可以不指定;)
R2参考配置:R2#conf t
R2(config)#ipv6 unicast-routing
R2(config)#inter f0/0
R2(config-if)#ipv6 address 2001::2/64
R2(config-if)#no sh
R2(config-if)#inter f1/0
ip add 23.1.1.2 255.255.255.0
no sh
R2(config-if)#router eigrp 100//隧道技术两端的源和目的首先保证能够通信,所以启用IGP
R2(config-router)#no auto-summary
R2(config-router)#network 23.1.1.2 0.0.0.0
R2(config-router)#do
show ipv6 inter bri
FastEthernet0/0 [up/up]
FE80::CE01:7FF:FE64:0
2001::2
FastEthernet1/0 [up/up]
R2(config)#
inter tunnel 0
R2(config-if)#
ipv6 address 2024::2/64
//配置隧道接口的地址
R2(config-if)#
tunnel source 23.1.1.2
R2(config-if)#tunnel destination ?
Hostname or A.B.C.D ip address or host name
X:X:X:X::X IPv6 address
R2(config-if)#
tunnel destination 34.1.1.4
R2(config-if)#tunnel mode ?
aurp AURP TunnelTalk AppleTalk encapsulation
cayman Cayman TunnelTalk AppleTalk encapsulation
dvmrp DVMRP multicast tunnel
eon EON compatible CLNS tunnel
gre generic route encapsulation protocol
ipip IP over IP encapsulation
ipsec IPSec tunnel encapsulation
iptalk Apple IPTalk encapsulation
ipv6 Generic packet tunneling in IPv6
ipv6ip IPv6 over IP encapsulation
mpls MPLS encapsulations
nos IP over IP encapsulation (KA9Q/NOS compatible)
rbscp RBSCP in IP tunnel
R2(config-if)#
tunnel mode ipv6ip //配置隧道的模式,默认为GRE
R2(config-if)#do p 2024::4
Sending 5, 100-byte ICMP Echos to 2024::4, timeout is 2 seconds:
!!!!!
R2(config)#ipv6 router ospf 100
R2(config-rtr)#router-id 2.2.2.2
R2(config-rtr)#inter f0/0
R2(config-if)#ipv6 ospf 100 area 0
R2(config-if)#inter tunn 0
R2(config-if)#ipv6 ospf 100 area 0
R3参考配置:
interface FastEthernet0/0
ip address 23.1.1.3 255.255.255.0
interface FastEthernet1/0
ip address 34.1.1.3 255.255.255.0
router eigrp 100
network 23.1.1.3 0.0.0.0
network 34.1.1.3 0.0.0.0
no auto-summary
R4参考配置:
R4#conf t
R4(config)#ipv6 unicast-routing
R4(config)#inter f0/0
ip add 34.1.1.4 255.255.255.0
no sh
R4(config-if)#inter f1/0
R4(config-if)#ipv6 address 2002::4/64
R4(config-if)#no sh
R4(config-if)#router ei 100
R4(config-router)#no auto-summary
R4(config-router)#network 34.1.1.4 0.0.0.0
R4(config-router)#do pi 23.1.1.2
Sending 5, 100-byte ICMP Echos to 23.1.1.2, timeout is 2 seconds:
!!!!!
R4(config)#inter tunnel 0
R4(config-if)#ipv6 address 2024::4/64
R4(config-if)#no sh
R4(config-if)#tunnel source 34.1.1.4
R4(config-if)#tunnel destination 23.1.1.2
R4(config-if)#tunnel mode ipv6ip
R4(config)#ipv6 router ospf 100
R4(config-rtr)#router-id 4.4.4.4
R4(config)#inter tunnel 0
R4(config-if)#ipv6 ospf 100 area 0
R4(config-if)#inter f1/0
R4(config-if)#ipv6 ospf 100 area 0
也可以通过路由表查看:
R4#show ipv6 route
IPv6 Routing Table - 7 entries
O 2001::/64 [110/11112]
via FE80::1701:102, Tunnel0
C 2002::/64 [0/0]
via ::, FastEthernet1/0
L 2002::4/128 [0/0]
via ::, FastEthernet1/0
C 2024::/64 [0/0]
via ::, Tunnel0
L 2024::4/128 [0/0]
via ::, Tunnel0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
R4#
R5参考配置:
R5#conf t
R5(config)#ipv6 unicast-routing
R5(config)#inter f0/0
R5(config-if)#ipv6 address 2002::5/64
R5(config-if)#do show ipv inter bri
FastEthernet0/0 [up/up]
FE80::CE04:15FF:FE1C:0
2002::5
R5(config-if)#ipv6 router ospf 100
R5(config-rtr)#router-id 5.5.5.5
R5(config)#inter f0/0
R5(config-if)#ipv6 ospf 100 area 0
*Mar 1 00:24:21.859: %OSPFv3-5-ADJCHG: Process 100, Nbr 4.4.4.4 on FastEthernet0/0 from
LOADING to FULL, Loading Done
实验测试:
R5#ping 2001::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/108/160 ms