试验背景:
公司构建了2个
IPV6
的网络,但是这两个网络不在同一个地域范围内,如果要想通信,必须要跨越
IPV4
的网络,为了达到通信的目的,决定采用隧道技术。
试验目的:
1
、采用
GRE
隧道技术来实现;
2
、实现
PC1
能够和
PC2
之间
PING
通;
3
、
IPV6
路由的实现采用
IPV6 RIP
实现;
试验拓扑:
1.
配置路由器端口的
ip
地址
Router#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no ip domain lookup
Router(config)#hostname aaa
aaa(config)#interface f0/0
aaa(config-if)#no switchport
aaa(config-if)#ip add 192.168.1.1 255.255.255.0
aaa(config-if)#no shut
aaa(config-if)#exit
aaa(config)#interface loopback 1
aaa(config-if)#ipv6 address 2000::1/64
aaa(config-if)#exit
Router#conf t
Router(config)#no ip domain lookup
Router(config)#hostname bb
bb(config)#interface f0/0
bb(config-if)#no switchport
bb(config-if)#ip add 192.168.1.2 255.255.255.0
bb(config-if)#no shut
bb(config-if)#exit
bb(config)#interface f0/1
bb(config-if)#no switchport
bb(config-if)#ip add 172.16.1.1 255.255.255.0
bb(config-if)#no shut
bb(config-if)#exit
Router#conf t
Router(config)#no ip domain lookup
Router(config)#hostname ccc
ccc(config)#interface f0/0
ccc(config-if)#no switchport
ccc(config-if)#ip add 172.16.1.2 255.255.255.0
ccc(config-if)#no shut
ccc(config-if)#exit
ccc(config)#interface loopback 1
ccc(config-if)#ipv6 add 2001::1/64
ccc(config-if)#exit
2.
配置
ipv4
的动态路由
aaa(config)#router rip
aaa(config-router)#version 2
aaa(config-router)#no auto-summary
aaa(config-router)#network 192.168.1.0
aaa(config-router)#exit
bb(config)#router rip
bb(config-router)#version 2
bb(config-router)#no auto-summary
bb(config-router)#network 192.168.1.0
bb(config-router)#network 172.16.1.0
bb(config-router)#exit
ccc(config)#router rip
ccc(config-router)#version 2
ccc(config-router)#no auto-summary
ccc(config-router)#network 172.16.1.0
ccc(config-router)#exit
3.
查看路由表
aaa#show ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
R 172.16.1.0 [120/1] via 192.168.1.2, 00:00:01, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
bb#show ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet0/1
C 192.168.1.0/24 is directly connected, FastEthernet0/0
ccc#show ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet0/0
R 192.168.1.0/24 [120/1] via 172.16.1.1, 00:00:01, FastEthernet0/0
4.
给路由器做隧道
aaa#conf t
aaa(config)#interface tunnel 1
aaa(config-if)#ipv6 address 2002::1/64
aaa(config-if)#tunnel source 192.168.1.1
aaa(config-if)#tunnel destination 172.16.1.2
aaa(config-if)#exit
ccc(config)#interface tunnel 1
ccc(config-if)#ipv6 address 2003::1/64
ccc(config-if)#tunnel source 172.16.1.2
ccc(config-if)#tunnel destination 192.168.1.1
5.
在路由器上配置
ipv6
并应用到接口
aaa(config)#ipv6 unicast-routing
aaa(config)#ipv6 router rip wang
aaa(config-rtr)#exit
aaa(config)#interface tunnel 1
aaa(config-if)#ipv6 rip wang enable
aaa(config-if)#exit
aaa(config)#interface loopback 1
aaa(config-if)#ipv6 rip wang enable
ccc(config)#ipv6 unicast-routing
ccc(config)#ipv6 router rip wang
ccc(config)#interface tunnel 1
ccc(config-if)#ipv6 rip wang enable
ccc(config)#interface loopback 1
ccc(config-if)#ipv6 rip wang enable
ccc(config-if)#exit
6.
查看
ipv6
的路由表
aaa#show ipv6 rou
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
C 2000::/64 [0/0]
via ::, Loopback1
L 2000::1/128 [0/0]
via ::, Loopback1
R 2001::/64 [120/2]
via FE80::CE00:4FF:FEA0:F000, Tunnel1
C 2002::/64 [0/0]
via ::, Tunnel1
L 2002::1/128 [0/0]
via ::, Tunnel1
R 2003::/64 [120/2]
via FE80::CE00:4FF:FEA0:F000, Tunnel1
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
cc#show ipv6 rou
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 2000::/64 [120/2]
via FE80::CE00:EFF:FE4C:F000, Tunnel1
C 2001::/64 [0/0]
via ::, Loopback1
L 2001::1/128 [0/0]
via ::, Loopback1
R 2002::/64 [120/2]
via FE80::CE00:EFF:FE4C:F000, Tunnel1
C 2003::/64 [0/0]
via ::, Tunnel1
L 2003::1/128 [0/0]
via ::, Tunnel1
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
7.
验证试验结果
:ping
对短
aaa#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 = 276/492/668 ms
ccc#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 = 532/610/740 ms