MPLS
- 标签位
- exp
- s 位
- TTL
角色
- LSR (运行 MPLS 的路由器)
- LER (边缘路由器) : 必须含有 FEC 对应的路由
- Ingress (入节点)
- Egress (出节点)
- Core LSR (核心 LSR)
FEC 转发等价类
到达同一目标地址的所有报文
LSP
标签交换路径
- egress 出口
- ingress 入口
- transit 中转
- 静态 LSP
- 动态 LSP
- LDP
- MP-BGP
- Hello
- LDP Initialization
- KeepALive
- Label Mapping
- Address
- Notification
LDP
- Hello 发现邻居 (UDP)
- 建立会话
- TCP 三次握手
- 确认 LDP 参数一致
- 版本:1
- 分发标签模式:DU/DoD (华为默认 DU)
- KeepAlive (默认 45s,周期 15s)
- 标签空间:接口空间/全局空间 (默认全局空间)
- 周期性发送 Keepalive
- 分发标签
- 通过 Laber Mapping 传递 FEC 信息和标签的映射关系
- 通过 Address 信息传递地址信息,用于 LSP 转发表中的下一跳 (开启 LDP 功能接口的地址)
- 获得标签
- DU (默认)
- DoD
- Independent
- Ordered (默认)
- Liberal (默认)
- Conservative
PHP (倒数第二跳弹出)
特殊标签值
标签值 | 说明 |
---|---|
3 | 不带标签 |
MPLS VPN
角色
- CE (Customer Edge) 用户网络边缘设备
- PE (Provider Edge) 运营商边界设备
- P (Provider) 运营商骨干设备
MP-BGP
与 BGP 相比,能携带更多的属性
工作步骤
- CE 和 PE 之间的路由传递
- PE 将 CE 的路由,注入 MP-BGP 路由表
- 公网标签分配
- CE 的路由注入对端 PE 的 VRF
- 业务数据转发
RD (Route Distinguisher)
在数据包中的 nlri 位置,来自不同 VPN 实例的路由条目,RD 不同
RT (Route Target)
在数据包中属性的位置,用来对路由的传递进行限制,某个 VPN 实例,只能学习某个 RT 值的路由
相关指令
系统视图
指定 LSR ID
# mpls lsr-id id号
mpls lsr-id 1.1.1.1
开启 MPLS 功能
mpls
创建静态 LSP (必须包含下一跳地址用于二层封装转发)
# static-lsp ingress 节点名称 destination 目标地址 掩码 outgoing-interface 接口号 nexthop 下一跳地址 out-label 标签号
static-lsp ingress test destination 2.2.2.2 32 outgoing-interface g0/0/0 nexthop 10.1.1.1 out-label 20
# static-lsp transit 节点名称 incoming-interface 入接口 in-label 入标签 outgoing-interface 出接口 nexthop 下一跳地址 out-label 出标签
static-lsp transit test incoming-interface g0/0/0 in-label 20 outgoing-interface g0/0/1 nexthop 10.1.1.2 out-label 30
# static-lsp egress 节点名称 incoming-interface 入接口 in-label 入标签
static-lsp egress test incoming-interface g0/0/0 in-label 30
查看 LSP
display mpls lsp
display mpls lsp verbose
开启 MPLS-LDP 功能
mpls ldp
创建 VPN 实例
# ip vpn-instance 实例名
ip vpn-instance test
查看 VPN 实例详情
display ip vpn-instance verbose
查看 VPN 实例路由表
# display ip routing-table vpn-instance 实例名
display ip routing-table vpn-instance test
通过实例 Ping 目标地址
# ping -vpn-instance 实例名 地址
ping -vpn-instance test 1.1.1.1
查看 MP-BGP 邻居信息
display bgp vpnv4 all peer
接口视图
接口开启 MPLS 功能
mpls
接口开启 MPLS-LDP 功能
mpls ldp
接口绑定 VPN 实例
# ip binding vpn-instance 实例名
ip binding vpn-instance test
MPLS 视图
VPN 实例视图
指定实例的 RD
# route-distinguisher RD标记
route-distinguisher 1:1
VPN af 视图
指定实例的 RT
# vpn-target RT标记 [both|export-extcommmunity|import-extcommmunity]
vpn-target 10:1
BGP 视图
进入 VPNv4 地址族
ipv4-family vpnv4
进入 VPN 实例的 BGP 视图
# ipv4-family vpn-instance 实例名
ipv4-family vpn-instance test
VPNv4 地址族视图
使能 MP-BGP
peer 1.1.1.1 enable
VPN 实例的 BGP 视图
建立对等体
# peer 对等体地址 as AS编号
peer 1.1.1.1 as 100
- 本文链接:https://gentrabbit.moe/2021/12/28/HCIP-DATACOM-note14/
- 版权声明:本博客所有文章除特别声明外,均默认采用 许可协议。