zl程序教程

您现在的位置是:首页 >  大数据

当前栏目

锐捷MPLS隧道单域实验配置

配置 实验 隧道 锐捷 MPLS
2023-09-14 09:15:39 时间

目录

配置AS100内的IGP路由协议

配置AS内的LDP

配置PE-PE的MP-BGP协议

在PE侧配置PE-CE的路由协议

在CE侧配置PE-CE的路由协议

将CE的路由重发布进MP-BGP中

将MP-BGP的路由重发布进CE中


MPLS隧道——单域基础理论讲解_静下心来敲木鱼的博客-CSDN博客_mpls隧道https://blog.csdn.net/m0_49864110/article/details/127409932?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166927301916782425123770%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166927301916782425123770&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-3-127409932-null-null.nonecase&utm_term=MPLS&spm=1018.2226.3001.4450

本次实验站点4的路由没有学习到(即1其它站点没有学习到44.44.44.44的路由),故关于站点4的配置仅作参考


配置AS100内的IGP路由协议

底层IGP路由互通,为建立Vpnv4的BGP邻居做准备(此处IGP为ISIS)

PE1-3为蓝色配置,P1-4为绿色配置,PE1-5为紫色配置

配置接口IP地址

int g0/1

no switchport

ip add 1.0.34.3 24

int loop 0

ip add 3.3.3.3 32

int g0/1

no switchport

ip add 1.0.34.4 24

int g0/2

no switchport

ip add 1.0.45.4 24

int loop 0

ip add 4.4.4.4 32

int g0/2

no switchport

ip add 1.0.45.5 24

int loop 0

ip add 5.5.5.5 32

配置ISIS路由协议

router isis 1

net 49.0001.0000.0000.0003.00

int g0/1

ip router isis 1

int loop 0

ip router isis 1

router isis 1

net 49.0001.0000.0000.0004.00

int g0/1

ip router isis 1

int g0/2

ip router isis 1

int loop 0

ip router isis 1

router isis 1

net 49.0001.0000.0000.0005.00

int g0/2

ip router isis 1

int loop 0

ip router isis 1

配置完成,在设备上查看路由信息  Show IP route


配置AS内的LDP

PE1-3为蓝色配置,P1-4为绿色配置,PE1-5为紫色配置,黑色为共有配置

mpls ip

mpls router ldp

 ldp router-id interface loop 0 force

int g0/1

int g0/1

int g0/2

int g0/2

 label-switching

 mpls ip

LDP相关命令介绍

mpls ip

全局开启MPLS转发功能

mpls router ldp

全局开启LDP标签转发协议   

[mpls roter ldp下]ldp router-id interface loop 0 force

配置LDP的Router-id为Loop 0 的接口(Force强制属性表示立即生效)

[接口下]label-switching  

开启接口的标签转发能力(缺省三层接口只能识别IP数据包,无法识别MPLS数据包)

[接口下]mpls ip 

接口下开启LDP协议

查看本端的LDP参数(建立LDP邻居两端的参数要一致) Show mpls ldp parameters

查看MPLS转发表 Show mpls forwarding-table


配置PE-PE的MP-BGP协议

通过MP-BGP协议建立Vpnv4路由,传递Vpnv4路由到对端

PE1-3为蓝色配置, PE1-5为紫色配置,黑色为共有配置

启用BGP进程

router bgp 100

建立Vpnv4邻居(此处PE之间建立Vpnv4 IBGP邻居)

bgp router-id 3.3.3.3

neighbor 5.5.5.5 remote-as 100

neighbor 5.5.5.5 update-source loop 0

address-family vpnv4 unicast        在Vpnv4地址簇下激活Vpnv4邻居关系(向邻居发送路由携带团体属性—RT值)

 neighbor 5.5.5.5 activate

 neighbor 5.5.5.5 send-community extended

address-family ipv4 unicast          在IPv4地址簇下将普通的BGP关系删除

  no neighbor 5.5.5.5 activate

bgp router-id 5.5.5.5

neighbor 3.3.3.3 remote-as 100

neighbor 3.3.3.3 update-source loop 0

address-family vpnv4 unicast

 neighbor 3.3.3.3 activate

 neighbor 3.3.3.3 send-community extended

address-family ipv4 unicast

  no neighbor 3.3.3.3 activate

查看Vpnv4邻居状态 Show bgp vpnv4 unicast all summary


在PE侧配置PE-CE的路由协议

PE1-3为蓝色配置, PE1-5为紫色配置

创建VRF实例

ip vrf VPN-1

 rd 100:1              标识实例

 route-target both 1:1   在路由的接收与发布时使用

ip vrf VPN-2

 rd 200:1

 route-target both 1:1

ip vrf VPN-3

 rd 300:1

 route-target both 1:1

ip vrf VPN-4

 rd 400:1

  route-target both 1:1

查看VRF实例信息 show ip vrf detail

接口绑定VRF实例

int g0/0

ip vrf forwarding VPN-1(接口绑定实例后,配置的IP地址会消失,需要重配地址)

ip add 2.0.13.3 24

int g0/2

ip vrf forwarding VPN-2

ip add 2.0.23.3 24

int g0/0

ip vrf forwarding VPN-3

ip add 2.0.35.5 24

int g0/1

ip vrf forwarding VPN-4

ip add 2.0.45.5 24

配置PE与CE对接的路由协议(需要绑定实例)

PE1-3与CE1对接使用OSPF路由方式,路由协议绑定实例VPN-1,并将接口宣告

route ospf 1 vrf VPN-1

area 0

network 2.0.13.3 0.0.0.0 area 0

PE1-3与CE2对接使用ISIS路由方式,路由协议绑定实例VPN-2,并将接口宣告

router isis 2                    

vrf VPN-2

net 49.0002.0000.0000.0022.00

int g0/2

ip router isis 2

PE1-5与CE3对接使用EBGP路由方式

router bgp 100

address-family ipv4 vrf VPN-3   进入IPv4的VPN-3实例视图下与CE3建立邻居

neighbor 2.0.35.3 remote-as 300

neighbor 2.0.35.3 activate

PE1-5与CE4对接使用静态路由方式

ip route vrf VPN-4 44.44.44.44 0.0.0.0 2.0.45.4  配置静态路由绑定VPN-4实例

查看BGP实例邻居信息 show ip bgp vrf VPN-3 summary


在CE侧配置PE-CE的路由协议

CE1(OSPF)配置

router ospf 1

area 0

network 11.11.11.11 0.0.0.0 area 0

network 2.0.13.1 0.0.0.0 area 0

CE2(ISIS)配置

router isis 2

net 49.0002.0000.0000.0011.00

int g0/2

ip router isis 2

int loop 0

ip router isis 2

CE3(BGP)配置

router bgp 300

neighbor 2.0.35.5 remote-as 100

CE4(静态路由)配置

ip route 0.0.0.0 0.0.0.0 2.0.45.5


将CE的路由重发布进MP-BGP中

将IP路由转为Vpnv4路由,在MP-BGP邻居上传输(收到邻居发来的Vpnv4路由会村粗在相应实例的BGP路由表项中,然后BBGP表项中最优路由加入到IP实例表项中)

PE1-3为蓝色配置, PE1-5为紫色配置

router bgp 100

address-family ipv4 vrf VPN-1

redistribute ospf 1 match internal external 

由于OSPF绑定的实例VPN-1,所以在VPN-1中将OSPF引入到BGP中

address-family ipv4 vrf VPN-2    

redistribute isis 2 level-1-2     将L1和L2的路由都引入

由于ISIS绑定的实例VPN-1,所以在VPN-2中将ISIS 2引入到BGP中

router bgp 100

address-family ipv4 vrf VPN-3

实例VPN-3建立EBGP路由,不需要再引入BGP路由

只需要CE端宣告路由,本端就可以获取

address-family ipv4 vrf VPN-4

redistribute static

由于静态绑定的实例VPN-4,所以在VPN-4中将OSPF引入到BGP中

查看BGP实例中的路由 show ip bgp vrf VPN-1

查看BGP实例中的路由 show ip route vrf VPN-1


将MP-BGP的路由重发布进CE中

使得站点之间可以互相学习到路由

PE1-3上配置

将bgp路由引入到OSPF实例中,传递给CE1

router ospf 1 vrf VPN-1

  redistribute bgp subnets

将bgp路由引入到ISIS实例中,传递给CE2

router isis 2

  redistribute bgp

PE1-5不需要做额外配置

静态端和EBGP端都不需要做额外配置

MPLS隧道——单域基础理论讲解_静下心来敲木鱼的博客-CSDN博客icon-default.png?t=MBR7https://blog.csdn.net/m0_49864110/article/details/127409932?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167379205816800211545341%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=167379205816800211545341&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-3-127409932-null-null.blog_rank_default&utm_term=mpls&spm=1018.2226.3001.4450