NDP隶属于ipv6
ICMPv6除了可以完成ICMPv4所有功能以外,多出一项功能为NDP。
Empty-----------incomplete---------------reachable
| |
Probe------------delay----------------------------stale
开始是Empty没有发消息,发NS一瞬间为-incomplete,给响应了NA就是-reachable代表任何问题也没有,stale指邻接关系还有我不确定有没有问题,会发delay在这个状态会开启一个计时器如果结束范围内收到你的NA,回到reachable,如果没收到你的NA把状态变为probe我会在这个状态周期发NS等你回应NA,如果不回应回到Empty。Show ipv6 enable
IPv6无状态地址自动配置的缺陷
- 通过路由器间的RA来获得能上网的AGUA地址网关子网掩码---,无法得知DNS服务器,能给PC发的信息实在有限。
- 无状态地址自动配置完全依赖路由器,管理性弱。
DHCPv6拿地址有两种拿法
- 状态化DHCP的自动获悉,所有地址信息都找DHCPv6服务器。
- 无状态DHCP的自动获悉我只通过你获得DNS服务器域名等等。
网关必须得通过RA来获悉。
ipv4与ipv6中DHCP区别
- ipv4中:先弄服务器,然后pc开dhcp功能。
- ipv6中:pc没有开启或不开启ipv6的选项,可以手工,也可以自动获悉,自动获悉靠RA拿,pc发的是RS。
发RA是M和O位 。
IPv6主要报文:
- Solicit客户端
- Advertise服务器端
- Request客户端
- Reply服务器端
IPv6通过DHCP拿地址可以就两步(1)和(4)。想获悉DHCPv6地址,接口必须有link-local地址。
DHCPv6也可以做中继。
R2和R4之间做DHCP,R2做DHCP服务器,R4通过DHCP去获悉地址信息。
R2想让他有发送RA的功能得启用ipv6功能:
R2:
R2(config)#ipv6 unicast-routing
R2进Ethernet0/0
R2(config-if)#ipv6 address 2001:1:1:24::2/64
R2先把DHCP启起来:
R2(config)#service dhcp
R2(config)#ipv6 dhcp pool R2(启地址池)
R2(config-dhcpv6)#addess prefix 2001:1:1:24::/64(指定地址,设置前缀就行)
R2(config-dhcpv6)#dns-server 2001:1:1:24::2(DNS服务器)
R2(config-dhcpv6)#domain-name cisco.com(域名)
ipv6全局创建地址池还没完,你得接口调用地址池,进入发地址接口敲:ipv6 dhcp server R2
R2进入发地址接口Ethernet0/0
R2(config-if)#ipv6 dhcp server R2(调用地址池)
修改RA
R2(config-if)#ipv6 nd managed-config-flag(这个是原本M位置0,现在置1了)
拿地址一方:
R4:
进入接口Ethernet0/1
R4(config-if)#ipv6 enable(必须有一个link-local地址)
R4(config-if)#no shutdown
R4(config-if)#ipv6 address dhcp(无状态地址自动配置直接4步交互,加enable是两步交互,两步安全性差)
Show ipv6 interface brief
R4-------R2------------R1
R1为DHCP服务器R4为客户端,那么R2做中继敲:Ipv6 dhcp relay destination 跟服务器地址(例2001:1:1:12::1 可以跟接口 serial1/1可以通过这个接口发走,做中继你本身这个接口不能是dhcpserver)
分为IGP和EGP:
- IGP:RIPng(对应的RFC文档2080)、OSPFv3(早先只支持ipv6,现在在Cisco既能ipv6又能ipv4)(OSPFv2和OSPFv3最大区别:在OSPFv2中靠一类和二类LSA来形成树形结构【包含拓扑信息和路由信息】OSPFv3设计的时候不再基于ip地址,画出的矢量图不在有ip地址,没办法计算ip路由,只能基于8类9类LSA计算link-local和AGUA路由)(对应的RFC文档2740)、IS-IS(最早属于OSI,现在在TCP/IP,在IPv6和IPv4中启用的是同一个is-is只能添加了TLV)
- EGP:MP-BGP(RFC2545/2858,通过AFI【主地址簇的标识符】和一个SAFI【子地址簇的标识符】结合报文设计来支持ipv6)
OSPFv2一个接口宣告进一个进程之后,如果这个时候路由器启用一个新的进程,新的进程的也宣告这个接口,这时新的进程也会通过这个接口不可能建立邻居,一个接口在OSPFv2中只能属于一个进程。
OSPFv3中有一个进程ID的概念,通过进程ID等于虚拟多个接口,就不用担心一个接口只能属于一个进程。
OSPFv3中LSA:
R2和R4之间:
R2去掉DHCPv6:
R2(config)#default interface Ethernet0/0
R4去掉DHCPv6:
R4(config)#default interface Ethernet0/1
R2:
进Ethernet0/0
R2(config-if)#ipv6 address 2001:1:1:24::2/64
R4:
进入Ethernet0/1
R4(config)#ipv6 address 2001:1:1:24::4/64
R4:ping 2001:1:1:24::2
R4(config)#ipv6 unicast-routing
创建环回口:
R2:
进入loopback0:
R2(config-if)#ipv6 address 2::2/128(ipv6环回口掩码可以128位)
R4:
进入loopback0:
R4(config-if)#ipv6 address 4::4/128
Show ipv6 route
LC直连路由(网络中只有这个路由,直接为128位就合并了)
C直连路由(接口所连接网络的直连路由)
L直连路由(在这个网络中我自身接口的主机路由)
IPv6静态路由:
R4(config)#ipv6 route 2::2/128(前缀掩码)Ethernet 0/1(出接口)写link-local地址(下一跳写link-local地址)
Show ipv6 route有了静态
清掉静态:R4:no
ipv6 route 2::2/128(前缀掩码)Ethernet 0/1(出接口)写link-local地址(下一跳写link-local地址)
RIPng配置:
R4:
R4(config)#ipv6 router rip R4(进程号,只具有本地意义)
R4(config-rtr)#?
distance管理距离,默认120
distribute-list做路由过滤
maximum-paths指定最大负载均衡的路由条目数量
poison-reverse开启带有毒性逆转的水平分割
redistribution重分发
split-horizon正常水平分割
timers修改计时器
port修改端口号
RIPng基于UDP,IPv4中RIP的端口号为520,IPv6中RIPng的端口号为521。
Port 跟端口(改这个直连的邻居之间都得改) multicast-group 还跟组播地址
IPv6没有宣告语句,想宣告得进入接口,R4进入loop back 0和Ethernet 0/1,
R4(config-if-range)#ipv6 rip R4 enable(把接口宣告进RIPng)
R4(config-if-range)#ipv6 rip ?
summary-address手工汇总
metric-offset偏移列表
default-information下方默认路由
R2:
进入loop back 0和Ethernet 0/0
R2(config-if-range)#ipv6 rip cisco enable
Show ipv6 route
RIP度量值还是使用“跳数”来计算
清掉RIP
R2(config)#no ipv6 router rip cisco
R4(config)#no ipv6 router rip R4
全局干掉RIP进程,默认接口也就干掉了!
旧命令:
R4:
R4(config)#ipv6 router eigrp 90
R4(config-rtr)#eigrp router-id 4.4.4.4(在ipv6中一定要设置路由器ID)
R4(config-rtr)#no shutdown(开启进程)
进入接口宣告:
R4进入loop back 0,Ethernet 0/1
R4(config-if)#ipv6 eigrp 90
新式命令,及支持ipv4又支持ipv6:
R2:
R2(config)#router eigrp CCIE
R2(config-router)#address-family ipv6 unicast autonomous-system 90
R2(config-router-af)#eigrp router-id 2.2.2.2
R2(config-router-af)#no shutdown
R2:show ipv6 eigrp neighbors(邻居已经建起来了,并且使用对端link-local地址做路由)
Show ipv6 route (eigrp标识D,管理距离90)
Ping 4::4 source 2::2
R2(config)#no router eigrp ccie
R4(config)# no ipv6 eigrp 90
两种做法:
老版命令:
R4:
R4(config)#ipv6 router ospf 110 (进程号只有本地意义)
R4(config-rtr)#router-id 4.4.4.4 (自动选也可以,但是选不到,因为路由器接口没有ip地址)
宣告:
R4进入 loop back 0,Ethernet 0/1
R4(config-if-range)#ipv6 ospf 110 area 0(接口级宣告)
R2新型命令:
R2(config)#router ospfv3 110
R2(config-router)#address-family ipv6 unicast
R2(config-router-af)#router-id 2.2.2.2
宣告:进入loopback 0 和 Ethernet 0/0
R2(config-if)#ospfv3 110 ipv6 area 0
show ipv6 ospf neighbor 可以建立邻居,选DR和BDR
show ipv6 ospf neighbor detail可以看到邻居地址
show ipv6 ospf database看LSA
宣告了每个接口都会划分一个接口ID。
show ipv6 ospf database router看路由明细(没有显示环回口信息)
show ipv6 ospf database network
show ipv6 ospf database link看8类LSA(8类LSA结合1类2类LSA计算路由信息)
show ipv6 ospf database prefix看9类LSA(只通告了环回口的,没有通告物理接口,R4是DR)
测试,接改点到点,让它没有DR:---------------------------------------------------------------
R2进入Ethernet0/0:
R2(config-if)#ipv6 ospf network point-to-point
R4进入Ethernet0/1:
R4(config-if)#ospfv3 network point-to-point
R2:Show ipv6 ospf database变点到点之后intra area变为4个
Show ospfv3 database prefix
Link LSA主要包含路由器之间链路的link-l ocal,附带可以包含AGUA地址。
Intre area prefix包含这些接口的AGUA地址没有包含link-local地址。
8类9类结合1类2类LSA能形成路由,只靠1类和2类LSA只能形成拓扑。
OSPFv3针对ipv4实验:1:04:02
R4去掉:
R4(config)#no ipv6 router ospf 110
R4(config)#router ospfv3 110
R4(config-router)#address-family ipv6 unicast
R4(config-router-af)#router-id 4.4.4.4
R4进入loop back0和Ethernet 0/1:
R4(config-if-range)#ospfv3 110 ipv6 area 0
R2:
进入loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2进入Ethernet 0/0
R2(config-if)#IP address 24.1.1.2 255.255.255.0
R4:
进入loopback 0
R4(config-if)#ip address 4.4.4.4 255.255.255.0
进入Ethernet 0/1
R4(config-if)#ip address 24.1.1.4 255.255.255.0
调整进程:
R2:
R2(config)#router ospfv3 110
R2(config-router)#address-family ipv4 unicast
R2(config-router-af)#router-id 2.2.2.2
R4:
R4(config)#router ospfv3 110
R4(config-router)#address-family ipv4 unicast
R4(config-router-af)#router-id 4.4.4.4
R2:
进入loopback 0和Ethernet0/0(接口既有)
R2(config-if-range)#ospfv3 110 ipv4 area 0
R4:
进入loopback0和Ethernet 0/1
R4(config-if-range)# ospfv3 110 ipv4 area 0
优化选DR和BDR:
R2:进入0/0
R2(config-if)#ip ospf network point-to-point
R4:进入0/0
R4(config-if)#ip ospf network point-to-point
R2:
Show ospfv3 neighbor基于ipv4和ipv6各一个邻居
Show ospfv3 database基于ipv4和ipv6各一个邻居
Show ospfv3 ipv4 database
Show ospfv3 ipv4 database router一类只有拓扑信息
Show ospfv3 ipv4 database link 8类
R2(config)#no router ospfv3 110
R4(config)#no router ospfv3 110
IS-IS的ipv6实验:
R2:
R2(config)#router isis
R2(config-router)#net 49.0001.0000.0000.0002.00
R2(config-router)#address-family ipv6 unicast
R2(config-router-af)#?
默认为no multi-topology 就是ipv4和ipv6都有,不过有隐患。
is-is宣告:
R2:
进入loopback 0 和 ethernet 0/0
R2(config-if-range)#ipv6 router isis
R4:
R4(config)#router isis
R4(config-router)#net 49.0001.0000.0000.0004.00
R4(config-router)#address-family ipv6 unicast
R4:
进入loopback 0 和 ethernet 0/1
R4(config-if-range)#ipv6 router isis
is-is默认没有开启邻居建立的提示:
R2:show isis neighbor既有L1也有L2的邻居
Show clns neighbors
Show clns is-neighbors
Show isis database看数据库
Show isis database verbose看数据库详细信息
IS-IS启用IPv4:双栈
R2:
进入loopback 0 和 ethernet 0/0
R2(config-if-range)#ip router isis
R4:
进入loopback 0 和 ethernet 0/1
R4(config-if-range)#ip router isis
R2:show isis database verbose 一个lsp中即携带ipv4信息,又携带ipv6信息。
R2:
R2(config)#router isis
R2(config-router)#metric-style wide
R2(config-router)#address-family ipv6 unicast
R2(config-router-af)#multi-topology
R4:
R4(config)#router isis
R4(config-router)#metric-style wide
R4(config-router)#address-family ipv6 unicast
R4(config-router-af)#multi-topology
R2:show isis database verbose双栈
Show ipv6 route在ipv4中路由标识是小l在ipv6中路由标识是大L。
Ping 4::4 source 2::2
R2(config)#No router isis
R4(config)#NO router isis
BGP的IPv6:
R2:
R2(config)#router bgp 10
R2(config-router)#no auto-summary
R2(config-router)#no synchronization
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#no bgp default ipv4-unicast
R2(config-router)#neighbor 2001:1:1:24::4 remote-as 10
R2(config-router)#address-family ipv6 unicast
R2(config-router-af)#neighbor 2001:1:1:24::4 activate (激活邻居关系)
R2(config-router-af)#network 2::2/128(通告路由)
R4:
R4(config)#router bgp 10
R4(config-router)#no auto-summary
R4(config-router)#no synchronization
R4(config-router)#bgp router-id 4.4.4.4
R4(config-router)#no bgp default ipv4-unicast
R4(config-router)#neighbor 2001:1:1:24::2 remote-as 10
R4(config-router)#address-family ipv6 unicast
R4(config-router-af)#network 4::4/128
R2:show run|section bgp
通过route-map让传递的下一跳强行修改才能让ipv6传ipv4地址
R2:show bgp ipv6 unicast看ipv6单播
Show bgp ipv6 unicast
Show ipv6 route
Ping 4::4 source 2::2
ipv6迁移过程,手段:
- 双栈(土豪做法)
- 隧道
- 地址转换(一般不适用)
tunnel跨越ipv4骨干把ipv6的孤岛连在一起,去掉外部ipv4报头,查看内部ipv6报头,查看ipv6路由,来做最终转发。
tunnel分类:
- overlay tunnel(也叫手工tunnel也叫静态tunnel),使用ipv4建立tunnel,建好后使用ipv6地址,在两个园区之间通过tunnel建立ipv6的IGP,让两个园区的路由可以互联互通,当发送流量时通过这个tunnel来封装,前面添加一个新的ipv4报头来欺骗ipv4骨干路由器,能够端到端的传输。
- 手工tunnel最大特点:每建立一个tunnel需要手工去指定配置命令。(两个园区可方便,园区多了配置了就大不好管理)
- auto-tunnel自动隧道,需要依赖BGP,通过BGP来完成自动隧道的建立,建立完通过自动隧道不需要指定tunnel目的地,通过目的地址来帮助你自动完成tunnel建立。(自动tunnel并不是特别灵活,数据层面的建立需要控制层面的BGP,控制层面BGP邻居依旧是需要手工,配置上比手工tunnel少些,依旧不行)
- 6-to-4 tunnel,适合在路由器之间(园区边界路由器),每台路由器创建tunnel就行,并且每个边界写一条静态路由,就能获悉。两个园区在数据层面发送中路由器能根据你数据层面流量的目的地址来判断这个流量是去往那个目的园区,根据这个目的园区会自动把tunnel建立,让报文连通。(条件是你使用6-to-4 tunnel时ipv6地址必须符合一个规则,符合规则后每个园区收到访问的ipv6报文,会看报文能不能通过tunnel走基于从17到48位值来确定把流量发给哪个目的园区,建立tunnel。)路由器和路由器之间建立
- ISATAP tunnel,一般建议Windows主机或Linux和路由器之间建立,也是一种动态tunnel,这种tunnel适合一台主机在ipv4环境和一台路由器有ipv4路由通信,这个时候可以基于ipv4的连通性,在主机和路由器之间建立ISATAP的隧道,当你建立好隧道,你可以通过该隧道访问这个路由器所连接的ipv6网络。(具体时PC产生的ipv6的连接,发送ipv6数据的时候前面通过ipv4来封装,ipv4封装后,数据能通过ipv4骨干到达路由器,路由器去掉ipv4报头,把报文发往ipv6网。)PC和路由器之间最低是windows7左右,有版本限制(让一个处于双栈的pc成功访问路由器身后的ipv6网络)
四种tunnel的部署方法:
R2(边界)、R3(边界)
R2和R4之间运行ipv6
R3和R5之间运行ipv6
通过在R2和R3之间建立一个tunnel来完成互联互通
R2:
R2#erase startup-config
R2#reload
No
R4:
R4#erase startup-config
R4#reload
No
R1:进入loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
进入serial 1/1
R1(config-if)#ip address 13.1.1.1 255.255.255.0
进入serial 1/0
R1(config-if)#ip address 12.1.1.1 255.255.255.0
进入Ethernet 0/0
R1(config-if)#ip address 16.1.1.1 255.255.255.0
R3:
进入loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.0
进入serial 1/0口
R3(config-if)#no shutdown 13.1.1.3 255.255.255.0
R6:进入loopback 0
R6(config-if)#ip address 6.6.6.6 255.255.255.0
进入Ethernet 0/0
R6(config-if)#ip address 16.1.1.6 255.255.255.0
R2:进入loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.0
进入serial 1/1
R2(config-if)#ip address 12.1.1.2 255.255.255.0
先得在R1、R2、R3、R5中运行IGP
R1:
R1(config)#router eigrp 90
R1(config-router)#no auto-summary
R1(config-router)#network 0.0.0.0 255.255.255.255(所有接口都宣告进来)
R2:
R2(config)#router eigrp 90
R2(config-router)#no auto-summary
R2(config-router)#network 2.2.2.2 0.0.0.0
R1(config-router)#network 12.1.1.2 0.0.0.0
R3:
R3(config)#router eigrp 90
R3(config-router)#no auto-summary
R3(config-router)#network 3.3.3.3 0.0.0.0
R3(config-router)#network 13.1.1.3 0.0.0.0
R6:
R6(config)#router eigrp 90
R6(config-router)#no auto-summary
R6(config-router)#network 6.6.6.6 255.255.255.0
R6(config-router)#network 16.1.1.6 0.0.0.0
R1:show ip eigrp neighbor看邻居
Show ip router eigrp看到环回口路由就基本ok了
R2和R4之间规划ipv6地址:2001:1:1:24
R3和R5之间规划ipv6地址:2001:1:1:35
R4和R5各自启一个loopback口,双方loopback互通:
R2:进入Ethernet 0/0
R2(config-if):ipv6 address 2001:1:1:24::2/64
R3:进入Ethernet 0/1
R3(config-if)#ipv6 address 2001:1:1:35::3/64
R4:进入loopback 0
R4(config-if)#ipv6 address 4::4/64
进入Ethernet 0/1
R4(config-if)#ipv6 address 2001:1:1:24::4/64
R5:进入loopback 0
R5(config-if)#ip address 5::5/64
进入Ethernet 0/0
R5(config-if)#ipv6 address 2001:1:1:35::5/64
Overly tunnel在两个园区边界做,前提是这两个边界路由器是双栈路由器。
R2:
R2(config)#interface tunnel 23
R2(config-if)#tunnel source 2.2.2.2(指定的是当我通过tunnel给你转发数据的时候,我所添加的外层报头的源目IP地址是什么)
R2(config-if)#tunnel destination 3.3.3.3
当前tunnel模式不太对,当前是GRE tunnel ,只能实现封装ipv4,如果要ipv4封装ipv6需要指定:
R2(config-if)#tunnel mode ipv6ip(告知tunnel把ipv4报头夹杂在ipv6的数据包之上,用ipv4封装ipv6)
R3:
R3(config)#interface tunnel 23
R3(config-if)#tunnel source 3.3.3.3
R3(config-if)#tunnel destination 2.2.2.2
R3(config-if)#tunnel mode ipv6ip
现在R2和R3之间相当于连接了一根虚线,虚线启地址,通过tunnel连接在一起:
tunnel线配置ipv6地址:
R2:
R2(config)#interface tunnel 23
R2(config-if)#ipv6 address 2001:1:1:23::2/64
R3:
R3(config)#interface tunnel 23
R3(config-if)#ipv6 address 2001:1:1:23::3/64
运行IGP:ipv6的IGP
R2:
R2(config)#ipv6 unicast-routing
R2(config)#router eigrp CCIE
R2(config-router)#address-family ipv6 unicast autonomous-system 90
R2(config-router-af)#eigrp router-id 2.2.2.2
R2(config-router-af)#no shutdown
不用network,它会自动把拥有ipv6接口宣告进去
R4:
R4(config)#ipv6 unicast-routing
R4(config)#router eigrp CCIE
R4(config-router)#address-family ipv6 unicast autonomous-system 90
R4(config-router-af)#eigrp router-id 4.4.4.4
R4(config-router-af)#no shutdown
R2:show ipv6 route可以看到R4的环回口路由
R3和R5之间运行OSPFv3
R3:
R3(config)#ipv6 unicast-routing
R3(config)#router ospfv3 110
R3(config-router)#address-family ipv6 unicast
R3(config-router-af)#router-id 3.3.3.3
宣告:
进入Ethernet 0/1
R3(config-if)#ospfv3 110 ipv6 area 0
R5:
R5(config)#ipv6 unicast-routing
进入loop back 0 接口类型改为p-to-p以64位掩码通告
R5(config-if)#ospfv3 network point-to-point
R5(config)#router ospfv3 110
R5(config-router)#address-family ipv6 unicast
R5(config-router-af)#router-id 5.5.5.5
进入loopback0 和Ethernet 0/0
R5(config-if-range)#ospfv3 110 ipv6 area 0
等待选举DR和BDR
R2和R3也通过tunnel口来建立一个IGP邻居:用RIP
R2:
R2(config)#ipv6 unicast-routing
R2(config)#ipv6 router rip cisco(什么也不用管)
进入tunnel
R2(config)#interface tunnel 23
R2(config-if)#ipv6 rip cisco enable
R3:
R3(config)#ipv6 unicast-routing
R3(config)#ipv6 router rip cisco(什么也不用管)
进入tunnel
R3(config)#interface tunnel 23
R3(config-if)#ipv6 rip cisco enable
双向重分发:
R2:
R2(config)#router eigrp CCIE
R2(config-router)#address-family ipv6 unicast autonomous-system 90
R2(config-router-af)#topology base
R2(config-router-af-topology)#redistribute rip cisco metric 10000 100 255 1 1500 include-connecteed(带宽、延迟、可靠性、负载、MTU)
反向重分发:
R2(config)#ipv6 router rip cisco
R2(config-rtr)#redistribute eigrp 90 metric 3 include-connecteed
R3:
R3(config)#router ospfv3 110
R3(config-router)#address-family ipv6 unicast
ipv4重分发,宣告进该协议的直连路由、通过该协议学到的加入路由表的这些能重分发过去。
ipv6重分发,把一个协议重分发入另一个协议,默认是不会带直连的,希望携带得加include-connecteed
R3(config-router-af)#redistribute rip cisco include-connecteed
R3(config)#ipv6 router rip cicso
R3(config-rtr)#redistribute ospf 110 metric 3 include-connecteed
R2:show ipv6 route 有5的环回口
R4也能学到
R4:show ipv6 route 通过EX学到
R3:show ipv6 route 能学到4的环回口路由以及24网络
R5:show ipv6 rute 也能学到OE2 的4网络
R4:ping 5::5 source 4::4 能通代表tunnel 就ok
R4pingR5封装的原始报文到达R2,R2查路由表发现要去往5::5,这个路由告诉我要通过tunnel走,走的时候要增加一重封装(根据tunnel source和tunnel destination来加),IPv4|GRE,别人只会关注外层报头,R1会认为这个报文去往R3,就会查单播路由表查ipv4路由发给R3,R3收到发现是发给自己,会去掉外层ipv4报头一看是一个GRE懂了,知道后面还有东西,去掉GRE一看看到IPv6报头最终目的地是5::5会查找ospf路由做出正确的转发。
缺点:配置量大。(只存在实验室环境)
R2:
R2(config)#no interface tunnel 23
R2(config)#no ipv6 router rip cisco
R3:
R3(config)#no interface tunnel 23
R3(config)#no ipv6 router rip cisco
R2:
R2(config)#router eigrp CCIE
R2(config-router)#address-family ipv6 unicast autonomous-system 90
R2(config-router-af)#topology base
R2(config-router-af-topology)#no redistribute rip cisco
R3:
R3(config)#router ospfv3 110
R3(config-router)#address-family ipv6 unicast
R3(config-router-af)#no redistribute rip cisco
AUTO-tunnel做法:
做tunnel只需要指定tunnel source就ok,不用指定tunnel destination,tunnel destination由BGP进程决定,使用特殊地址,ipv4兼容性地址来完成邻居建立,进行邻居建立时tunnel能联动BGP,判断tunnel与谁进行邻居建立。
R2:
R2:
R2(config)#interface tunnel 23
R2(config-if)#tunnel source 2.2.2.2
R2(config-if)#tunnel mode ipv6ip auto-tunnel
R2(config-if)#ipv6 address ::2.2.2.2/64
R2(config-if)#ipv6 enable
R3:
R3(config)#interface tunnel 23
R3(config-if)#tunnel source 3.3.3.3
R3(config-if)#tunnel mode ipv6ip auto-tunnel
R3(config-if)#ipv6 enable
R2:
R2(config)#router bgp 23
R2(config-router)#no synchronization
R2(config-router)#no auto-summary
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#no bgp default ipv4-unicast
R2(config-router)#neighbor ::3.3.3.3 remote-as 23
R2(config-router)#address-family ipv6 unicast
R2(config-router-af)#neighbor ::3.3.3.3 activate
R3:
R3(config)#router bgp 23
R3(config-router)#no auto-summary
R3(config-router)#no synchronization
R3(config-router)#bgp router-id 3.3.3.3
R3(config-router)#no bgp default ipv4-unicast
R3(config-router)#neighbor ::2.2.2.2 remote-as 23
R3(config-router)#address-family ipv6 unicast
R3(config-router-af)#neighbor ::2.2.2.2 ativate
邻居建立了,::3.3.3.3对应的是ipv4兼容性,被请求地址,指这个地址为neighbor时就是传达给tunnel,告诉tunnel请你完成跟3.3.3.3的建立,建立完后::3.3.3.3就是对端tunnel所虚拟出来的ipv6地址。
R2:show bgp ipv6 unicast summary
建立好tunnel重分发传路由:
R2:双向重分发
R2(config)#router eigrp CCIE
R2(config-router)#address-family ipv6 unicast autonomous-system 90
R2(config-router-af)#topology base
R2(config-router-af-topology)#redistribute bgp 23 metric 10000 100 255 1 1500
由于bgp没有直连路由所以无法加include-connecteed
R2:
R2(config)#router bgp 23
R2(config-router)#address-family ipv6 unicast
R2(config-router-af)#redistribute eigrp 90 include-connected
R3:
R3(config)#router ospf v3 110
R3(config-router)#address-family ipv6 unicast
R3(config-router-af)#redistribute bgp 23
R3(config)#router bgp 23
R3(config-router)#address-family ipv6 unicast
R3(config-router)#redistribute ospf 110 include-connected
现在路由重分发不进来,原因是BGP的路由重分发进其它协议时默认只有EBGP的路由能进去IGBP进不去
R2:
R2(config)#router bgp 23
R2(config-router)#address-family ipv6 unicast
R2(config-router-af)#bgp redistribute-internal(得敲这个命令,允许把ibgp的路由重分发进其它协议)
R4:show ipv6 route
R5:show ipv6 route
R4:ping 5::5 source 4::4 能通
AUTO-tunnel优点:建立BGP邻居比建立tunnel简单,灵活度比overly-tunnel强一丢丢,地址消耗少一点。
AUTO-tunnel缺点:1、场点大了配置量也就大了 2、场点多建好邻居后交互的路由条目数量也会越来越多。
6-to4 tunnel:
真正意义上实现自动tunnel,依赖地址设计来实现自动tunnel,地址前十六位必须是2002开头,接下来32位就是直接把你边界的tunnel source 的ip地址转换为“:”分十六进制填充到后32位,做完后,每个边界指一条静态tunnel出去就OK了,静态:ipv6 route 2002::/16 tunnel xx。
让路由器收到从内到外的ipv6报文,我不管你去哪个园区,反正你数据包的三层目的ip地址它的32位的值一定是你去往目的园区的tunnel source,只要用这样封装,那这个包就能到达目的地。
R2:
R2(config)# no interface tunnel 23
R2(config)#no router bgp 23
R3:
R3(config)#no interface tunnel 23
R3(config)#no router bgp 23
R2:
R2(config)#router eigrp CCIE
R2(config-router)#address-family ipv6 unicast autonomous-system 90
R2(config-router-af)#topology base
R2(config-router-af-topology)#no redistribute bgp 23
R3:
R3(config)#router ospfv3 110
R3(config-router)#address-family ipv6 unicast
R3(config-router-af)#no redistribute bgp 23
auto-tunnel:得重新规划ipv6地址
R2:
进入ethernet 0/0
R2(config-if)# no ipv6 address(在ipv4中可以写一个新的来覆盖,在ipv6中必须no,因为ipv6允许你一个接口有任意多个ip地址)
R2的tunnel-source为2.2.2.2,内网的所以地址为:2002:202:202,R4使用4网络
R2(config-if)#ipv6 address 2002:202:202:24::2/64
两端ipv6地址不在同一子网段也能建立邻居,验证了ipv6eigrp是基于链路建立邻居。
R4:
进入Ethernet 0/1
R4(config-if)#no ipv6 address
R4(config-if)#ipv6 address 2002:202:202:24::4/64
进入loopback 0口:
R4(config-if)#no ipv6 address
R4(config-if)#ipv6 address 2002:202:202:4::4/64
R2:show ipv6 route 这个时候R4的路由R2能收到
R3:
进入Ethernet 0/1
R3(config-if)#no ipv6 address
R3(config-if)#ipv6 address 2002:303:303:35::3/64
R3(config-if)#ospfv3 110 ipv6 area 0
R5:
进入Ethernet 0/0
R5(config-if)#no ipv6 address
R5(config-if)#ipv6 address 2002:303:303:35::5/64
R5(config-if)#ospfv3 110 ipv6 area 0
进入loopback 0
R5(config-if)#no ipv6 address
R5(config-if)#ipv6 address 2002:303:303:5::5/64
R5(config-if)#ospfv3 110 ipv6 area 0
等待R5和R3建立邻居,R3:show ipv6 ospf neighbor
Show ipv6 route
R2:
进入tunnel 23
R2(config-if)#tunnel source 2.2.2.2
R2(config-if)#tunnel mode ipv6ip 6to4
R2(config-if)#ipv6 enable
写静态:
R2(config)#ipv6 route 2002::/16 tunnel 23(必须/16,不用写下一跳)
Show ipv6 route
我有让R4也得有,重分发给R4
R2(config)#router eigrp CCIE
R2(config-router)#address-family ipv6 unicast autonomous-system 90
R2(config-router-af)#topology base
R2(config-router-af-toplogy)#redistribute static
R3:
进入tunnel 23
R3(config-if)#tunnel source 3.3.3.3
R3(config-if)#tunnel mode ipv6ip 6to4
R3(config-if)#ipv6 enable
写静态:
R3(config)#ipv6 route 2002::/16 tunnel 23
R3(config)#router ospfv3 110
R3(config0-router)#address-family ipv6 unicast
R3(config0-router-af)#redistribute static
R4:show ipv6 route 多了一条2002::/64的路由,这条路由可以访问其它园区了,R5也有
R4:ping 2002:303:303:5::5 source loopback 0可以通,我在ping 2002:303:303:5::5时这个地址放在三层报头的目的ipv6字段,边界R2收到报文之后,查看303:303这个字段,提取出3.3.3.3,这个3.3.3.3就是对方的边界路由器的tunnel-source,我自动跟它完成tunnel建立,就可以把包发走。(自动完成tunnel建立就是把我的外层ipv4报头的目的地址确定,源地址2.2.2.2,目的地址3.3.3.3,目的地址设定为3.3.3.3肯定能发给R3,只要R3能收到解封装了,就能到达真正的目的地。)
最后一个ISATAP tunnel没法演示,因为这个是pc到路由器建立tun nel。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/bian-cheng-ri-ji/22634.html