ipv6-ipv4隧道和bgp全网通小实验

news2024/9/30 5:31:34

效果图:r1能ping通r11和r8,r8能ping通r11

个人理解:ipv6-ipv4隧道只认前缀,例如:r2隧道的source是其接口g0/0/1,它的ipv4 address是29.1.1.1/24,那么转化过来的ipv6就是2002:1d01:0101::/48,对端的r10只能ping通2002:1d01:0101::/48网段内的ipv6。

同理,r10隧道的source是其接口g0/0/0,ipv4是91.1.1.2/24,ipv6就是2002:5b01:0102::/48,r2只能ping通这个ipv6网段内的

代码:

#做ipv6-ipv4隧道之前要先让r1和r10都能ipv4上ping通isp

#省略了r1-r2-isp-r10的ipv4接口配置

#eNSP软件可能有问题,隧道有时候会突然挂掉,上一秒能ping通下一秒又ping不通,我的故障是r10突然ipv4 ping不通isp,重启isp和r10路由器又能ping通了

[r1]

ospf 1 router-id 1.1.1.1                 #ipv4 ospf-1
 area 0.0.0.0 
  network 0.0.0.0 255.255.255.255 

ipv6                             #要先输这个开启ipv6功能

ospfv3 1
 router-id 1.1.1.1

interface LoopBack0
 ipv6 enable 
 ipv6 address 1::1/64 
 ospfv3 1 area 0.0.0.0        #将环回接口宣告进ospfv3的area 0区域

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:1D01:101::1/64 
 ospfv3 1 area 0.0.0.0

[r2]

ip route-static 0.0.0.0 0 29.1.1.2    #ipv4做缺省指向isp,r10同理

acl 2000

rule permit source any 

interface GigabitEthernet0/0/1                           
 ip address 29.1.1.1 24                                        
 nat outbound 2000                     #不做这个r1ping不通isp

ospf 1 router-id 2.2.2.2                #ipv4 ospf-1
 default-route-advertise               #ipv4缺省下放给r1
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 12.1.1.2 0.0.0.0 

ipv6

ospfv3 1
 router-id 2.2.2.2
 import-route ospfv3 2             #重发布
 import-route ripng 1                #重发布

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:1D01:101::2/64 
 ospfv3 1 area 0.0.0.0

interface GigabitEthernet0/0/2
 ipv6 enable 
 ipv6 address 2002:1D01:101:23::1/64 
 ospfv3 1 area 0.0.0.0

interface Tunnel0/0/0

 tunnel-protocol ipv6-ipv4 6to4                #要先写这个改隧道模式
 source GigabitEthernet0/0/1
 ipv6 enable 
 ipv6 address 2002:1D01:101:3::1/64 
 ospfv3 1 area 0.0.0.0

ipv6 route-static :: 0 23::2             #做缺省下一跳指向右边r3
ipv6 route-static 2002:5B01:102:: 48 Tunnel0/0/0         #做静态掩码比缺省的长,去往r10,r11的下一跳指向隧道tunnel0/0/0

#######

#R3-R8上的ipv6 bgp和ipv4 bgp基本上类似,就是有的指令要在ipv6 family里面输

#######

[r3]

ipv6

ipv6 route-static :: 0 2002:1D01:101:23::1         #缺省指向r2

ospfv3 2
 router-id 3.3.3.3
 import-route ospfv3 1        #重发布
 default-route-advertise        #下放缺省

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:1D01:101:23::2/64 
 ospfv3 2 area 0.0.0.0

interface GigabitEthernet0/0/1
 ipv6 enable 
 ipv6 address 2002:1D01:101:34::1/64 
 ospfv3 2 area 0.0.0.0

interface LoopBack0
 ipv6 enable 
 ipv6 address 3::3/64 
 ospfv3 2 area 0.0.0.0

bgp 64512
 router-id 3.3.3.3
 confederation id 100
 peer 4::4 as-number 64512 
 peer 4::4 connect-interface LoopBack0
 ipv6-family
  import-route direct
  import-route ospfv3 2
  peer 4::4 enable
  peer 4::4 next-hop-local

[r4]

ipv6

ospfv3 2
 router-id 4.4.4.4

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:1D01:101:34::2/64 
 ospfv3 2 area 0.0.0.0

interface GigabitEthernet0/0/1
 ipv6 enable 
 ipv6 address 2002:1D01:101:45::1/64 
 ospfv3 2 area 0.0.0.0

interface LoopBack0
 ipv6 enable 
 ipv6 address 4::4/64 
 ospfv3 2 area 0.0.0.0

bgp 64512
 router-id 4.4.4.4
 confederation id 100
 peer 3::3 as-number 64512 
 peer 3::3 connect-interface LoopBack0
 peer 5::5 as-number 64512 
 peer 5::5 connect-interface LoopBack0
 ipv6-family 
  peer 3::3 enable
  peer 3::3 reflect-client
  peer 5::5 enable
  peer 5::5 reflect-client

[r5]

ipv6

ospfv3 2
 router-id 5.5.5.5

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:1D01:101:45::2/64 
 ospfv3 2 area 0.0.0.0

interface GigabitEthernet0/0/1
 ipv6 enable 
 ipv6 address 2002:1D01:101:56::1/64 
 ospfv3 2 area 0.0.0.0

interface LoopBack0
 ipv6 enable 
 ipv6 address 5::5/64 
 ospfv3 2 area 0.0.0.0

bgp 64512
 router-id 5.5.5.5
 confederation id 100
 confederation peer-as 64513
 peer 4::4 as-number 64512 
 peer 4::4 connect-interface LoopBack0
 peer 6::6 as-number 64513 
 peer 6::6 ebgp-max-hop 255 
 peer 6::6 connect-interface LoopBack0
 ipv6-family 
  import-route direct
  peer 4::4 enable
  peer 4::4 next-hop-local 
  peer 6::6 enable

[r6]

ipv6

ospfv3 2
 router-id 6.6.6.6

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:1D01:101:56::2/64 
 ospfv3 2 area 0.0.0.0

interface GigabitEthernet0/0/1
 ipv6 enable 
 ipv6 address 2002:1D01:101:67::1/64 

bgp 64513
 router-id 6.6.6.6
 confederation id 100
 confederation peer-as 64512
 peer 5::5 as-number 64512 
 peer 5::5 ebgp-max-hop 255 
 peer 5::5 connect-interface LoopBack0
 peer 2002:1D01:101:67::2 as-number 101 
 ipv6-family 
  import-route direct                        #重发布共享直连链路
  import-route ospfv3 2                   #重发布共享ospfv3 2
  peer 5::5 enable
  peer 2002:1D01:101:67::2 enable

[r7]

ipv6

ripng 2

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:1D01:101:67::2/64 

interface GigabitEthernet0/0/1
 ipv6 enable 
 ipv6 address 2002:1D01:101:78::1/64 
 ripng 2 enable
 ripng default-route originate         #下放缺省给r8

interface LoopBack0
 ipv6 enable 
 ipv6 address 7::7/64 
 ripng 2 enable

bgp 101
 router-id 7.7.7.7
 peer 8::8 as-number 101 
 peer 8::8 connect-interface LoopBack0
 peer 2002:1D01:101:67::1 as-number 100 
 ipv6-family
  network 7::7 128                 #宣告7的环回出去
  network 8:: 64
  network 8::8 128 
  import-route direct                #重发布直连链路出去
  import-route ripng 2                #重发布ripng 2出去
  peer 8::8 enable
  peer 8::8 next-hop-local 
  peer 2002:1D01:101:67::1 enable

[r8]

ipv6

ripng 2

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:1D01:101:78::2/64 
 ripng 2 enable

interface LoopBack0
 ipv6 enable 
 ipv6 address 8::8/64 
 ripng 2 enable

bgp 101
 router-id 8.8.8.8
 peer 7::7 as-number 101 
 peer 7::7 connect-interface LoopBack0
 ipv6-family 
  peer 7::7 enable

#isp只配了接口ipv4指令

[r10]

ipv6

ipv6 route-static :: 0 Tunnel0/0/0

ripng 1

interface GigabitEthernet0/0/1
 ipv6 enable 
 ipv6 address 2002:5B01:102::1/64 
 ripng 1 enable
 ripng default-route originate         #下放缺省给r11

interface LoopBack0
 ipv6 enable 
 ipv6 address 2002:5B01:102:1::1/64 
 ripng 1 enable

interface Tunnel0/0/0

 tunnel-protocol ipv6-ipv4 6to4
 source GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:5B01:102:3::1/64 
 ripng 1 enable

[r11]

ipv6

ripng 1

interface GigabitEthernet0/0/0
 ipv6 enable 
 ipv6 address 2002:5B01:102::2/64 
 ripng 1 enable

interface LoopBack0
 ipv6 enable 
 ipv6 address 2002:5B01:102:2::1/64 
 ripng 1 enable

#建议先通上路隧道,再通右路bgp

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

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

相关文章

代理设计模式JDK动态代理CGLIB动态代理原理

代理设计模式 代理模式(Proxy),为其它对象提供一种代理以控制对这个对象的访问。如下图 从上面的类图可以看出,通过代理模式,客户端访问接口时的实例实际上是Proxy对象,Proxy对象持有RealSubject的引用&am…

qml定位器:Row、Column、Grid、Flow

03.qml import QtQuickWindow {width: 640height: 480visible: truetitle: qsTr("2.7 定位器")Column {RedSquare {}RedSquare {}RedSquare {}spacing: 10 //间隔}Row {RedSquare {}RedSquare {}RedSquare {}spacing: 10x: 58}Flow { //中文是“流”的意思&#xff…

特征融合篇 | YOLOv8 引入长颈特征融合网络 Giraffe FPN

在本报告中,我们介绍了一种名为DAMO-YOLO的快速而准确的目标检测方法,其性能优于现有的YOLO系列。DAMO-YOLO是在YOLO的基础上通过引入一些新技术而扩展的,这些技术包括神经架构搜索(NAS)、高效的重参数化广义FPN(RepGFPN)、带有AlignedOTA标签分配的轻量级头部以及蒸馏增…

【大数据】流处理基础概念(一):Dataflow 编程基础、并行流处理

流处理基础概念(一):Dataflow 编程基础、并行流处理 1.Dataflow 编程基础1.1 Dataflow 图1.2 数据并行和任务并行1.3 数据交换策略 2.并行流处理2.1 延迟与吞吐2.1.1 延迟2.1.2 吞吐2.1.3 延迟与吞吐 2.2 数据流上的操作2.2.1 数据接入和数据…

企业网架构

企业网架构 局域网通信不同网段 局域网通信 MAC地址:硬件地址,固定在网卡上的地址(唯一标识一个网卡),确定网络设备位置的,数据链路层。一个设备可以有多个网卡,每一个网卡都需要一个唯一MAC。ARP协议:通过目的IP&…

回归预测 | Matlab实现GA-APSO-MBP、GA-MBP、MBP、BP多输入单输出回归预测

回归预测 | Matlab实现GA-APSO-MBP、GA-MBP、MBP、BP多输入单输出回归预测 目录 回归预测 | Matlab实现GA-APSO-MBP、GA-MBP、MBP、BP多输入单输出回归预测预测效果基本描述程序设计参考资料 预测效果 基本描述 1.Matlab实现GA-APSO-MBP、GA-MBP、MBP、BP多输入单输出回归预测&…

图片如何转文字?手把手教你图片转文字

面对日益增长的数字化信息,图片转文字成为了一种必不可少的技术,通过简单的步骤,将图片中的文字转换为可编辑和可搜索的文本,提高工作效率和准确性。 这是一款通过光学字符识别(OCR)实现从图像中提取文字的…

细数2023测试测量及通信行业的十大年度热点动态

2023年,全球测试测量及通信行业在多重技术革新和市场需求的驱动下呈现出强劲的增长态势。这一年里,5G通信网络的大规模部署与商用、人工智能技术的广泛应用、物联网(IoT)设备数量的爆炸性增长以及电动汽车行业的迅猛发展等因素&am…

在CentOS 7 中配置NFS服务器

目录 1、克隆两个虚拟机 2、安装 NFS 服务 3、NFS 服务使用 1、克隆两个虚拟机 nfs-servernfs-client(修改ip地址)[rootxnode1 ~]# cd /etc/sysconfig/network-scripts/[rootxnode1 network-scripts]# vi ifcfg-eno16777736 #修改内容如下 BOOTPROT…

浅析Java虚拟机中的ZGC

引言 为什么需要垃圾回收(Garbage Collection) 垃圾回收是Java开发中的关键机制,负责自动管理内存,防止内存泄漏,提高开发效率和应用程序的稳定性。 Java中主要的垃圾回收方法 标记-清除算法(Mark and …

YZ系列工具之YZ05:代码运行中调用“计算器”

我给VBA下的定义:VBA是个人小型自动化处理的有效工具。利用好了,可以大大提高自己的工作效率,而且可以提高数据的准确度。我的教程一共九套一部VBA手册,教程分为初级、中级、高级三大部分。是对VBA的系统讲解,从简单的…

CentOS搭建DNS服务器

服务器规划 DNS服务器IP为:172.16.32.253 需要自定义域名解析 172.16.32.253 dns.zhangsan.com 172.16.32.128 test1.zhangsan.com 172.16.32.129 test2.zhangsan.com 172.16.32.130 www.zhangsan.com 1. 服务器初始化 [rootlocalhost ~]# hostnamectl set-hostnam…

python|写一个简单的web应用框架

写应用框架需要写底层服务器么? 这个要区分2种情况,如果应用框架,你没有参考WSGI标准,那么在写应用框架之前,你就必须要定义一套属于自己的服务器,当然本文不采取这种方式,专业的事情应该专业的人来做。我…

springboot集成easypoi

easypoi,主打的功能就是容易,通过简单的配置&#xff0c;就可以方便的写出Excel导出,Excel模板导出,Excel导入,Word模板导出 pom导入依赖 <dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-star…

实现钉钉与宁波银行对接,助力东吴黄金集团财务智能化

客户介绍&#xff1a; 某黄金集团有限公司是一家在国内外黄金市场上具有重要影响力的综合性黄金企业。该公司拥有一支高素质、专业化的团队&#xff0c;具备丰富的行业经验和卓越的执行力。在业务范围上&#xff0c;该公司涵盖了黄金勘探、采选、冶炼、加工、销售等全产业链&a…

华为机考入门python3--(0)模拟题2-vowel元音字母翻译

分类&#xff1a;字符串 知识点&#xff1a; 字符串转list&#xff0c;每个字符成为list中的一个元素 list(string) 字符串变大小写 str.upper(), str.lower() 题目来自【华为招聘模拟考试】 # If you need to import additional packages or classes, please import …

一篇搞定大论文参考文献,从找文献到交叉引用全流程

我们在写论文过程中&#xff0c;肯定会引用他人的文献&#xff0c;根据自己的写作经历&#xff0c;总结了一套很实用且不会出错的引用方法。1、记录文献顺序 你在论文中每引用一篇文献&#xff0c;你就在文献后加上[1][2]…[n]&#xff0c;然后新建一个word文档&#xff0c;在…

TCP高并发服务器简介(select、poll、epoll实现与区别)

select、poll、epoll三者的实现&#xff1a; select实现TCP高并发服务器的流程&#xff1a; 一、创建套接字&#xff08;socket函数&#xff09;&#xff1a;二、填充服务器的网络信息结构体&#xff1a;三、套接字和服务器的网络信息结构体进行绑定&#xff08;bind函数&…

七款网工在线画拓扑工具

网络工程师一般会使用多种软件进行绘图&#xff0c;以下是一些常用的软件&#xff1a; Visio&#xff1a;这是由微软开发的一款流程图和矢量图绘制软件&#xff0c;网络工程师通常使用它来绘制网络拓扑图、网络架构图等。亿图图示专家&#xff08;Edraw Max&#xff09;&#…

遇到继需证件照的时候怎么办?

你是否曾经遇到过这样的情况&#xff1a;急需一张证件照&#xff0c;却没有时间去照相馆或复印店&#xff0c;而且手头也没有现成的照片。这时候&#xff0c;你可能会感到很困扰&#xff0c;不知道该怎么办才好。别担心&#xff0c;今天我将为你揭示如何在短短一分钟内制作出自…