IPV6的配置实例

企业动态
公司构建了2个IPV6的网络,但是这两个网络不在同一个地域范围内,如果要想通信,必须要跨越IPV4的网络,为了达到通信的目的,决定采用隧道技术。

试验背景:公司构建了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

 

#p#


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

【编辑推荐】

  1. 解析移动IPv6数据传输及存在的主要问题
  2. IPv4地址何去何从 IPv6不向下兼容的尴尬
  3. IETF在IPv6网络地址转换器问题上未达成一致
责任编辑:夏雨 来源: 56CTO
相关推荐

2010-06-02 13:37:28

Linux IPv6配

2010-08-11 16:07:14

IPv6协议H3C

2013-03-13 09:56:24

IPv6IPv4NDP

2012-05-24 19:08:13

2010-06-07 10:00:32

安装配置IPv6

2019-07-01 10:09:09

IPv6IPv4运营商

2009-07-15 10:22:27

2011-07-10 14:01:00

IPv6应用过渡

2019-06-05 15:43:34

IPV6IPV4网站

2012-05-09 10:02:17

IPv6

2011-07-10 14:59:14

IPv6企业IPv6部署

2010-05-26 17:56:01

2010-06-02 14:45:42

IPv6协议地址

2011-03-02 09:59:38

2012-12-10 16:25:34

IPv6

2011-06-09 09:32:31

IPv6IPv6流量IPv6日

2010-05-25 14:55:47

IPv6与RFID结合

2012-04-27 13:33:40

锐捷网络物联网IPv6

2018-05-03 14:40:07

IPv6互联网协议网络

2010-05-26 14:56:05

IPv6协议栈
点赞
收藏

51CTO技术栈公众号