配置MPLS DiffServ模式示例
组网需求
CE1、CE3属于VPN-A。
CE2、CE4属于VPN-B。
VPN-A使用的VPN-target属性为111:1,VPN-B为222:2。
不同VPN用户之间不能互相访问。
在PE1上配置MPLS DiffServ模式为Pipe,使VPN中的数据业务在MPLS网络中以运营商配置的优先级转发,同时要求根据报文自身携带的DSCP优先级进行EXP映射。不需要配置特定值。映射关系可根据不同domain,将DSCP做相应的EXP映射。在MPLS网络的出口处不改变报文本身携带的DSCP,仅根据MPLS标签的EXP值进行队列调度。
本例中interface1,interface2,interface3分别代表GE0/1/0,GE0/2/0,GE0/3/0。
配置思路
采用如下的思路配置MPLS DiffServ模式:
骨干网上配置OSPF实现PE之间的互通。
配置MPLS基本功能和MPLS LDP,建立MPLS LSP。
PE之间配置MP-IBGP交换VPN路由信息。
PE上配置VPN实例,并把与CE相连的接口和相应的VPN实例绑定。
CE与PE之间配置EBGP交换VPN路由信息。
在VPN-A和VPN-B分别使能Pipe模式,同时把不同的Differ-serve域应用到不同的VPN实例中。
数据准备
为完成此配置例,需准备如下的数据:
PE及P上的MPLS LSR-ID
VPN-A与VPN-B的路由区分符RD
VPN-A与VPN-B的收发路由属性VPN-Target
PE1和PE2上配置不同的Differ-serve域
操作步骤
- 在MPLS骨干网上配置IGP协议,实现骨干网PE和P的互通
# 配置PE1。
<HUAWEI> system-view
[~HUAWEI] sysname PE1
[*HUAWEI] commit
[~PE1] interface loopback 1
[*PE1-LoopBack1] ip address 1.1.1.9 32
[*PE1-LoopBack1] commit
[~PE1-LoopBack1] quit
[~PE1] interface GigabitEthernet0/3/0
[~PE1-GigabitEthernet0/3/0] ip address 172.21.1.1 24
[*PE1-GigabitEthernet0/3/0] commit
[~PE1-GigabitEthernet0/3/0] quit
[~PE1] ospf
[*PE1-ospf-1] area 0
[*PE1-ospf-1-area-0.0.0.0] network 172.21.1.0 0.0.0.255
[*PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[*PE1-ospf-1-area-0.0.0.0] commit
[~PE1-ospf-1-area-0.0.0.0] quit
[~PE1-ospf-1] quit
# 配置P。
<HUAWEI> system-view
[~HUAWEI] sysname P
[*HUAWEI] commit
[~P] interface loopback 1
[*P-LoopBack1] ip address 2.2.2.9 32
[*P-LoopBack1] commit
[~P-LoopBack1] quit
[~P] interface GigabitEthernet 0/1/0
[~P-GigabitEthernet0/1/0] ip address 172.21.1.2 24
[*P-GigabitEthernet0/1/0] commit
[~P-GigabitEthernet0/1/0] quit
[~P] interface GigabitEthernet 0/2/0
[~P-GigabitEthernet0/2/0] ip address 172.22.1.1 24
[*P-GigabitEthernet0/2/0] commit
[~P-GigabitEthernet0/2/0] quit
[~P] ospf
[*P-ospf-1] area 0
[*P-ospf-1-area-0.0.0.0] network 172.21.1.0 0.0.0.255
[*P-ospf-1-area-0.0.0.0] network 172.22.1.0 0.0.0.255
[*P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[*P-ospf-1-area-0.0.0.0] commit
[~P-ospf-1-area-0.0.0.0] quit
[~P-ospf-1] quit
# 配置PE2。
<HUAWEI> system-view
[~HUAWEI] sysname PE2
[*HUAWEI] commit
[~PE2] interface loopback 1
[*PE2-LoopBack1] ip address 3.3.3.9 32
[*PE2-LoopBack1] commit
[~PE2-LoopBack1] quit
[~PE2] interface GigabitEthernet 0/3/0
[~PE2-GigabitEthernet0/3/0] ip address 172.22.1.2 24
[*PE2-GigabitEthernet0/3/0] commit
[~PE2-GigabitEthernet0/3/0] quit
[~PE2] ospf
[*PE2-ospf-1] area 0
[*PE2-ospf-1-area-0.0.0.0] network 172.22.1.0 0.0.0.255
[*PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[*PE2-ospf-1-area-0.0.0.0] commit
[~PE2-ospf-1-area-0.0.0.0] quit
[~PE2-ospf-1] quit
配置完成后,PE1、P、PE2之间应能建立OSPF邻居关系,执行display ospf peer命令可以看到邻居状态为Full。执行display ip routing-table命令可以看到PE之间学习到对方的Loopback1路由。
以PE1的显示为例:
[~PE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.9/32 Direct 0 0 D 127.0.0.1 InLoopBack0
2.2.2.9/32 OSPF 10 2 D 172.21.1.2 GigabitEthernet0/3/0
3.3.3.9/32 OSPF 10 3 D 172.21.1.2 GigabitEthernet0/3/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.21.1.0/24 Direct 0 0 D 172.21.1.1 GigabitEthernet0/3/0
172.21.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.22.1.0/24 OSPF 10 2 D 172.21.1.2 GigabitEthernet0/3/0
[~PE1] display ospf peer
OSPF Process 1 with Router ID 1.1.1.9
Neighbors
Area 0.0.0.0 interface 172.21.1.1(GigabitEthernet0/3/0)'s neighbors
Router ID: 172.21.1.2 Address: 172.21.1.2
State: Full Mode:Nbr is Master Priority: 1
DR: None BDR: None MTU: 1500
Dead timer due in 38 sec
Neighbor is up for 00:02:44
Authentication Sequence: [ 0 ]
- 在MPLS骨干网上配置MPLS基本能力和MPLS LDP,建立LDP LSP
# 配置PE1。
[~PE1] mpls lsr-id 1.1.1.9
[*PE1] mpls
[*PE1-mpls] commit
[~PE1-mpls] quit
[~PE1] mpls ldp
[*PE1-mpls-ldp] commit
[~PE1-mpls-ldp] quit
[~PE1] interface GigabitEthernet 0/3/0
[~PE1-GigabitEthernet0/3/0] mpls
[*PE1-GigabitEthernet0/3/0] mpls ldp
[*PE1-GigabitEthernet0/3/0] commit
[~PE1-GigabitEthernet0/3/0] quit
# 配置P。
[~P] mpls lsr-id 2.2.2.9
[*P] mpls
[*P-mpls] commit
[~P-mpls] quit
[~P] mpls ldp
[*P-mpls-ldp] commit
[~P-mpls-ldp] quit
[~P] interface GigabitEthernet 0/1/0
[~P-GigabitEthernet0/1/0] mpls
[*P-GigabitEthernet0/1/0] mpls ldp
[*P-GigabitEthernet0/1/0] commit
[~P-GigabitEthernet0/1/0] quit
[~P] interface GigabitEthernet 0/2/0
[~P-GigabitEthernet0/2/0] mpls
[*P-GigabitEthernet0/2/0] mpls ldp
[*P-GigabitEthernet0/2/0] commit
[~P-GigabitEthernet0/2/0] quit
# 配置PE2。
[~PE2] mpls lsr-id 3.3.3.9
[*PE2] mpls
[*PE2-mpls] commit
[~PE2-mpls] quit
[~PE2] mpls ldp
[*PE2-mpls-ldp] commit
[~PE2-mpls-ldp] quit
[~PE2] interface GigabitEthernet 0/3/0
[~PE2-GigabitEthernet0/3/0] mpls
[*PE2-GigabitEthernet0/3/0] mpls ldp
[*PE2-GigabitEthernet0/3/0] commit
[~PE2-GigabitEthernet0/3/0] quit
上述配置完成后,PE1与P、P与PE2之间应能建立LDP会话,执行display mpls ldp session命令可以看到显示结果中Status项为“Operational”。执行display mpls ldp lsp命令,可以看到LDP LSP的建立情况。
以PE1的显示为例:
[~PE1] display mpls ldp session
LDP Session(s) in Public Network Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM) A '*' before a session means the session is being deleted.
-------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
-------------------------------------------------------------------------
2.2.2.9:0 Operational DU Passive 0000:00:01 5/5
-------------------------------------------------------------------------
TOTAL: 1 session(s) Found.
[~PE1] display mpls ldp lsp
LDP LSP Information ------------------------------------------------------------------------------- DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface ------------------------------------------------------------------------------- 1.1.1.9/32 3/NULL 2.2.2.9 127.0.0.1 InLoop0 *1.1.1.9/32 Liberal 2.2.2.9/32 NULL/3 - 172.21.1.2 GigabitEthernet0/3/0 2.2.2.9/32 1024/3 2.2.2.9 172.21.1.2 GigabitEthernet0/3/0 3.3.3.9/32 NULL/1025 - 172.21.1.2 GigabitEthernet0/3/0 3.3.3.9/32 1025/1025 2.2.2.9 172.21.1.2 GigabitEthernet0/3/0 ------------------------------------------------------------------------------- TOTAL: 5 Normal LSP(s) Found. TOTAL: 1 Liberal LSP(s) Found. TOTAL: 0 Frr LSP(s) Found. A '*' before an LSP means the LSP is not established A '*' before a Label means the USCB or DSCB is stale A '*' before a UpstreamPeer means the session is in GR state A '*' before a NextHop means the LSP is FRR LSP
- 在PE之间建立MP-IBGP对等体关系
# 配置PE1。
[~PE1] bgp 100
[*PE1-bgp] peer 3.3.3.9 as-number 100
[*PE1-bgp] peer 3.3.3.9 connect-interface loopback 1
[*PE1-bgp] ipv4-family vpnv4
[*PE1-bgp-af-vpnv4] peer 3.3.3.9 enable
[*PE1-bgp-af-vpnv4] commit
[~PE1-bgp-af-vpnv4] quit
[~PE1-bgp] quit
# 配置PE2。
[~PE2] bgp 100
[*PE2-bgp] peer 1.1.1.9 as-number 100
[*PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[*PE2-bgp] ipv4-family vpnv4
[*PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[*PE2-bgp-af-vpnv4] commit
[~PE2-bgp-af-vpnv4] quit
[~PE2-bgp] quit
配置完成后,在PE设备上执行display bgp peer或display bgp vpnv4 all peer命令,可以看到PE之间的BGP对等体关系已建立,并达到Established状态。
[~PE1] display bgp vpnv4 all peer
BGP local router ID : 1.1.1.9
Local AS number : 100
Total number of peers : 3 Peers in established state : 3
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
3.3.3.9 4 100 12 18 0 00:09:38 Established 0
- 在PE设备上配置VPN实例,将CE接入PE
# 配置PE1。
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] route-distinguisher 100:1
[*PE1-vpn-instance-vpna] vpn-target 111:1 both
[*PE1-vpn-instance-vpna] commit
[~PE1-vpn-instance-vpna] quit
[~PE1] ip vpn-instance vpnb
[*PE1-vpn-instance-vpnb] route-distinguisher 100:2
[*PE1-vpn-instance-vpnb] vpn-target 222:2 both
[*PE1-vpn-instance-vpnb] commit
[~PE1-vpn-instance-vpnb] quit
[~PE1] interface gigabitethernet 0/1/0
[~PE1-GigabitEthernet0/1/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet0/1/0] ip address 10.1.1.2 24
[*PE1-GigabitEthernet0/1/0] commit
[~PE1-GigabitEthernet0/1/0] quit
[~PE1] interface gigabitethernet 0/2/0
[~PE1-GigabitEthernet0/2/0] ip binding vpn-instance vpnb
[*PE1-GigabitEthernet0/2/0] ip address 10.2.1.2 24
[*PE1-GigabitEthernet0/2/0] commit
[~PE1-GigabitEthernet0/2/0] quit
# 配置PE2。
[~PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] route-distinguisher 200:1
[*PE2-vpn-instance-vpna] vpn-target 111:1 both
[*PE2-vpn-instance-vpna] commit
[~PE2-vpn-instance-vpna] quit
[~PE2] ip vpn-instance vpnb
[*PE2-vpn-instance-vpnb] route-distinguisher 200:2
[*PE2-vpn-instance-vpnb] vpn-target 222:2 both
[*PE2-vpn-instance-vpnb] commit
[~PE2-vpn-instance-vpnb] quit
[~PE2] interface gigabitethernet 0/1/0
[~PE2-GigabitEthernet0/1/0] ip binding vpn-instance vpna
[*PE2-GigabitEthernet0/1/0] ip address 10.3.1.2 24
[*PE2-GigabitEthernet0/1/0] commit
[~PE2-GigabitEthernet0/1/0] quit
[~PE2] interface gigabitethernet 0/2/0
[~PE2-GigabitEthernet0/2/0] ip binding vpn-instance vpnb
[*PE2-GigabitEthernet0/2/0] ip address 10.4.1.2 24
[*PE2-GigabitEthernet0/2/0] commit
[~PE2-GigabitEthernet0/2/0] quit
# 按图9-4配置各CE的接口IP地址,配置过程略。
配置完成后,在PE设备上执行display ip vpn-instance verbose命令可以看到VPN实例的配置情况。各PE能ping通自己接入的CE。
当PE上有多个绑定了同一个VPN的接口,则使用ping -vpn-instance命令ping对端PE接入的CE时,要指定源IP地址,即要指定ping -vpn-instance vpn-instance-name -a source-ip-address dest-ip-address命令中的参数-a source-ip-address,否则可能ping不通。
以PE1和CE1为例:
[~PE1] display ip vpn-instance verbose
Total VPN-Instances configured : 2
VPN-Instance Name and ID : vpna, 1
Create date : 2009/01/21 11:30:35
Up time : 0 days, 00 hours, 05 minutes and 19 seconds
Route Distinguisher : 100:1
Export VPN Targets : 111:1
Import VPN Targets : 111:1
Label Policy : label per route
The diffserv-mode Information is : uniform
The ttl-mode Information is : pipe
Log Interval : 5
Interfaces : GigabitEthernet0/1/0
VPN-Instance Name and ID : vpnb, 2
Create date : 2009/01/21 11:31:18
Up time : 0 days, 00 hours, 04 minutes and 36 seconds
Route Distinguisher : 100:2
Export VPN Targets : 222:2
Import VPN Targets : 222:2
Label Policy : label per route
The diffserv-mode Information is : uniform
The ttl-mode Information is : pipe
Log Interval : 5
Interfaces : GigabitEthernet0/2/0
[~PE1] ping -vpn-instance vpna 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=56 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=4 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=4 ms
Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=52 ms
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=3 ms
--- 10.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/23/56 ms
- 在PE与CE之间建立EBGP对等体关系,引入VPN路由
# 配置CE1。
[~CE1] bgp 65410
[*CE1-bgp] peer 10.1.1.2 as-number 100
[*CE1-bgp] import-route direct
另外3个CE设备(CE2~CE4)配置与CE1设备配置类似,配置过程省略。
# 配置PE1。
[~PE1] bgp 100
[*PE1-bgp] ipv4-family vpn-instance vpna
[*PE1-bgp-vpna] peer 10.1.1.1 as-number 65410
[*PE1-bgp-vpna] import-route direct
[*PE1-bgp-vpna] commit
[~PE1-bgp-vpna] quit
[~PE1-bgp] ipv4-family vpn-instance vpnb
[*PE1-bgp-vpnb] peer 10.2.1.1 as-number 65420
[*PE1-bgp-vpnb] import-route direct
[*PE1-bgp-vpnb] commit
[~PE1-bgp-vpnb] quit
PE2的配置与PE1类似,配置过程省略。
配置完成后,在PE设备上执行display bgp vpnv4 vpn-instance peer命令,可以看到PE与CE之间的BGP对等体关系已建立,并达到Established状态。
以PE1与CE1的对等体关系为例:
[~PE1] display bgp vpnv4 vpn-instance vpna peer
BGP local router ID : 1.1.1.9
Local AS number : 100
Total number of peers : 1 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
10.1.1.1 4 65410 11 9 0 00:06:37 Established 1
- 检查配置结果
在PE设备上执行display ip routing-table vpn-instance命令,可以看到去往对端CE的路由。
以PE1的显示为例:
[~PE1] display ip routing-table vpn-instance vpna
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: vpna
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.1.0/24 Direct 0 0 D 10.1.1.2 GigabitEthernet0/1/0
10.1.1.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.3.1.0/24 IBGP 255 0 RD 3.3.3.9 GigabitEthernet0/3/0
[~PE1] display ip routing-table vpn-instance vpnb
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: vpnb
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.2.1.0/24 Direct 0 0 D 10.2.1.2 GigabitEthernet0/2/0
10.2.1.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.4.1.0/24 IBGP 255 0 RD 3.3.3.9 GigabitEthernet0/3/0
同一VPN的CE能够相互Ping通,不同VPN的CE不能相互Ping通。
例如:CE1能够Ping通CE3(10.3.1.1/24),但不能Ping通CE4(10.4.1.1/24)。
[~CE1] ping 10.3.1.1
PING 10.3.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.3.1.1: bytes=56 Sequence=1 ttl=253 time=72 ms
Reply from 10.3.1.1: bytes=56 Sequence=2 ttl=253 time=34 ms
Reply from 10.3.1.1: bytes=56 Sequence=3 ttl=253 time=50 ms
Reply from 10.3.1.1: bytes=56 Sequence=4 ttl=253 time=50 ms
Reply from 10.3.1.1: bytes=56 Sequence=5 ttl=253 time=34 ms
--- 10.3.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/48/72 ms
[~CE1] ping 10.4.1.1
PING 10.4.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 10.4.1.1 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
- 在PE1和PE2上配置differ-serve模式,同时将Differ-serve域应用到不同的VPN实例中
配置PE1
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv4-family
[*PE1-vpn-instance-vpna] diffserv-mode pipe af1 green
[*PE1-vpn-instance-vpna] commit
[~PE1-vpn-instance-vpna] quit
[~PE1] ip vpn-instance vpnb
[*PE1-vpn-instance-vpnb] diffserv-mode pipe be yellow
[*PE1-vpn-instance-vpnb] commit
[~PE1-vpn-instance-vpnb] quit
配置PE2
[~PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] ipv4-family
[*PE2-vpn-instance-vpna] diffserv-mode pipe af1 green
[*PE2-vpn-instance-vpna] commit
[~PE2-vpn-instance-vpna] quit
[~PE2] ip vpn-instance vpnb
[*PE2-vpn-instance-vpnb] diffserv-mode pipe be yellow
[*PE2-vpn-instance-vpnb] commit
[~PE2-vpn-instance-vpnb] quit
- 检查配置结果
在PE设备上执行display ip vpn-instance verbose vpna命令,可以看到该VPN实例下配置的differ-serve模式。
以PE1的显示为例:
[~PE1] display ip vpn-instance verbose vpna
VPN-Instance Name and ID : vpna, 1 Create date : 2009/11/30 11:08:12 Up time : 0 days, 00 hours, 06 minutes and 32 seconds Route Distinguisher : 200:1 Label Policy : label per route The diffserv-mode Information is : pipe The ttl-mode Information is : pipe Log Interval : 5
配置文件
PE1的配置文件
#
sysname PE1
#
ip vpn-instance vpna
route-distinguisher 100:1 apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
diffserv-mode pipe af1 green
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 100:2 apply-label per-instance
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
diffserv-mode pipe be yellow
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet0/1/0
undo shutdown
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet0/2/0
undo shutdown
ip binding vpn-instance vpnb
ip address 10.2.1.2 255.255.255.0
#
interface GigabitEthernet0/3/0
undo shutdown
ip address 172.21.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpna
peer 10.1.1.1 as-number 65410
import-route direct
#
ipv4-family vpn-instance vpnb
peer 10.2.1.1 as-number 65420
import-route direct
#
ospf 1
area 0.0.0.0
network 172.21.1.0 0.0.0.255
network 1.1.1.9 0.0.0.0
#
return
P的配置文件
#
sysname P
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 172.21.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 172.22.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 172.21.1.0 0.0.0.255
network 172.22.1.0 0.0.0.255
network 2.2.2.9 0.0.0.0
#
return
PE2的配置文件
#
sysname PE2
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1 apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
diffserv-mode pipe af1 green
#
ip vpn-instance vpnb
route-distinguisher 200:2 apply-label per-instance
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
diffserv-mode pipe be yellow
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface GigabitEthernet0/1/0
undo shutdown
ip binding vpn-instance vpna
ip address 10.3.1.2 255.255.255.0
#
interface GigabitEthernet0/2/0
undo shutdown
ip binding vpn-instance vpnb
ip address 10.4.1.2 255.255.255.0
#
interface GigabitEthernet0/3/0
undo shutdown
ip address 172.22.1.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpna
peer 10.3.1.1 as-number 65430
import-route direct
#
ipv4-family vpn-instance vpnb
peer 10.4.1.1 as-number 65440
import-route direct
#
ospf 1
area 0.0.0.0
network 172.22.1.0 0.0.0.255
network 3.3.3.9 0.0.0.0
#
return
CE1的配置文件
#
sysname CE1
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
CE2的配置文件
#
sysname CE2
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.2.1.1 255.255.255.0
#
bgp 65420
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.2.1.2 enable
#
return
CE3的配置文件
#
sysname CE3
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.3.1.1 255.255.255.0
#
bgp 65430
peer 10.3.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.3.1.2 enable
#
return
CE4的配置文件
#
sysname CE4
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.4.1.1 255.255.255.0
#
bgp 65440
peer 10.4.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.4.1.2 enable
#
return