【思科】IPv6 过渡技术 - MPLS(6PE)隧道

在这里插入图片描述

实验要求

实验环境 : EVE

实验需求:
实现双方站点的IPv6网络通过MPLS的6PE模式 可以跨 IPv4 网络进行通信

实现思路

① IPv6网络用OSPFv3来实现互通
② IPv4网络用OSPF来实现互通
③ R2和R4建立了BGP的IPv6邻居,用来传递路由信息
④ 使用MPLS 标签,给路由信息打上标签值,进行传输通信

注意点

① OSPFv3 只能通过接口下宣告,不能使用Network!!!
② MP-BGP是用IPv4地址来建立IPv6邻居,BGP是可以实现这一功能
③ MPLS 6PE,是没有VPNv6的流量,默认是不会发标签,所以需要我们去开启BGP中向邻居发送标签功能,因为的MP-BGP是传递IPv6的路由,IPv6不会自动分发标签。
④ VPNv6 = RD + IPv6 :在MPLS 的6VPE中有体现,感兴趣的可以去看看这篇文章

配置

在这里插入图片描述

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::2                        ## 全局单播地址 → manual
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

R2(config)#int loo0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
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

MP-BGP

## 目的: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)#network 2.2.2.2 0.0.0.0 area 0
R2(config-router)#exit
===================== IPv4 网络实现可达 ==============================
R2(config)#do ping 172.16.34.4 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.34.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
====================================================================

## MP-BGP配置
## 用IPv4地址,来建立IPv6的邻居
## 做双向重分发,让IPv6的路由从BGP传递
R2(config)#router bgp 1
R2(config-router)#neighbor 4.4.4.4 remote-as 1         ## 邻居4.4.4.4 在AS 1中(IBGP邻居)
R2(config-router)#neighbor 4.4.4.4 update-source loopback 0     ## 需要指定更新源为loopback 0
R2(config-router)#address-family ipv6                  ## 需要在IPv6 地址族
R2(config-router-af)#neighbor 4.4.4.4 activate         ## 激活4.4.4.4 的IPv6邻居
R2(config-router-af)#redistribute ospf 1               ## 重分布的话,不考虑OSPF版本(思科)
R2(config-router-af)#exit
R2(config-router)#exit

R2(config)#router ospfv3 1
R2(config-router)#address-family ipv6                 ## 进入IPv6地址族
R2(config-router-af)#redistribute bgp 1               ## 将BGP收到的路由重分发进OSPF中
R2(config-router-af)#exit
R2(config-router)#exit


MPLS

R2(config)#mpls label protocol ldp            ## 选用LDP协议
R2(config)#mpls ldp router-id loopback 0      ## 配置LDP的RID
R2(config)#mpls ip                            ## 打开MPLS 功能

R2(config)#int e0/1          
R2(config-if)#mpls ip                         ## 进入接口,启用MPLS功能
R2(config-if)#exit

R2(config)#router bgp 1
R2(config-router)#address-family ipv6
R2(config-router-af)#neighbor 4.4.4.4 send-label    ## 因为是IPv6流量,需要开启发送标签功能
R2(config-router-af)#exit
R2(config-router)#exit

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)#int loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
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)#network 3.3.3.3 0.0.0.0 area 0
R3(config-router)#exit

MPLS

R3(config)#mpls label protocol ldp            ## 选用LDP协议
R3(config)#mpls ldp router-id loopback 0      ## 配置LDP的RID
R3(config)#mpls ip                            ## 打开MPLS 功能

R3(config)#int range e0/0-1
R3(config-if-range)#mpls ip                   ## 进入接口,启用MPLS 功能
R3(config-if-range)#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

R4(config)#int loopback 0
R4(config-if)#ip address 4.4.4.4 255.255.255.255
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

MP-BGP

## 目的: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)#network 4.4.4.4 0.0.0.0 area 0
R4(config-router)#exit

R4(config)#router bgp 1
R4(config-router)#neighbor 2.2.2.2 remote-as 1
R4(config-router)#neighbor 2.2.2.2 update-source loopback 0
R4(config-router)#address-family ipv6
R4(config-router-af)#neighbor 2.2.2.2 activate
R4(config-router-af)#redistribute ospf 1
R4(config-router-af)#exit
R4(config-router)#exit

R4(config)#router ospfv3 1
R4(config-router)#address-family ipv6
R4(config-router-af)#redistribute bgp 1   
R4(config-router-af)#exit
R4(config-router)#exit

MPLS

R4(config)#mpls label protocol ldp            ## 选用LDP协议
R4(config)#mpls ldp router-id loopback 0      ## 配置LDP的RID
R4(config)#mpls ip                            ## 打开MPLS 功能

R4(config)#int e0/0
R4(config-if)#mpls ip                         ## 接口下启用 MPLS 功能
R4(config-if)#exit

R4(config)#router bgp 1
R4(config-router)#address-family ipv6
R4(config-router-af)#neighbor 2.2.2.2 send-label    ## 因为是IPv6流量,需要开启发送标签功能
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的MPLS 转发表

在这里插入图片描述

R4的MPLS 转发表

在这里插入图片描述

R1 的路由表

在这里插入图片描述

R5 的路由表

在这里插入图片描述

R1 Ping R5

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

抓包分析

抓的是 R2的e0/1口
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

配置文档

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
!
mpls label protocol ldp
!
mpls ip
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
 ip ospf 110 area 0
!
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
 mpls ip  
!
router ospfv3 1
 address-family ipv6 unicast
  redistribute bgp 1
  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
!
router bgp 1
 neighbor 4.4.4.4 remote-as 1
 neighbor 4.4.4.4 update-source Loopback0
 !
 address-family ipv6
  redistribute ospf 1
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 send-label
!
mpls ldp router-id Loopback0

R3

!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
 ip ospf 110 area 0
!
interface Ethernet0/0
 ip address 172.16.23.3 255.255.255.0 
 no shutdown
 mpls ip
!
interface Ethernet0/1
 ip address 172.16.34.3 255.255.255.0
 no shutdown
 mpls ip
!
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 Loopback0
 ip address 4.4.4.4 255.255.255.255
 ip ospf 110 area 0
!
interface Ethernet0/0
 no shutdown
 ip address 172.16.34.4 255.255.255.0
 mpls ip
!
interface Ethernet0/1 
 no shutdown
 ipv6 address 2001:45::4/64
 ospfv3 1 ipv6 area 0
!
router ospfv3 1
 !
 address-family ipv6 unicast
  redistribute bgp 1
  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
!
router bgp 1
 neighbor 2.2.2.2 remote-as 1
 neighbor 2.2.2.2 update-source Loopback0
 !
 address-family ipv6
  redistribute ospf 1
  neighbor 2.2.2.2 activate
  neighbor 2.2.2.2 send-label
 exit-address-family

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

张白夕

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

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

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

打赏作者

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

抵扣说明:

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

余额充值