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

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

  • 实验要求
  • 实现思路
  • IPv6 in IPv4 与 GRE 不同点
  • 注意点
  • 配置
    • R1
      • 基础配置
      • OSPFv3 局域网可达
    • R2
      • 基础配置
      • 局域网环境(OSPFv3):IPv6 网络
      • IPv6 in IPv4隧道
    • R3
    • R4
      • 基础配置
      • 局域网环境(OSPFv3):IPv6 网络
      • IPv6 in IPv4隧道
    • R5
      • 基础配置
      • OSPFv3 局域网可达
    • 检查
      • R1 的路由表
      • R5 的路由表
      • R1 Ping R5
  • 抓包分析
  • 配置文档
    • R1
    • R2
    • R3
    • R4
    • R5

在这里插入图片描述

实验要求

实验环境 : EVE

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

实现思路

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

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

IPv6 in IPv4 与 GRE 不同点

GRE隧道的报文结构:IPv4 — GRE — IPv6
IPv6 in IPv4来说,它的报文结构发生了变化:IPv4 — IPv6

这个时候,我们可以观察到GRE的报文
Protocol协议字段:记录内层协议字段是什么

在IPv4头部中,我们可以看到,有个Protocol协议字段,里面指向了GRE
当找到了GRE这里,才说去再IPv6,这样子有点脱裤子放屁了
IPv4 → GRE → IPv6

那我就这样子,将IPv6的Protocol协议字段,直接指向IPv6头部:IPv4 → IPv6
那这样子就不会浪费空间了,大大的提高了传输效率
所以就有了IPv6 in IPv4

*GRE隧道*
在这里插入图片描述

注意点

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)#exitR1(config)#int loopback 1
R1(config-if)#ipv6 address 2000:1:1::1/64
R1(config-if)#exitR1(config)#int loopback 2
R1(config-if)#ipv6 address 2000:1:2::1/64
R1(config-if)#exitR1(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:10002001: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:10002000:1:1::1
Loopback2              [up/up]FE80::A8BB:CCFF:FE00:10002000:1:2::1
Loopback3              [up/up]FE80::A8BB:CCFF:FE00:10002000: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)#exitR2(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 routeB - BGP, HA - Home Agent, MR - Mobile Router, R - RIPH - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interareaIS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMOND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - RedirectRL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eidlA - 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

IPv6 in IPv4隧道

## 目的: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## 建立IPv6 in IPv4 隧道
R2(config)#int tunnel 24
R2(config-if)#tunnel mode ipv6ip            ## 把Tunnel隧道模式改为Ipv6 in Ipv4 模式
R2(config-if)#ipv6 address 2001:24::2/64    ## IPv6 接口地址
R2(config-if)#tunnel source e0/1
R2(config-if)#tunnel destination 172.16.34.4
R2(config-if)#ospfv3 1 ipv6 area 0          ## 将tunnel24 宣告进OSPFv3当中,从而达到双方内部可达
R2(config-if)#exit==================================   查看到接口状态   ====================================
R2(config)#do show ipv6 int br
Ethernet0/0            [up/up]FE80::A8BB:CCFF:FE00:20002001:12::2
Ethernet0/1            [up/up]unassigned
Ethernet0/2            [administratively down/down]unassigned
Ethernet0/3            [administratively down/down]unassigned
Tunnel24               [up/up]FE80::A8BB:CCFF:FE00:20002001:24::2==================================   此时查看到IPv6路由表   ====================================
## 可以看到我R2已经学习到R5内部的路由了R2(config)#do show ipv6 route
IPv6 Routing Table - default - 12 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static routeB - BGP, HA - Home Agent, MR - Mobile Router, R - RIPH - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interareaIS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMOND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - RedirectRL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eidlA - 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
==================================================
O   2000:5:1::1/128 [110/1010]via FE80::A8BB:CCFF:FE00:4000, Tunnel24
O   2000:5:2::1/128 [110/1010]via FE80::A8BB:CCFF:FE00:4000, Tunnel24
O   2000:5:3::1/128 [110/1010]via FE80::A8BB:CCFF:FE00:4000, Tunnel24
==================================================
C   2001:12::/64 [0/0]via Ethernet0/0, directly connected
L   2001:12::2/128 [0/0]via Ethernet0/0, receive
C   2001:24::/64 [0/0]via Tunnel24, directly connected
L   2001:24::2/128 [0/0]via Tunnel24, receive
O   2001:45::/64 [110/1010]via FE80::A8BB:CCFF:FE00:4000, Tunnel24
L   FF00::/8 [0/0]via Null0, receive
R2(config)#

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)#exitR3(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)#exitR3(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)#exitR4(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

IPv6 in IPv4隧道

## 目的: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## 建立IPv6 in IPv4 隧道
R4(config)#int tunnel 24
R4(config-if)#tunnel mode ipv6ip            ## 把Tunnel隧道模式改为IPv6 in IPv4 模式
R4(config-if)#ipv6 address 2001:24::4/64    ## IPv6 地址
R4(config-if)#tunnel source e0/0
R4(config-if)#tunnel destination 172.16.23.2
R4(config-if)#ospfv3 1 ipv6 area 0          ## 将tunnel24 宣告进OSPFv3当中,从而达到双方站点IPv6网络可达
R4(config-if)#exit

R5

基础配置

R5(config)#int e0/0
R5(config-if)#no shutdown 
R5(config-if)#ipv6 address 2001:45::5/64
R5(config-if)#exitR5(config)#int loopback 1
R5(config-if)#ipv6 address 2000:5:1::1/64
R5(config-if)#exitR5(config)#int loopback 2
R5(config-if)#ipv6 address 2000:5:2::1/64
R5(config-if)#exitR5(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:50002001: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:50002000:5:1::1
Loopback2              [up/up]FE80::A8BB:CCFF:FE00:50002000:5:2::1
Loopback3              [up/up]FE80::A8BB:CCFF:FE00:50002000: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

检查

R1 的路由表

在这里插入图片描述

R5 的路由表

在这里插入图片描述

R1 Ping R5

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

抓包分析

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

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

配置文档

R1

! 
ipv6 unicast-routing 
!
interface Loopback1ipv6 address 2000:1:1::1/64ospfv3 1 ipv6 area 0
!
interface Loopback2ipv6 address 2000:1:2::1/64ospfv3 1 ipv6 area 0
!
interface Loopback3ipv6 address 2000:1:3::1/64ospfv3 1 ipv6 area 0
!
interface Ethernet0/0ipv6 address 2001:12::1/64ospfv3 1 ipv6 area 0
!
router ospfv3 1!address-family ipv6 unicastrouter-id 1.1.1.1
!

R2

!
ipv6 unicast-routing 
!
interface Tunnel24tunnel mode ipv6ipipv6 address 2001:24::2/64ospfv3 1 ipv6 area 0tunnel source Ethernet0/1tunnel destination 172.16.34.4
!
interface Ethernet0/0no shutdownipv6 address 2001:12::2/64ospfv3 1 ipv6 area 0
!
interface Ethernet0/1no shutdownip address 172.16.23.2 255.255.255.0
! 
router ospfv3 1!address-family ipv6 unicastrouter-id 2.2.2.2
!
router ospf 110router-id 2.2.2.2network 172.16.23.0 0.0.0.255 area 0
!

R3

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

R4

!
ipv6 unicast-routing
!
interface Tunnel24tunnel mode ipv6ipipv6 address 2001:24::4/64ospfv3 1 ipv6 area 0tunnel source Ethernet0/0tunnel destination 172.16.23.2
!
interface Ethernet0/0no shutdownip address 172.16.34.4 255.255.255.0
!
interface Ethernet0/1no shutdownipv6 address 2001:45::4/64ospfv3 1 ipv6 area 0
!
router ospfv3 1!address-family ipv6 unicastrouter-id 4.4.4.4
!
router ospf 110router-id 4.4.4.4network 172.16.34.0 0.0.0.255 area 0
!

R5

!
ipv6 unicast-routing
!
interface Loopback1ipv6 address 2000:5:1::1/64ospfv3 1 ipv6 area 0
!
interface Loopback2ipv6 address 2000:5:2::1/64ospfv3 1 ipv6 area 0
!
interface Loopback3ipv6 address 2000:5:3::1/64ospfv3 1 ipv6 area 0
!
interface Ethernet0/0 no shutdownipv6 address 2001:45::5/64ospfv3 1 ipv6 area 0
!
router ospfv3 1!address-family ipv6 unicastrouter-id 5.5.5.5
!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/33731.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【机器学习】——【线性回归模型】——详细【学习路线】

目录 1. 引言 2. 线性回归理论基础 2.1 线性模型概述 2.2 最小二乘法 3. 数学基础 3.1 矩阵运算 3.2 微积分 3.3 统计学 4. 实现与应用 4.1 使用Scikit-learn实现线性回归 4.2 模型评估 5. 深入理解 5.1 多元线性回归 5.2 特征选择 5.3 理解模型内部 6. 实战与项…

【智能算法】人工免疫算法

目录 一、概述 二、人工免疫算法主要特点 2.1自适应性 2.2 鲁棒性 2.3 多样性 2.4 并行性 三、人工免疫算法基本原理 四、人工免疫算法应用领域 五、人工免疫算法matlab代码解析 一、概述 人工免疫算法(Artificial Immune Algorithm,简称AIA)是一种模拟自然界中免疫…

算法学习DAY01

目录 一、算法优劣的核心指标 二、常数时间操作 1、常见的常数时间的操作 2、位运算 &#xff08;1&#xff09;&#xff08;<<&#xff09;左移运算符 &#xff08;2&#xff09;&#xff08;>>&#xff09;右移运算符 &#xff08;3&#xff09;&#xff0…

第27课 原理图的简介

什么是原理图&#xff1f; 原理图就是由元器件连接而成的电路图&#xff0c;它表征了你所设计电路的基本原理。 原理图上的所有元器件&#xff0c;都要从你所画好的元器件符号库中调用。元器件的信息会显示在原理图上&#xff0c;如型号、位号、特性值等。 按照我们的设计&am…

WPF/C#:数据绑定到方法

在WPF Samples中有一个关于数据绑定到方法的Demo&#xff0c;该Demo结构如下&#xff1a; 运行效果如下所示&#xff1a; 来看看是如何实现的。 先来看下MainWindow.xaml中的内容&#xff1a; <Window.Resources><ObjectDataProvider ObjectType"{x:Type local…

【2024.6.25】今日 IT之家精选新闻

人不走空 &#x1f308;个人主页&#xff1a;人不走空 &#x1f496;系列专栏&#xff1a;算法专题 ⏰诗词歌赋&#xff1a;斯是陋室&#xff0c;惟吾德馨 目录 &#x1f308;个人主页&#xff1a;人不走空 &#x1f496;系列专栏&#xff1a;算法专题 ⏰诗词歌…

电线电缆电性能试验方法练习题

一、单选题 1.单、双臂电桥的测量范围,下面哪个符合( )。 A、单臂电桥范围1-99.9Ω B、单臂电桥范围100Ω以上 C、单臂电桥范围1Ω以下 D、根据操作者爱好 参考答案:B 解析:GB/T 3048.4-2007 1 2.根据《电线电缆电性能试验方法第4部分:导体直流电阻试验》GB/T 3048.4…

电源集成:智能真无线耳机设计中的通信接口

真无线耳机&#xff08;TWS 耳机&#xff09;由于电池寿命更长、功能更强大、设计更吸引人以及价格更优惠&#xff0c;因此继续变得更具吸引力。随着耳机制造商专注于小型化和设计改进&#xff0c;并迅速采用功能来增强用户体验&#xff0c;他们能够在强大且竞争激烈的市场中吸…

vue大纲

Vue介绍 Vue是一套用于构建前端用户界面的前端框架 前端开发者主要的工作,就是为了网站的使用者(又称为网站的用户)构建出美观舒适的网页 构建用户界面的传统方式 在传统的web前端开发中,基于jQuery 模板引擎的方式来构建用户界面的 使用vue构建用户界面 使用vue构建用户界面…

提示缺少Microsoft Visual C++ 2019 Redistributable Package (x64)(下载)

下载地址&#xff1a;这个是官网下载地址&#xff1a;Microsoft Visual C 2019 Redistributable Package (x64) 步骤&#xff1a; 第一步&#xff1a;点开链接&#xff0c;找到下图所示的东西 第二步&#xff1a;点击保存下载 第三步&#xff1a;双击运行安装 第四步&#xf…

芒果YOLOv10改进59:主干Backbone篇RepVIT结构:最新重参数化结构 顶会2023 二次改进升级版,最新开源移动端网络架构,速度贼快

💡本篇内容:YOLOv10改进RepVB:最新重参数化结构 顶会2023 二次改进升级版 最新开源移动端网络架构,速度贼快 💡🚀🚀🚀本博客 改进源代码改进 适用于 YOLOv10 按步骤操作运行改进后的代码即可 💡只需订阅这一个专栏即可阅读:芒果YOLOv10所有改进内容 💡本文…

AI大模型企业应用实战(23)-Langchain中的Agents如何实现?

0 前言 这将所有可用的代理按照几个维度进行分类。 预期模型类型 用于聊天模型&#xff08;接收信息&#xff0c;输出信息&#xff09;或 LLM&#xff08;接收字符串&#xff0c;输出字符串&#xff09;。这主要影响所使用的提示策略。 支持聊天历史记录 这些代理类型是否…

智慧互联:Vatee万腾平台展现科技魅力

随着科技的迅猛发展&#xff0c;我们的生活正逐渐变得智能化、互联化。在这个信息爆炸的时代&#xff0c;一个名为Vatee万腾的平台正以其独特的魅力&#xff0c;引领我们走向一个更加智能的未来。 Vatee万腾&#xff0c;这个名字本身就充满了对科技未来的憧憬与期待。作为一家专…

[网络安全产品]---EDR

what EDR&#xff08;Endpoint Detection and Response&#xff0c;端点检测和响应&#xff09;,这是一种技术或者说是解决方案&#xff0c;它记录端点上的行为&#xff0c;使用数据分析和基于上下文的信息检测来发现异常和恶意活动&#xff0c;并记录有关恶意活动的数据&…

Eureka的介绍与使用

Eureka 是 Netflix 开源的一款服务注册与发现组件&#xff0c;在微服务架构中扮演着重要的角色。 一、Eureka 的介绍 工作原理 服务注册&#xff1a;各个微服务在启动时&#xff0c;会向 Eureka Server 发送注册请求&#xff0c;将自身的服务名、实例名、IP 地址、端口等信息注…

vue2 antd 开关和首页门户样式,表格合计

1.首页门户样式 如图 1.关于圆圈颜色随机设置 <a-col :span"6" v-for"(item, index) in menuList" :key"index"><divclass"circle":style"{ borderColor: randomBorderColor() }"click"toMeRouter(item)&qu…

游戏AI的创造思路-技术基础-深度学习(1)

他来了&#xff0c;他来啦&#xff0c;后面歌词忘了~~~~~ 开谈深度学习&#xff0c;填上一点小坑&#xff0c;可又再次开掘大洞 -.-b 目录 1. 定义 2. 深度学习的发展历史和典型事件 3. 深度学习常用算法 3.1. 卷积神经网络&#xff08;CNN&#xff09; 3.1.1. 算法形成过…

Redis-主从复制的准备工作-准备三台redis服务器

文章目录 1、新建三个redis配置文件&#xff0c;用于定义每个服务的专属配置1.1、复制文件redis.conf到redis安装目录下1.2、关闭redis_common.conf中的 aof 功能1.1.1、新建 redis_6379.conf1.1.2、新建 redis_6380.conf1.1.3、新建 redis_6381.conf 2、启动三个服务器2.1、后…

Electron运行报错

安装&#xff1a; npm install --save-dev electron 1&#xff1a;报错&#xff1a; electron Unable to find Electron app at 2&#xff1a; ReferenceError: require is not defined in ES module scope, you can use importinstead 在ES模块作用域中没有定义ReferenceErr…

Python重拾

1.Python标识符规则 字母&#xff0c;下划线&#xff0c;数字&#xff1b;数字不开头&#xff1b;大小写区分&#xff1b;不能用保留字&#xff08;关键字&#xff09; 2.保留字有哪些 import keyword print(keyword.kwlist)[False, None, True, and,as, assert, async, await…