客户计划采用基于LDP方式的MPLS L2VPN连接两个分支站点,公网隧道要求采用MPLS TE技术实现;
如图所示,PE1与PE2之间链路采用MPLS TE建立动态隧道,之后PE1与PE2建立PW,实现CE1与CE2的二层互通;
PE1:
#
sysname PE1
#
//创建OSPF进程1,并在相应区域中使能MPLS TE能力
ospf 1
area 0.0.0.0
mpls te enable
#
//配置LSR-ID为loopback0地址
mpls lsr-id 1.1.1.1
#
//使能MPLS LDP / MPLS TE / RSVP
mpls ldp
#
mpls te
#
rsvp
#
//创建隧道测试te1 优先选择cr-lsp隧道,负载分担数为1
tunnel-policy te1
select-seq cr-lsp load-balance-number 1
#
//使能MPLS L2VPN
l2vpn enable
#
//配置pw模板,配置pw封装类型为eth
pw-class test
pw-type ethernet
#
//配置Loopback0并将其宣告到OSPF 1 area 0中
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf 1 area 0.0.0.0
#
interface GigabitEthernet0/0
port link-mode route
combo enable copper
#
//配置公网接口IP及路由
interface GigabitEthernet0/1
port link-mode route
combo enable copper
ip address 10.0.0.1 255.255.255.252
ospf 1 area 0.0.0.0
//使能MPLS及MPLS TE能力
mpls enable
mpls te enable
//配置用于转发MPLS TE 流量的链路最大带宽
mpls te max-link-bandwidth 100000
//配置链路的最大可预留带宽
mpls te max-reservable-bandwidth 100000
//开启接口的RSVP能力
rsvp enable
#
//创建tunnel接口,隧道模式选择为mpls-te 目的地址为2.2.2.2 mpls te隧道所需的带宽
interface Tunnel0 mode mpls-te
ip address unnumbered interface LoopBack0
mpls te bandwidth ct0 1000
destination 2.2.2.2
#
xconnect-group 1
connection 1
//绑定AC接口
ac interface GigabitEthernet0/0
//配置PW并绑定隧道策略
peer 2.2.2.2 pw-id 12 pw-class test tunnel-policy te1
#
P:
ospf 1
area 0.0.0.0
mpls te enable
#
mpls lsr-id 5.5.5.5
#
mpls te
#
rsvp
#
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
ospf 1 area 0.0.0.0
#
interface GigabitEthernet0/0
port link-mode route
combo enable copper
ip address 10.0.0.2 255.255.255.252
ospf 1 area 0.0.0.0
mpls enable
mpls te enable
mpls te max-link-bandwidth 100000
mpls te max-reservable-bandwidth 100000
rsvp enable
#
interface GigabitEthernet0/1
port link-mode route
combo enable copper
ip address 20.0.0.1 255.255.255.252
ospf 1 area 0.0.0.0
mpls enable
mpls te enable
mpls te max-link-bandwidth 100000
mpls te max-reservable-bandwidth 100000
rsvp enable
PE2:
sysname PE2
#
ospf 1
area 0.0.0.0
mpls te enable
#
mpls lsr-id 2.2.2.2
#
mpls ldp
#
mpls te
#
rsvp
#
tunnel-policy te1
select-seq cr-lsp load-balance-number 1
#
l2vpn enable
#
pw-class test
pw-type ethernet
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
ospf 1 area 0.0.0.0
#
interface GigabitEthernet0/0
port link-mode route
combo enable copper
ip address 20.0.0.2 255.255.255.252
ospf 1 area 0.0.0.0
mpls enable
mpls te enable
mpls te max-link-bandwidth 100000
mpls te max-reservable-bandwidth 100000
rsvp enable
#
interface GigabitEthernet0/1
port link-mode route
combo enable copper
#
interface Tunnel0 mode mpls-te
ip address unnumbered interface LoopBack0
mpls te bandwidth ct0 1000
destination 1.1.1.1
#
xconnect-group 1
connection 1
ac interface GigabitEthernet0/1
peer 1.1.1.1 pw-id 12 pw-class test tunnel-policy te1
#
配置验证:
1. 查看MPLS TE tunnel接口状态为UP
[PE1]display interface Tunnel 0
Tunnel0
Current state: UP
Line protocol state: UP
Description: Tunnel0 Interface
Bandwidth: 64kbps
Maximum Transmit Unit: 1496
Internet Address is 1.1.1.1/32 Unnumbered
Tunnel source unknown, destination 2.2.2.2
Tunnel TTL 255
Tunnel protocol/transport CR_LSP
Output queue - Urgent queuing: Size/Length/Discards 0/100/0
Output queue - Protocol queuing: Size/Length/Discards 0/500/0
Output queue - FIFO queuing: Size/Length/Discards 0/75/0
Last clearing of counters: Never
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
2. 查看MPLS TE 隧道接口信息
[PE1]display mpls te tun
Tunnel Name : Tunnel 0
Tunnel State : Up (Main CRLSP up, Shared-resource CRLSP down)
Tunnel Attributes :
LSP ID : 47137 Tunnel ID : 0
Admin State : Normal
Ingress LSR ID : 1.1.1.1 Egress LSR ID : 2.2.2.2
Signaling : RSVP-TE Static CRLSP Name : -
Resv Style : SE
Tunnel mode : -
Reverse-LSP name : -
Reverse-LSP LSR ID : - Reverse-LSP Tunnel ID: -
Class Type : CT0 Tunnel Bandwidth : 1000 kbps
Reserved Bandwidth : 1000 kbps
Setup Priority : 7 Holding Priority : 7
Affinity Attr/Mask : 0/0
Explicit Path : -
Backup Explicit Path : -
Metric Type : TE
Record Route : Disabled Record Label : Disabled
FRR Flag : Disabled Bandwidth Protection : Disabled
Backup Bandwidth Flag: Disabled Backup Bandwidth Type: -
Backup Bandwidth : -
Bypass Tunnel : No Auto Created : No
Route Pinning : Disabled
Retry Limit : 3 Retry Interval : 2 sec
Reoptimization : Disabled Reoptimization Freq : -
Backup Type : None Backup LSP ID : -
Auto Bandwidth : Disabled Auto Bandwidth Freq : -
Min Bandwidth : - Max Bandwidth : -
Collected Bandwidth : -
3. 查看PW会话状态及转发信息
[PE1]display l2v pw verbose
Xconnect-group Name: 1
Connection Name: 1
Peer: 2.2.2.2 PW ID: 12
Signaling Protocol : LDP
Link ID : 1 PW State : Up
In Label : 917631 Out Label: 917631
MTU : 1500
PW Attributes : Main
VCCV CC : -
VCCV BFD : -
Tunnel Group ID : 0x800000030000000
Tunnel NHLFE IDs : 268435456
[PE1]dis mpls forwarding nhlfe 268435456
Flags: T - Forwarded through a tunnel
N - Forwarded through the outgoing interface to the nexthop IP address
B - Backup forwarding information
A - Active forwarding information
NID Tnl-Type Flag OutLabel Forwarding Info
--------------------------------------------------------------------------------
268435456 TE TA - 1028
[PE1]display mpls lsp
FEC Proto In/Out Label Interface/Out NHLFE
1.1.1.1/32 LDP 3/- -
1.1.1.1/0/47137 RSVP -/1151 GE0/1
2.2.2.2/0/54684 RSVP 3/- -
10.0.0.2 Local -/- GE0/1
Tunnel0 Local -/- NHLFE1028
CE1与CE2互ping测试:
[CE1]ping 100.0.0.1
Ping 100.0.0.1 (100.0.0.1): 56 data bytes, press CTRL_C to break
56 bytes from 100.0.0.1: icmp_seq=0 ttl=255 time=3.000 ms
56 bytes from 100.0.0.1: icmp_seq=1 ttl=255 time=2.000 ms
56 bytes from 100.0.0.1: icmp_seq=2 ttl=255 time=2.000 ms
56 bytes from 100.0.0.1: icmp_seq=3 ttl=255 time=4.000 ms
56 bytes from 100.0.0.1: icmp_seq=4 ttl=255 time=2.000 ms
--- Ping statistics for 100.0.0.1 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 2.000/2.600/4.000/0.800 ms
[CE1]%Mar 16 07:05:18:447 2016 CE1 PING/6/PING_STATISTICS: Ping statistics for 100.0.0.1: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 2.000/2.600/4.000/0.800 ms.
[CE2]ping 100.0.0.2
Ping 100.0.0.2 (100.0.0.2): 56 data bytes, press CTRL_C to break
56 bytes from 100.0.0.2: icmp_seq=0 ttl=255 time=2.505 ms
56 bytes from 100.0.0.2: icmp_seq=1 ttl=255 time=2.243 ms
56 bytes from 100.0.0.2: icmp_seq=2 ttl=255 time=2.738 ms
56 bytes from 100.0.0.2: icmp_seq=3 ttl=255 time=2.520 ms
56 bytes from 100.0.0.2: icmp_seq=4 ttl=255 time=2.037 ms
--- Ping statistics for 100.0.0.2 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 2.037/2.409/2.738/0.243 ms
[CE2]%Mar 16 07:34:10:384 2016 CE2 PING/6/PING_STATISTICS: Ping statistics for 100.0.0.2: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 2.037/2.409/2.738/0.243 ms.
1. OSPF路由宣告既可以现在OSPF进程下也可以在接口下使用OSPF 1 area命令宣告;
2. MPLS 隧道策略默认按照LSP隧道->GRE隧道->CR-LSP隧道的优先级顺序选择隧道,负载分担的隧道数目为1;本例中未配置其他隧道所以可以不用配置隧道策略,如果存在其他隧道,可以按照本例中的配置配置隧道优选策略,,优选CR-LSP,并在 PW中调用;
3. 沿途路径上均需要使能MPLS TE/RSVP等相关配置。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作