拓扑图
配置
配置IP地址
配置VRF
配置ISIS
配置MPLS
配置MP-BGP,注意在ASBR上关闭RT过滤(或配置IRT),如果关闭RT过滤,可不配置VPN-Instance,ASBR互联接口开启MPLS
查看ASBR间的标签交换,需要mpls下配置undo ttl expiration pop
ttl expiration pop命令用来配置MPLS TTL超时后ICMP响应报文沿本地IP路由转发。
undo ttl expiration pop命令用来取消此功能,即ICMP响应报文沿LSP返回。
缺省情况下,对于一层标签的MPLS TTL超时报文,将根据本地IP路由返回ICMP报文。
应用场景
在MPLS网络中,当LSR收到TTL为1的含有标签的MPLS报文时,LSR生成ICMP的TTL超时消息。
LSR将TTL超时消息回应给报文发送者的方式有两种:
- 如果LSR上存在到达报文发送者的路由,则可以通过IP路由,直接向发送者回应TTL超时消息。
- 如果LSR上不存在到达报文发送者的路由,则ICMP响应报文将按照LSP继续传送,到达LSP出节点后,由Egress节点将该消息返回给发送者。
通常情况下,收到的MPLS报文只带一层标签时,LSR可以采用第一种方式回应TTL超时消息;收到的MPLS报文包含多层标签时,LSR采用第二种方式回应TTL超时消息。
但是,在MPLS VPN中,ASBR(Autonomous System Boundary Router,自治系统边界路由器)、HoVPN组网应用中的SPE(Superstratum PE or Service Provider-end PE,上层PE或运营商侧PE),接收到的承载VPN报文的MPLS报文可能只有一层标签,此时,这些设备上并不存在到达报文发送者的路由,则采用第二种方法回应TTL超时消息。
sysname AR1
#
ip vpn-instance BJ
ipv4-family
route-distinguisher 100:1
vpn-target 100:1 export-extcommunity
vpn-target 200:6 import-extcommunity
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0001.00
#
interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding vpn-instance BJ
ip address 10.0.1.254 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
isis enable 1
#
bgp 100
undo default ipv4-unicast
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
undo peer 3.3.3.3 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.3 enable
#
ipv4-family vpn-instance BJ
network 10.0.1.0 255.255.255.0
#
sysname AR2
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0002.00
#
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 23.1.1.2 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
isis enable 1
#
sysname AR3
#
mpls lsr-id 3.3.3.3
mpls
undo ttl expiration pop
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0003.00
#
interface GigabitEthernet0/0/0
ip address 23.1.1.3 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 34.1.1.3 255.255.255.0
mpls
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
isis enable 1
#
bgp 100
undo default ipv4-unicast
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
peer 34.1.1.4 as-number 200
#
ipv4-family vpnv4
undo policy vpn-target
peer 1.1.1.1 enable
peer 34.1.1.4 enable
#
sysname AR4
#
ip vpn-instance SH
ipv4-family
route-distinguisher 100:4
vpn-target 200:6 100:1 import-extcommunity
#
mpls lsr-id 4.4.4.4
mpls
undo ttl expiration pop
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0004.00
#
interface GigabitEthernet0/0/0
ip address 34.1.1.4 255.255.255.0
mpls
#
interface GigabitEthernet0/0/1
ip address 45.1.1.4 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
isis enable 1
#
bgp 200
undo default ipv4-unicast
peer 6.6.6.6 as-number 200
peer 6.6.6.6 connect-interface LoopBack0
peer 34.1.1.3 as-number 100
#
ipv4-family vpnv4
policy vpn-target
peer 6.6.6.6 enable
peer 34.1.1.3 enable
#
sysname AR5
#
mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0005.00
#
interface GigabitEthernet0/0/0
ip address 45.1.1.5 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 56.1.1.5 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
isis enable 1
#
sysname AR6
#
ip vpn-instance SH
ipv4-family
route-distinguisher 200:6
vpn-target 200:6 export-extcommunity
vpn-target 100:1 import-extcommunity
#
mpls lsr-id 6.6.6.6
mpls
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0006.00
#
interface GigabitEthernet0/0/0
ip address 56.1.1.6 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding vpn-instance SH
ip address 10.0.2.254 255.255.255.0
#
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
isis enable 1
#
bgp 200
undo default ipv4-unicast
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack0
#
ipv4-family vpnv4
policy vpn-target
peer 4.4.4.4 enable
#
ipv4-family vpn-instance SH
network 10.0.2.0 255.255.255.0
#
查看BGP邻居关系
查看BGP路由
测试PC1访问PC2,查看路径(需要mpls下配置undo ttl expiration pop)
AR1上查看标签交换路径
VPNv4标签分配
MPLS标签分配