SR-MPLS BE简单配置实例原理

pe1

pe1\]dis current-configuration ip vpn-instance vpn ipv4-family route-distinguisher 100:100 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity mpls lsr-id 2.2.2.2 mpls segment-routing //开启sr功能 interface Ethernet1/0/0 undo shutdown ip address 10.0.23.2 255.255.255.0 undo dcn undo dcn mode vlan interface Ethernet1/0/1 undo shutdown ip binding vpn-instance vpn ip address 172.16.0.1 255.255.255.0 undo dcn undo dcn mode vlan interface LoopBack0 ip address 2.2.2.2 255.255.255.255 ospf prefix-sid index 100 //node sid全局唯一 bgp 100 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack0 ipv4-family unicast undo synchronization peer 3.3.3.3 enable ipv4-family vpnv4 policy vpn-target peer 3.3.3.3 enable ipv4-family vpn-instance vpn peer 172.16.0.2 as-number 65001 ospf 1 opaque-capability enable //启用10类扩展路由 segment-routing mpls //用mpls方式分配标签 segment-routing global-block 16000 23999 //设置SRGB范围,建议都配置相同范围 area 0.0.0.0 network 0.0.0.0 255.255.255.255 ### p \[p\]dis current-configuration mpls lsr-id 3.3.3.3 mpls segment-routing interface Ethernet1/0/0 undo shutdown ip address 10.0.23.3 255.255.255.0 undo dcn undo dcn mode vlan interface Ethernet1/0/1 undo shutdown ip address 10.0.34.3 255.255.255.0 undo dcn undo dcn mode vlan interface LoopBack0 ip address 3.3.3.3 255.255.255.255 ospf prefix-sid index 200 interface NULL0 bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack0 peer 4.4.4.4 as-number 100 peer 4.4.4.4 connect-interface LoopBack0 ipv4-family unicast undo synchronization peer 2.2.2.2 enable peer 4.4.4.4 enable ipv4-family vpnv4 undo policy vpn-target peer 2.2.2.2 enable peer 2.2.2.2 reflect-client peer 4.4.4.4 enable peer 4.4.4.4 reflect-client ospf 1 opaque-capability enable segment-routing mpls segment-routing global-block 16000 23999 area 0.0.0.0 network 0.0.0.0 255.255.255.255 ### pe2 \[pe2\]dis current-configuration ip vpn-instance vpn ipv4-family route-distinguisher 100:200 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity mpls lsr-id 4.4.4.4 mpls segment-routing interface Ethernet1/0/0 undo shutdown ip binding vpn-instance vpn ip address 192.168.0.1 255.255.255.0 undo dcn undo dcn mode vlan interface Ethernet1/0/1 undo shutdown ip address 10.0.34.4 255.255.255.0 undo dcn undo dcn mode vlan interface LoopBack0 ip address 4.4.4.4 255.255.255.255 ospf prefix-sid index 300 interface NULL0 bgp 100 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack0 ipv4-family unicast undo synchronization peer 3.3.3.3 enable ipv4-family vpnv4 policy vpn-target peer 3.3.3.3 enable ipv4-family vpn-instance vpn peer 192.168.0.2 as-number 65002 ospf 1 opaque-capability enable segment-routing mpls segment-routing global-block 16000 23999 area 0.0.0.0 network 0.0.0.0 255.255.255.255 如果路ldp又跑sr-mpls be,默认走ldp隧道,让其优先走sr-mpls be隧道,要用策略引: tunnel-policy p1 //先定义策略 tunnel select-seq sr-lsp load-balance-number 2 ip vpn-instance vpn //在vpn实例中引用 ipv4-family tnl-policy p1 调用策略 ### 查看 \[pe1\]dis segment-routing prefix mpls forwarding //查看标签等信息 \[pe1\]dis tunnel-info all //查看隧道 \[pe1\]dis ospf lsdb //查看10类lsa pe1接口上捉包:48120是mp-bgp的私网标签,和mpls里面那个区别vpn-instance一样 ![在这里插入图片描述](https://file.jishuzhan.net/article/1782614041164779521/63f9462c4352f99476755ed096546b53.webp)

相关推荐
二进制person1 小时前
JavaEE初阶 --网络编程
linux·服务器·网络
加农炮手Jinx2 小时前
Flutter for OpenHarmony:postgrest 直接访问 PostgreSQL 数据库的 RESTful 客户端(Supabase 核心驱动) 深度解析与鸿蒙适配指南
数据库·flutter·华为·postgresql·restful·harmonyos·鸿蒙
钛态2 小时前
Flutter 三方库 http_mock_adapter — 赋能鸿蒙应用开发的高效率网络接口 Mock 与自动化测试注入引擎(适配鸿蒙 HarmonyOS Next ohos)
android·网络协议·flutter·http·华为·中间件·harmonyos
Oll Correct2 小时前
实验八:验证以太网交换机的生成树协议STP
网络·笔记
左手厨刀右手茼蒿2 小时前
Flutter for OpenHarmony: Flutter 三方库 shamsi_date 助力鸿蒙应用精准适配波斯历法(中东出海必备)
android·flutter·ui·华为·自动化·harmonyos
Irissgwe2 小时前
进程间通信
linux·服务器·网络·c++·进程间通信
IT小白34 小时前
windows的VMware虚拟机上的Linux系统(CentOS)配置永久ip(关机重启ip不变)
网络·网络协议·tcp/ip
includei4 小时前
【JavaScript】华为机试_HJ20_密码验证合格程序
开发语言·javascript·华为
喵叔哟4 小时前
29_内容生产质量网关Skill:草稿生成+事实校验+发布前检查
网络·人工智能
liulilittle5 小时前
LINUX RING BUFFER TUN/TAP 1
linux·服务器·网络·c++·信息与通信·通信