【思科】IPv6 过渡技术 - ISATAP隧道

在这里插入图片描述

实验要求

实验环境 : EVE

实验需求:
实现双方站点的IPv6网络 可以跨 IPv4 网络进行通信

实现思路

① IPv6网络用OSPFv3来实现互通
② IPv4网络用OSPF来实现互通
③ 使用ISATAP隧道实现Pv6网络 可以跨 IPv4 网络进行通信

隧道可以在原有的IPv6头部,再加上Pv4头部,就可以帮助IPv6跨IPv4网络进行通信了

6 to 4 特点

自动建立隧道,不需要向GRE 或者 IPv6 in IPv4 隧道一样,手动指定隧道目的 !

注意:不支持组播
格式:::0000:5EFE:IPv4 前64没有要求,后64有要求
那这个嵌入的IPv4的地址,就是我出接口的IPv4地址
这个不需要手工换算成十六进制,到时候直接写成IPv4地址即可,它会自己换算

报文结构(基于IPv6 in IPv4 隧道) :IPv4 — IPv6

详情可以去查看该篇IPv6 in IPv4 隧道实验
链接: IPv6 in IPv4 隧道实验

注意点

① OSPFv3 只能通过接口下宣告,不能使用Network!!!

配置

在这里插入图片描述

R1

基础配置

R1(config)#int e0/0
R1(config-if)#no shutdown
R1(config-if)#ipv6 address 2001:12::1/64
R1(config-if)#exit

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

R1(config)#int loopback 2
R1(config-if)#ipv6 address 2000:1:2::1/64
R1(config-if)#exit

R1(config)#int loopback 3
R1(config-if)#ipv6 address 2000:1:3::1/64
R1(config-if)#exit


===================================   查看接口IPv6地址 =================================
R1(config)#do show ipv6 int brief
Ethernet0/0            [up/up]
    FE80::A8BB:CCFF:FE00:1000
    2001:12::1
Ethernet0/1            [administratively down/down]
    unassigned
Ethernet0/2            [administratively down/down]
    unassigned
Ethernet0/3            [administratively down/down]
    unassigned
Loopback1              [up/up]
    FE80::A8BB:CCFF:FE00:1000
    2000:1:1::1
Loopback2              [up/up]
    FE80::A8BB:CCFF:FE00:1000
    2000:1:2::1
Loopback3              [up/up]
    FE80::A8BB:CCFF:FE00:1000
    2000:1:3::1

OSPFv3 局域网可达

## 记得要启用IPv6单播路由,才能去配置动态路由
R1(config)#ipv6 unicast-routing  
                 
## 进入OSPFv3 IPv6 地址族,设置RID为 1.1.1.1
R1(config)#router ospfv3 1
R1(config-router)#address-family ipv6
R1(config-router-af)#router-id 1.1.1.1
R1(config-router-af)#exit
R1(config-router)#exit

## 接口下宣告
R1(config)#int range e0/0,lo1,lo2,lo3
R1(config-if-range)#ospfv3 1 ipv6 area 0
R1(config-if-range)#exit

R2

基础配置

R2(config)#int e0/0
R2(config-if)#no shutdown 
R2(config-if)#ipv6 address 2001:12::2/64
R2(config-if)#exit

R2(config)#int e0/1
R2(config-if)#no shutdown 
R2(config-if)#ip address 172.16.23.2 255.255.255.0 
R2(config-if)#exit

局域网环境(OSPFv3):IPv6 网络

## 需要开启IPv6单播功能
R2(config)#ipv6 unicast-routing 

## 进入OSPFv3 IPv6 地址族,设置RID为 2.2.2.2
R2(config)#router ospfv3 1
R2(config-router)#address-family ipv6
R2(config-router-af)#router-id 2.2.2.2
R2(config-router-af)#exit

## 接口下宣告
R2(config)#int range e0/0
R2(config-if-range)#ospfv3 1 ipv6 area 0
R2(config-if-range)#exit


==============================   查看 R2 学到IPv6 路由条目  ============================
R2(config)#do show ipv6 route
IPv6 Routing Table - default - 6 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
       H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
       IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO
       ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
       RL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1
       OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eid
       lA - LISP away, a - Application
O   2000:1:1::1/128 [110/10]
     via FE80::A8BB:CCFF:FE00:1000, Ethernet0/0
O   2000:1:2::1/128 [110/10]
     via FE80::A8BB:CCFF:FE00:1000, Ethernet0/0
O   2000:1:3::1/128 [110/10]
     via FE80::A8BB:CCFF:FE00:1000, Ethernet0/0
C   2001:12::/64 [0/0]
     via Ethernet0/0, directly connected
L   2001:12::2/128 [0/0]
     via Ethernet0/0, receive
L   FF00::/8 [0/0]
     via Null0, receive

isatap隧道

## 目的:IPv4网络内部互通
R2(config)#router ospf 110
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 172.16.23.0 0.0.0.255 area 0
R2(config-router)#exit

## isatap 隧道,因为是自动建立
## 目的是为了和所有有需要的设备建立隧道通信
## 所以就不用指定隧道的目的了

## 建立 isatap 隧道
R2(config)#int tunnel 24
R2(config-if)#ipv6 address 2001:24::0000:5efe:172.16.23.2/64   ## IPv6地址需要按照格式来
R2(config-if)#tunnel source e0/1                               ## tunnel隧道源
R2(config-if)#tunnel mode ipv6ip isatap                        ## tunnel模式改为isatap 
R2(config-if)#EXIT

## 像这个格式的话,2001:24::0000:5efe:172.16.23.2/64,会被转换成2001:24::5EFE:AC10:1702
## 2001:24::0000:5efe → 会被缩写为2001:24::5EFE,因为0000可以被:: 这个给省略,可以去看IPv6 地址简化规则
## IPv4地址172.16.23.2 就会被转换成 AC10:1702 的格式!


## 因为isatap隧道不支持组播
## 所以我们就写一条静态路由,去往R5的路由
## 而此时的下一跳,我们可以用链路本地地址
## 自动分配的都会产生链路本地地址。
## 我们通常都是用链路本地地址作为静态路由下一跳的地址
R2(config)#ipv6 route 2000:5::/32 Tunnel24 FE80::5EFE:AC10:2204 

## 需要重分发进OSPFv3中,让R1学到R5的网络
R2(config)#router ospfv3 1
R2(config-router)#address-family ipv6
R2(config-router-af)#redistribute static         ## 将静态路由重分发进OSPFv3中
R2(config-router-af)#exit


==================================   查看到接口状态   ====================================
R2(config)#do show ipv6 int br
Ethernet0/0            [up/up]
    FE80::A8BB:CCFF:FE00:2000
    2001:12::2
Ethernet0/1            [up/up]
    unassigned
Ethernet0/2            [administratively down/down]
    unassigned
Ethernet0/3            [administratively down/down]
    unassigned
Tunnel24               [up/up]  ## 需要注意的是,一个接口下,可以有多个IPv6 地址,是不会冲突的,放心
    FE80::5EFE:AC10:1702        ## 链路本地地址
    2001:24::5EFE:AC10:1702     ## 全局单播地址
    2002:AC10:1702::2           ## 全局单播地址

R3

R3(config)#int e0/0
R3(config-if)#no shutdown 
R3(config-if)#ip address 172.16.23.3 255.255.255.0
R3(config-if)#exit

R3(config)#int e0/1
R3(config-if)#no shutdown 
R3(config-if)#ip address 172.16.34.3 255.255.255.0
R3(config-if)#exit

R3(config)#router ospf 110
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 172.16.0.0 0.0.255.255 area 0
R3(config-router)#exit

R4

基础配置

R4(config)#int e0/0
R4(config-if)#no shutdown 
R4(config-if)#ip address 172.16.34.4 255.255.255.0
R4(config-if)#exit

R4(config)#int e0/1
R4(config-if)#no shutdown 
R4(config-if)#ipv6 address 2001:45::4/64
R4(config-if)#exit

局域网环境(OSPFv3):IPv6 网络

## 需要开启IPv6单播功能
R4(config)#ipv6 unicast-routing 

## 进入OSPFv3 IPv6 地址族,设置RID为 4.4.4.4
R4(config)#router ospfv3 1
R4(config-router)#address-family ipv6
R4(config-router-af)#router-id 4.4.4.4
R4(config-router-af)#exit
R4(config-router)#exit

## 接口下宣告
R4(config)#int e0/1
R4(config-if)#ospfv3 1 ipv6 area 0
R4(config-if)#exit

isatap 隧道

## 目的:IPv4网络内部互通
R4(config)#router ospf 110 
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 172.16.34.0 0.0.0.255 area 0
R4(config-router)#exit

## 建立isatap 隧道
R4(config)#int tunnel 24
R4(config-if)#ipv6 address 2001:24::0000:5efe:172.16.34.4/64   ## IPv6地址需要按照格式来
R4(config-if)#tunnel mode ipv6ip isatap                        ## tunnel模式改为isatap
R4(config-if)#tunnel source e0/0                               ## tunnel隧道源
R4(config-if)#exit

## 因为isatap隧道不支持组播
## 所以我们就写一条静态路由,去往R1的路由
## 而此时的下一跳,我们可以用链路本地地址
## 自动分配的都会产生链路本地地址。
##我们通常都是用链路本地地址作为静态路由下一跳的地址
R4(config)#ipv6 route 2000:1::/32 Tunnel24 FE80::5EFE:AC10:1702   

## 进入OSPFv3 将通往R1的路由让R5也能学到
R4(config)#router ospfv3 1
R4(config-router)#address-family ipv6
R4(config-router-af)#redistribute static         ## 将静态路由重分发进OSPFv3中 
R4(config-router-af)#exit
R4(config-router)#exit

R5

基础配置

R5(config)#int e0/0
R5(config-if)#no shutdown 
R5(config-if)#ipv6 address 2001:45::5/64
R5(config-if)#exit

R5(config)#int loopback 1
R5(config-if)#ipv6 address 2000:5:1::1/64
R5(config-if)#exit

R5(config)#int loopback 2
R5(config-if)#ipv6 address 2000:5:2::1/64
R5(config-if)#exit

R5(config)#int loopback 3
R5(config-if)#ipv6 address 2000:5:3::1/64
R5(config-if)#exit


===================================   查看接口IPv6地址 =================================
R5#show ipv6 int br
Ethernet0/0            [up/up]
    FE80::A8BB:CCFF:FE00:5000
    2001:45::5
Ethernet0/1            [administratively down/down]
    unassigned
Ethernet0/2            [administratively down/down]
    unassigned
Ethernet0/3            [administratively down/down]
    unassigned
Loopback1              [up/up]
    FE80::A8BB:CCFF:FE00:5000
    2000:5:1::1
Loopback2              [up/up]
    FE80::A8BB:CCFF:FE00:5000
    2000:5:2::1
Loopback3              [up/up]
    FE80::A8BB:CCFF:FE00:5000
    2000:5:3::1

OSPFv3 局域网可达

## 记得要启用IPv6单播路由,才能去配置动态路由
R5(config)#ipv6 unicast-routing  
                 
## 进入OSPFv3 IPv6 地址族,设置RID为 5.5.5.5
R5(config)#router ospfv3 1
R5(config-router)#address-family ipv6 
R5(config-router-af)#router-id 5.5.5.5
R5(config-router-af)#exit
R5(config-router)#exit

## 接口下宣告
R5(config)#int range e0/0,lo1,lo2,lo3
R5(config-if-range)#ospfv3 1 ipv6 area 0
R5(config-if-range)#exit

检查

R2的tunnel 接口状态

在这里插入图片描述

R4的tunnel 接口状态

在这里插入图片描述

R1 的路由表

在这里插入图片描述

R5 的路由表

在这里插入图片描述

R1 Ping R5

R1#ping 2000:5:1::1 source lo 1
在这里插入图片描述

抓包分析

抓的是 R2的e0/1口
其实这个时候就可以看到,数据包发送的时候
此时就只新增了IPv4报文头这样子就比GRE少了一个封装字段,提高了传输效率

Ping包

在这里插入图片描述
在这里插入图片描述

isatap 是如何自动建立隧道?

① 报文的目的地址

当R1的内部想要去Ping R5的内部时
流量到达R2身上,这个时候是需要有目的IP地址的
但是他查看到了我是用6to4隧道,那么就没有去设置隧道目的,那这个时候是怎么传递的呢?

查看R2的路由表,看到我们写的那条静态路由
在这里插入图片描述

该条静态路由的下一跳是FE80::5EFE:AC10:2204 ,这下一条里面藏着一个IPv4地址,就是172.16.34.4

接上面的问题
那设备发现这是个isatap隧道,那么就会去路由表找静态路由,然后去提取该IPv4地址,作为我报文的目的地址。

② 那怎么自动建立呢?

其实就是提取我每一条静态路由的IPv4地址,作为我的隧道目的地址,这样子就OK啦
主要就是静态路由中,有下一跳有包含 IPv4 地址,这个就是我的目的地址,所以就可以自动去建立
当需要建立很多条隧道的时候,就不用那么麻烦的一条一条的去建立啦

配置文档

R1

! 
ipv6 unicast-routing 
!
interface Loopback1
 ipv6 address 2000:1:1::1/64
 ospfv3 1 ipv6 area 0
!
interface Loopback2
 ipv6 address 2000:1:2::1/64
 ospfv3 1 ipv6 area 0
!
interface Loopback3
 ipv6 address 2000:1:3::1/64
 ospfv3 1 ipv6 area 0
!
interface Ethernet0/0
 ipv6 address 2001:12::1/64
 ospfv3 1 ipv6 area 0
!
router ospfv3 1
 !
 address-family ipv6 unicast
  router-id 1.1.1.1
!

R2

ipv6 unicast-routing
!
interface Tunnel24
 ipv6 address 2001:24::5EFE:AC10:1702/64
 tunnel mode ipv6ip isatap
 tunnel source Ethernet0/1
!
interface Ethernet0/0
 no shutdown
 ipv6 address 2001:12::2/64
 ospfv3 1 ipv6 area 0
!
interface Ethernet0/1
 no shutdown
 ip address 172.16.23.2 255.255.255.0
!
router ospfv3 1
 !
 address-family ipv6 unicast
  redistribute static
  router-id 2.2.2.2
!
router ospf 110
 router-id 2.2.2.2
 network 172.16.23.0 0.0.0.255 area 0
!
ipv6 route 2000:5::/32 Tunnel24 FE80::5EFE:AC10:2204

R3

!
interface Ethernet0/0
 no shutdown
 ip address 172.16.23.3 255.255.255.0
!
interface Ethernet0/1
 no shutdown
 ip address 172.16.34.3 255.255.255.0
!         
router ospf 110
 router-id 3.3.3.3
 network 172.16.0.0 0.0.255.255 area 0
!

R4

ipv6 unicast-routing
!
interface Tunnel24
 ipv6 address 2001:24::5EFE:AC10:2204/64
 tunnel source Ethernet0/0
 tunnel mode ipv6ip isatap
!
interface Ethernet0/0
 ip address 172.16.34.4 255.255.255.0
 no shutdown
!
interface Ethernet0/1
 no shutdown
 ipv6 address 2001:45::4/64
 ospfv3 1 ipv6 area 0
!
router ospfv3 1
 !
 address-family ipv6 unicast
  redistribute static
  router-id 4.4.4.4
!
router ospf 110
 router-id 4.4.4.4
 network 172.16.34.0 0.0.0.255 area 0
!         
ipv6 route 2000:1::/32 Tunnel24 FE80::5EFE:AC10:1702
!

R5

!
ipv6 unicast-routing
!
interface Loopback1
 ipv6 address 2000:5:1::1/64
 ospfv3 1 ipv6 area 0
!
interface Loopback2
 ipv6 address 2000:5:2::1/64
 ospfv3 1 ipv6 area 0
!
interface Loopback3
 ipv6 address 2000:5:3::1/64
 ospfv3 1 ipv6 area 0
!
interface Ethernet0/0 
 no shutdown
 ipv6 address 2001:45::5/64
 ospfv3 1 ipv6 area 0
!
router ospfv3 1
 !
 address-family ipv6 unicast
  router-id 5.5.5.5
!
  • 24
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

张白夕

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值