作为一名网工,以前一直在51CTO上向前辈学习,今天我也试着写个小实验,第一次写,大部都是命令,记录自己的操作,也希望可以给别人带来帮助,谢谢。

一、拓扑图
Juniper MPLS-E×××配置_第1张图片
二、实现环境
拓扑图中为四台vmx路由,两台作为PE设备,两台作为CE设备;
PE设备的软件版本Junos: 18.1R1.9,CE设备的软件版本为:Junos: 14.1R1.10

CE1配置了两个vlan2100、vlan2200
CE2配置了两个vlan2100、vlan2200

CE1:vlan2100 192.168.10.10/24 gateway 192.168.10.254
CE1: vlan2200 192.168.20.10/24 gateway 192.168.20.254

CE2: vlan2100 192.168.10.20/24 gateway 192.168.10.254
CE2: vlan2200 192.168.20.20/24 gateway 192.168.20.254

目的:CE1与CE2之间的IP地址三层可达
CE1可以ping通 192.168.10.20、192.168.20.20
CE2可以ping通 192.168.10.10、192.168.20.10
三、配置步骤
1、配置PE与PE之间互联IP地址
root@PE1# show interfaces | display set
set interfaces ge-0/0/0 unit 0 family inet address 10.0.12.1/24
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 10.0.21.1/24
set interfaces ge-0/0/1 unit 0 family mpls

set interfaces lo0 unit 0 family inet address 1.1.1.1/32

root@PE2# show interfaces | display set
set interfaces ge-0/0/0 unit 0 family inet address 10.0.12.2/24
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 10.0.21.2/24
set interfaces ge-0/0/1 unit 0 family mpls

set interfaces lo0 unit 0 family inet address 2.2.2.2/32

2、配置OSPF协议,lo0接口三层可达
root@PE1# show protocols ospf | display set
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

root@PE2# show protocols ospf | display set
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

[edit]
root@PE1# run ping 2.2.2.2 source 1.1.1.1
PING 2.2.2.2 (2.2.2.2): 56 data bytes
64 bytes from 2.2.2.2: icmp_seq=0 ttl=64 time=216.467 ms
64 bytes from 2.2.2.2: icmp_seq=1 ttl=64 time=46.884 ms
^C
--- 2.2.2.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 46.884/131.675/216.467/84.792 ms

3、配置MPLS、LDP协议,支持label转换
[edit]
root@PE1# show protocols mpls | display set
set protocols mpls interface all

[edit]
root@PE1# show protocols ldp | display set
set protocols ldp interface all

[edit]
root@PE1#

[edit]
root@PE2# show protocols mpls | display set
set protocols mpls interface all

[edit]
root@PE2# show protocols ldp | display set
set protocols ldp interface all

[edit]
root@PE2#

[edit]
root@PE1# run show ldp neighbor
Address Interface Label space ID Hold time
10.0.12.2 ge-0/0/0.0 2.2.2.2:0 11
10.0.21.2 ge-0/0/1.0 2.2.2.2:0 10

[edit]
root@PE1# run show ldp session
Address State Connection Hold time Adv. Mode
2.2.2.2 Operational Open 21 DU

[edit]
root@PE1# run show mpls interface
Interface State Administrative groups (x: extended)
ge-0/0/0.0 Up
ge-0/0/1.0 Up

[edit]
root@PE1# run show ldp interface
Interface Address Label space ID Nbr Next
count hello
lo0.0 1.1.1.1 1.1.1.1:0 0 0
ge-0/0/0.0 10.0.12.1 1.1.1.1:0 1 3
ge-0/0/1.0 10.0.21.1 1.1.1.1:0 1 0

[edit]
root@PE1#

4、在两台PE之间配置MP-BGP,传输E×××信令
[edit]
root@PE1# show routing-options | display set
set routing-options router-id 1.1.1.1
set routing-options autonomous-system 65000
set routing-options forwarding-table export load-blance

[edit]
root@PE1# show protocols bgp | display set
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 1.1.1.1
set protocols bgp group ibgp family inet-*** unicast
set protocols bgp group ibgp family e*** signaling
set protocols bgp group ibgp neighbor 2.2.2.2

[edit]
root@PE2# show routing-options | display set
set routing-options router-id 2.2.2.2
set routing-options autonomous-system 65000
set routing-options forwarding-table export load-blance

[edit]
root@PE2# show protocols bgp | display set
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 2.2.2.2
set protocols bgp group ibgp family inet-*** unicast
set protocols bgp group ibgp family e*** signaling
set protocols bgp group ibgp neighbor 1.1.1.1

root@PE1# run show bgp summary
Groups: 1 Peers: 1 Down peers: 0
Table Tot Paths Act Paths Suppressed History Damp State Pending
bgp.l3***.0
4 4 0 0 0 0
bgp.e***.0
10 10 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
2.2.2.2 65000 268 263 0 0 1:26:07 Establ
bgp.l3***.0: 4/4/4/0
bgp.e***.0: 10/10/10/0
VRF-A.inet.0: 0/4/4/0
E×××-A.e***.0: 10/10/10/0
__default_e***__.e***.0: 0/0/0/0

[edit]
root@PE1#

至此PE与PE之间的配置结束了

配置PE与CE之间的配置:

  1. 配置PE1与CE1的接口配置
    set interfaces ge-0/0/2 gigether-options 802.3ad ae0
    set interfaces ge-0/0/3 gigether-options 802.3ad ae0
    set interfaces ae0 flexible-vlan-tagging
    set interfaces ae0 encapsulation flexible-ethernet-services
    set interfaces ae0 unit 2100 encapsulation vlan-bridge
    set interfaces ae0 unit 2100 vlan-id 2100
    set interfaces ae0 unit 2200 encapsulation vlan-bridge
    set interfaces ae0 unit 2200 vlan-id 2200

  2. 配置PE1的E×××实例配置:
    root@PE1# show routing-instances E×××-A | display set
    set routing-instances E×××-A instance-type virtual-switch
    set routing-instances E×××-A route-distinguisher 1.1.1.1:2000
    set routing-instances E×××-A vrf-target target:65000:2000
    set routing-instances E×××-A protocols e*** extended-vlan-list 2100
    set routing-instances E×××-A protocols e*** extended-vlan-list 2200
    set routing-instances E×××-A protocols e*** default-gateway advertise
    set routing-instances E×××-A bridge-domains BR-2100 vlan-id 2100
    set routing-instances E×××-A bridge-domains BR-2100 interface ae0.2100
    set routing-instances E×××-A bridge-domains BR-2200 vlan-id 2200
    set routing-instances E×××-A bridge-domains BR-2200 interface ae0.2200

3.配置CE1的接口IP地址
[edit]
root@CE1# show interfaces | display set
set interfaces ge-0/0/0 gigether-options 802.3ad ae0
set interfaces ge-0/0/1 gigether-options 802.3ad ae0
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 unit 2100 vlan-id 2100
set interfaces ae0 unit 2100 family inet address 192.168.10.10/24
set interfaces ae0 unit 2200 vlan-id 2200
set interfaces ae0 unit 2200 family inet address 192.168.20.10/24

[edit]
root@CE1# show routing-instances | display set
set routing-instances ce1 instance-type virtual-router
set routing-instances ce1 interface ae0.2200
set routing-instances ce1 routing-options static route 0.0.0.0/0 next-hop 192.168.20.254

[edit]
root@CE1#

配置PE2与CE2的接口配置
[edit]
root@PE2# show interfaces | display set
set interfaces ge-0/0/2 gigether-options 802.3ad ae0
set interfaces ge-0/0/3 gigether-options 802.3ad ae0
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 encapsulation flexible-ethernet-services
set interfaces ae0 unit 2100 encapsulation vlan-bridge
set interfaces ae0 unit 2100 vlan-id 2100
set interfaces ae0 unit 2200 encapsulation vlan-bridge
set interfaces ae0 unit 2200 vlan-id 2200

配置PE2 E×××的实例:
[edit]
root@PE2# show routing-instances E×××-A | display set
set routing-instances E×××-A instance-type virtual-switch
set routing-instances E×××-A route-distinguisher 2.2.2.2:2000
set routing-instances E×××-A vrf-target target:65000:2000
set routing-instances E×××-A protocols e*** extended-vlan-list 2100
set routing-instances E×××-A protocols e*** extended-vlan-list 2200
set routing-instances E×××-A protocols e*** default-gateway advertise
set routing-instances E×××-A bridge-domains BR-2100 vlan-id 2100
set routing-instances E×××-A bridge-domains BR-2100 interface ae0.2100
set routing-instances E×××-A bridge-domains BR-2200 vlan-id 2200
set routing-instances E×××-A bridge-domains BR-2200 interface ae0.2200

配置CE2的接口配置:
[edit]
root@CE2# show interfaces | display set
set interfaces ge-0/0/0 gigether-options 802.3ad ae0
set interfaces ge-0/0/1 gigether-options 802.3ad ae0
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 unit 2100 vlan-id 2100
set interfaces ae0 unit 2100 family inet address 192.168.10.20/24
set interfaces ae0 unit 2200 vlan-id 2200
set interfaces ae0 unit 2200 family inet address 192.168.20.20/24

[edit]
root@CE2# show routing-instances | display set
set routing-instances ce2 instance-type virtual-router
set routing-instances ce2 interface ae0.2200
set routing-instances ce2 routing-options static route 0.0.0.0/0 next-hop 192.168.20.254

[edit]
root@CE2#

检测vlan2100的连通性:

[edit]
root@CE1# run ping 192.168.10.20 source 192.168.10.10
PING 192.168.10.20 (192.168.10.20): 56 data bytes
64 bytes from 192.168.10.20: icmp_seq=0 ttl=64 time=75.604 ms
64 bytes from 192.168.10.20: icmp_seq=1 ttl=64 time=7.799 ms
^C
--- 192.168.10.20 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 7.799/41.702/75.604/33.902 ms

检测vlan2200的连通性:
[edit]
root@CE1# ...source 192.168.20.10 routing-instance ce1
PING 192.168.20.20 (192.168.20.20): 56 data bytes
64 bytes from 192.168.20.20: icmp_seq=0 ttl=64 time=7.298 ms
64 bytes from 192.168.20.20: icmp_seq=1 ttl=64 time=7.693 ms
^C
--- 192.168.20.20 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 7.298/7.495/7.693/0.197 ms

至此CE1可以与CE2同vlan中的用户互访了

接下配置的是给vlan2100和vlan2200配置三层网关,实现vlan2100和vlan2200中的用户可以相互访问;

PE1三层IP配置:
root@PE1# show interfaces irb | display set
set interfaces irb unit 2100 family inet address 192.168.10.254/24
set interfaces irb unit 2100 mac 00:00:00:00:00:01
set interfaces irb unit 2200 family inet address 192.168.20.254/24
set interfaces irb unit 2200 mac 00:00:00:00:00:02

root@PE1# show routing-instances E×××-A | display set
set routing-instances E×××-A instance-type virtual-switch
set routing-instances E×××-A route-distinguisher 1.1.1.1:2000
set routing-instances E×××-A vrf-target target:65000:2000
set routing-instances E×××-A protocols e*** extended-vlan-list 2100
set routing-instances E×××-A protocols e*** extended-vlan-list 2200
set routing-instances E×××-A protocols e*** default-gateway advertise
set routing-instances E×××-A bridge-domains BR-2100 vlan-id 2100
set routing-instances E×××-A bridge-domains BR-2100 interface ae0.2100
set routing-instances E×××-A bridge-domains BR-2100 routing-interface irb.2100
set routing-instances E×××-A bridge-domains BR-2200 vlan-id 2200
set routing-instances E×××-A bridge-domains BR-2200 interface ae0.2200
set routing-instances E×××-A bridge-domains BR-2200 routing-interface irb.2200

[edit]
root@PE1# show routing-instances VRF-A | display set
set routing-instances VRF-A instance-type vrf
set routing-instances VRF-A interface irb.2100
set routing-instances VRF-A interface irb.2200
set routing-instances VRF-A route-distinguisher 1.1.1.1:1234
set routing-instances VRF-A vrf-target target:65000:1234
set routing-instances VRF-A vrf-table-label

PE2三层网关配置:
[edit]
root@PE2# show interfaces irb | display set
set interfaces irb unit 2100 family inet address 192.168.10.254/24
set interfaces irb unit 2100 mac 00:00:00:00:00:01
set interfaces irb unit 2200 family inet address 192.168.20.254/24
set interfaces irb unit 2200 mac 00:00:00:00:00:02

[edit]
root@PE2# show routing-instances E×××-A | display set
set routing-instances E×××-A instance-type virtual-switch
set routing-instances E×××-A route-distinguisher 2.2.2.2:2000
set routing-instances E×××-A vrf-target target:65000:2000
set routing-instances E×××-A protocols e*** extended-vlan-list 2100
set routing-instances E×××-A protocols e*** extended-vlan-list 2200
set routing-instances E×××-A protocols e*** default-gateway advertise
set routing-instances E×××-A bridge-domains BR-2100 vlan-id 2100
set routing-instances E×××-A bridge-domains BR-2100 interface ae0.2100
set routing-instances E×××-A bridge-domains BR-2100 routing-interface irb.2100
set routing-instances E×××-A bridge-domains BR-2200 vlan-id 2200
set routing-instances E×××-A bridge-domains BR-2200 interface ae0.2200
set routing-instances E×××-A bridge-domains BR-2200 routing-interface irb.2200

[edit]
root@PE2# show routing-instances VRF-A | display set
set routing-instances VRF-A instance-type vrf
set routing-instances VRF-A interface irb.2100
set routing-instances VRF-A interface irb.2200
set routing-instances VRF-A route-distinguisher 2.2.2.2:1234
set routing-instances VRF-A vrf-target target:65000:1234
set routing-instances VRF-A vrf-table-label

测试三层连通性:

[edit]
root@CE1# run ping 192.168.10.254 source 192.168.10.10
PING 192.168.10.254 (192.168.10.254): 56 data bytes
64 bytes from 192.168.10.254: icmp_seq=0 ttl=64 time=6.243 ms
^C
--- 192.168.10.254 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 6.243/6.243/6.243/0.000 ms

[edit]
root@CE1# run ping 192.168.20.254 source 192.168.10.10
PING 192.168.20.254 (192.168.20.254): 56 data bytes
64 bytes from 192.168.20.254: icmp_seq=0 ttl=64 time=5.951 ms
^C
--- 192.168.20.254 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 5.951/5.951/5.951/0.000 ms

[edit]
root@CE1# run ping 192.168.10.20 source 192.168.10.10
PING 192.168.10.20 (192.168.10.20): 56 data bytes
64 bytes from 192.168.10.20: icmp_seq=0 ttl=64 time=11.519 ms
^C
--- 192.168.10.20 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 11.519/11.519/11.519/0.000 ms

[edit]
root@CE1# run ping 192.168.20.20 source 192.168.10.20
ping: bind: Can't assign requested address

[edit]
root@CE1# run ping 192.168.20.20 source 192.168.10.10
PING 192.168.20.20 (192.168.20.20): 56 data bytes
64 bytes from 192.168.20.20: icmp_seq=0 ttl=63 time=8.994 ms
^C
--- 192.168.20.20 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 8.994/8.994/8.994/0.000 ms

[edit]
root@CE1#

[edit]
root@CE1# run ping 192.168.10.254 source 192.168.10.10
PING 192.168.10.254 (192.168.10.254): 56 data bytes
64 bytes from 192.168.10.254: icmp_seq=0 ttl=64 time=6.243 ms
^C
--- 192.168.10.254 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 6.243/6.243/6.243/0.000 ms

[edit]
root@CE1# run ping 192.168.20.254 source 192.168.10.10
PING 192.168.20.254 (192.168.20.254): 56 data bytes
64 bytes from 192.168.20.254: icmp_seq=0 ttl=64 time=5.951 ms
^C
--- 192.168.20.254 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 5.951/5.951/5.951/0.000 ms

[edit]
root@CE1# run ping 192.168.10.20 source 192.168.10.10
PING 192.168.10.20 (192.168.10.20): 56 data bytes
64 bytes from 192.168.10.20: icmp_seq=0 ttl=64 time=11.519 ms
^C
--- 192.168.10.20 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 11.519/11.519/11.519/0.000 ms

[edit]
root@CE1# run ping 192.168.20.20 source 192.168.10.20
ping: bind: Can't assign requested address

[edit]
root@CE1# run ping 192.168.20.20 source 192.168.10.10
PING 192.168.20.20 (192.168.20.20): 56 data bytes
64 bytes from 192.168.20.20: icmp_seq=0 ttl=63 time=8.994 ms
^C
--- 192.168.20.20 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 8.994/8.994/8.994/0.000 ms

[edit]
root@CE1#

四、验证状态
1、查看BGP状态
root@PE1# run show bgp summary
Groups: 1 Peers: 1 Down peers: 0
Table Tot Paths Act Paths Suppressed History Damp State Pending
bgp.l3***.0
4 4 0 0 0 0
bgp.e***.0
10 10 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
2.2.2.2 65000 290 291 0 0 1:36:15 Establ
bgp.l3***.0: 4/4/4/0
bgp.e***.0: 10/10/10/0
VRF-A.inet.0: 0/4/4/0
E×××-A.e***.0: 10/10/10/0
__default_e***__.e***.0: 0/0/0/0

[edit]
root@PE1#

2、 PE1从PE2学习到L3×××路由:
root@PE1# run show bgp summary
Groups: 1 Peers: 1 Down peers: 0
Table Tot Paths Act Paths Suppressed History Damp State Pending
bgp.l3***.0
4 4 0 0 0 0
bgp.e***.0
10 10 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
2.2.2.2 65000 290 291 0 0 1:36:15 Establ
bgp.l3***.0: 4/4/4/0
bgp.e***.0: 10/10/10/0
VRF-A.inet.0: 0/4/4/0
E×××-A.e***.0: 10/10/10/0
__default_e***__.e***.0: 0/0/0/0

[edit]
root@PE1#

3、PE1从PE2学习到E×××的路由
root@PE1# run show route receive-protocol bgp 2.2.2.2 table bgp.e***.0

bgp.e***.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
2:2.2.2.2:2000::2100::00:00:00:00:00:01/304 MAC/IP

  • 2.2.2.2 100 I
    2:2.2.2.2:2000::2100::00:05:86:71:b7:c0/304 MAC/IP
  • 2.2.2.2 100 I
    2:2.2.2.2:2000::2200::00:00:00:00:00:02/304 MAC/IP
  • 2.2.2.2 100 I
    2:2.2.2.2:2000::2200::00:05:86:71:b7:c0/304 MAC/IP
  • 2.2.2.2 100 I
    2:2.2.2.2:2000::2100::00:00:00:00:00:01::192.168.10.254/304 MAC/IP
  • 2.2.2.2 100 I
    2:2.2.2.2:2000::2100::00:05:86:71:b7:c0::192.168.10.20/304 MAC/IP
  • 2.2.2.2 100 I
    2:2.2.2.2:2000::2200::00:00:00:00:00:02::192.168.20.254/304 MAC/IP
  • 2.2.2.2 100 I
    2:2.2.2.2:2000::2200::00:05:86:71:b7:c0::192.168.20.20/304 MAC/IP
  • 2.2.2.2 100 I
    3:2.2.2.2:2000::2100::2.2.2.2/248 IM
  • 2.2.2.2 100 I
    3:2.2.2.2:2000::2200::2.2.2.2/248 IM
  • 2.2.2.2 100 I

[edit]
root@PE1#

五、每台设备的完整配置:
PE1:
[edit]
root@PE1# show | no-more | display set
set version 18.1R1.9
set system host-name PE1
set system root-authentication encrypted-password "$6$vr.UFWb6$F30e1qd2fm4Y6YBLzuyykAbYTjQ4axpUOPxnG8QljU1YmD5Hz6TkAHmUQf3hHP3mTXR0bnEns3aVFarvZLweK0"
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set chassis aggregated-devices ethernet device-count 8
set chassis fpc 0 pic 0 tunnel-services bandwidth 1g
set chassis fpc 0 lite-mode
set chassis network-services enhanced-ip
set interfaces ge-0/0/0 unit 0 family inet address 10.0.12.1/24
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 10.0.21.1/24
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces ge-0/0/2 gigether-options 802.3ad ae0
set interfaces ge-0/0/3 gigether-options 802.3ad ae0
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 encapsulation flexible-ethernet-services
set interfaces ae0 unit 2100 encapsulation vlan-bridge
set interfaces ae0 unit 2100 vlan-id 2100
set interfaces ae0 unit 2200 encapsulation vlan-bridge
set interfaces ae0 unit 2200 vlan-id 2200
set interfaces irb unit 2100 family inet address 192.168.10.254/24
set interfaces irb unit 2100 mac 00:00:00:00:00:01
set interfaces irb unit 2200 family inet address 192.168.20.254/24
set interfaces irb unit 2200 mac 00:00:00:00:00:02
set interfaces lo0 unit 0 family inet address 1.1.1.1/32
set routing-options router-id 1.1.1.1
set routing-options autonomous-system 65000
set routing-options forwarding-table export load-blance
set protocols mpls interface all
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 1.1.1.1
set protocols bgp group ibgp family inet-*** unicast
set protocols bgp group ibgp family e*** signaling
set protocols bgp group ibgp neighbor 2.2.2.2
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ldp interface all
set policy-options policy-statement load-blance then load-balance per-packet
set routing-instances E×××-A instance-type virtual-switch
set routing-instances E×××-A route-distinguisher 1.1.1.1:2000
set routing-instances E×××-A vrf-target target:65000:2000
set routing-instances E×××-A protocols e*** extended-vlan-list 2100
set routing-instances E×××-A protocols e*** extended-vlan-list 2200
set routing-instances E×××-A protocols e*** default-gateway advertise
set routing-instances E×××-A bridge-domains BR-2100 vlan-id 2100
set routing-instances E×××-A bridge-domains BR-2100 interface ae0.2100
set routing-instances E×××-A bridge-domains BR-2100 routing-interface irb.2100
set routing-instances E×××-A bridge-domains BR-2200 vlan-id 2200
set routing-instances E×××-A bridge-domains BR-2200 interface ae0.2200
set routing-instances E×××-A bridge-domains BR-2200 routing-interface irb.2200
set routing-instances VRF-A instance-type vrf
set routing-instances VRF-A interface irb.2100
set routing-instances VRF-A interface irb.2200
set routing-instances VRF-A route-distinguisher 1.1.1.1:1234
set routing-instances VRF-A vrf-target target:65000:1234
set routing-instances VRF-A vrf-table-label

[edit]
root@PE1#

PE2配置:
[edit]
root@PE1# show | no-more | display set
set version 18.1R1.9
set system host-name PE1
set system root-authentication encrypted-password "$6$vr.UFWb6$F30e1qd2fm4Y6YBLzuyykAbYTjQ4axpUOPxnG8QljU1YmD5Hz6TkAHmUQf3hHP3mTXR0bnEns3aVFarvZLweK0"
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set chassis aggregated-devices ethernet device-count 8
set chassis fpc 0 pic 0 tunnel-services bandwidth 1g
set chassis fpc 0 lite-mode
set chassis network-services enhanced-ip
set interfaces ge-0/0/0 unit 0 family inet address 10.0.12.1/24
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 10.0.21.1/24
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces ge-0/0/2 gigether-options 802.3ad ae0
set interfaces ge-0/0/3 gigether-options 802.3ad ae0
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 encapsulation flexible-ethernet-services
set interfaces ae0 unit 2100 encapsulation vlan-bridge
set interfaces ae0 unit 2100 vlan-id 2100
set interfaces ae0 unit 2200 encapsulation vlan-bridge
set interfaces ae0 unit 2200 vlan-id 2200
set interfaces irb unit 2100 family inet address 192.168.10.254/24
set interfaces irb unit 2100 mac 00:00:00:00:00:01
set interfaces irb unit 2200 family inet address 192.168.20.254/24
set interfaces irb unit 2200 mac 00:00:00:00:00:02
set interfaces lo0 unit 0 family inet address 1.1.1.1/32
set routing-options router-id 1.1.1.1
set routing-options autonomous-system 65000
set routing-options forwarding-table export load-blance
set protocols mpls interface all
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 1.1.1.1
set protocols bgp group ibgp family inet-*** unicast
set protocols bgp group ibgp family e*** signaling
set protocols bgp group ibgp neighbor 2.2.2.2
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ldp interface all
set policy-options policy-statement load-blance then load-balance per-packet
set routing-instances E×××-A instance-type virtual-switch
set routing-instances E×××-A route-distinguisher 1.1.1.1:2000
set routing-instances E×××-A vrf-target target:65000:2000
set routing-instances E×××-A protocols e*** extended-vlan-list 2100
set routing-instances E×××-A protocols e*** extended-vlan-list 2200
set routing-instances E×××-A protocols e*** default-gateway advertise
set routing-instances E×××-A bridge-domains BR-2100 vlan-id 2100
set routing-instances E×××-A bridge-domains BR-2100 interface ae0.2100
set routing-instances E×××-A bridge-domains BR-2100 routing-interface irb.2100
set routing-instances E×××-A bridge-domains BR-2200 vlan-id 2200
set routing-instances E×××-A bridge-domains BR-2200 interface ae0.2200
set routing-instances E×××-A bridge-domains BR-2200 routing-interface irb.2200
set routing-instances VRF-A instance-type vrf
set routing-instances VRF-A interface irb.2100
set routing-instances VRF-A interface irb.2200
set routing-instances VRF-A route-distinguisher 1.1.1.1:1234
set routing-instances VRF-A vrf-target target:65000:1234
set routing-instances VRF-A vrf-table-label

[edit]
root@PE1#

CE1配置:
[edit]
root@PE1# show | no-more | display set
set version 18.1R1.9
set system host-name PE1
set system root-authentication encrypted-password "$6$vr.UFWb6$F30e1qd2fm4Y6YBLzuyykAbYTjQ4axpUOPxnG8QljU1YmD5Hz6TkAHmUQf3hHP3mTXR0bnEns3aVFarvZLweK0"
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set chassis aggregated-devices ethernet device-count 8
set chassis fpc 0 pic 0 tunnel-services bandwidth 1g
set chassis fpc 0 lite-mode
set chassis network-services enhanced-ip
set interfaces ge-0/0/0 unit 0 family inet address 10.0.12.1/24
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 10.0.21.1/24
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces ge-0/0/2 gigether-options 802.3ad ae0
set interfaces ge-0/0/3 gigether-options 802.3ad ae0
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 encapsulation flexible-ethernet-services
set interfaces ae0 unit 2100 encapsulation vlan-bridge
set interfaces ae0 unit 2100 vlan-id 2100
set interfaces ae0 unit 2200 encapsulation vlan-bridge
set interfaces ae0 unit 2200 vlan-id 2200
set interfaces irb unit 2100 family inet address 192.168.10.254/24
set interfaces irb unit 2100 mac 00:00:00:00:00:01
set interfaces irb unit 2200 family inet address 192.168.20.254/24
set interfaces irb unit 2200 mac 00:00:00:00:00:02
set interfaces lo0 unit 0 family inet address 1.1.1.1/32
set routing-options router-id 1.1.1.1
set routing-options autonomous-system 65000
set routing-options forwarding-table export load-blance
set protocols mpls interface all
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 1.1.1.1
set protocols bgp group ibgp family inet-*** unicast
set protocols bgp group ibgp family e*** signaling
set protocols bgp group ibgp neighbor 2.2.2.2
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ldp interface all
set policy-options policy-statement load-blance then load-balance per-packet
set routing-instances E×××-A instance-type virtual-switch
set routing-instances E×××-A route-distinguisher 1.1.1.1:2000
set routing-instances E×××-A vrf-target target:65000:2000
set routing-instances E×××-A protocols e*** extended-vlan-list 2100
set routing-instances E×××-A protocols e*** extended-vlan-list 2200
set routing-instances E×××-A protocols e*** default-gateway advertise
set routing-instances E×××-A bridge-domains BR-2100 vlan-id 2100
set routing-instances E×××-A bridge-domains BR-2100 interface ae0.2100
set routing-instances E×××-A bridge-domains BR-2100 routing-interface irb.2100
set routing-instances E×××-A bridge-domains BR-2200 vlan-id 2200
set routing-instances E×××-A bridge-domains BR-2200 interface ae0.2200
set routing-instances E×××-A bridge-domains BR-2200 routing-interface irb.2200
set routing-instances VRF-A instance-type vrf
set routing-instances VRF-A interface irb.2100
set routing-instances VRF-A interface irb.2200
set routing-instances VRF-A route-distinguisher 1.1.1.1:1234
set routing-instances VRF-A vrf-target target:65000:1234
set routing-instances VRF-A vrf-table-label

[edit]
root@PE1#

CE2配置:
root@CE2# show | display set | no-more
set version 14.1R1.10
set system host-name CE2
set system root-authentication encrypted-password "$1$Lm.K.ooI$tfjWMjodLO6oIbEfGX8m40"
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set chassis aggregated-devices ethernet device-count 8
set interfaces ge-0/0/0 gigether-options 802.3ad ae0
set interfaces ge-0/0/1 gigether-options 802.3ad ae0
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 unit 2100 vlan-id 2100
set interfaces ae0 unit 2100 family inet address 192.168.10.20/24
set interfaces ae0 unit 2200 vlan-id 2200
set interfaces ae0 unit 2200 family inet address 192.168.20.20/24
set routing-options static route 0.0.0.0/0 next-hop 192.168.10.254
set routing-instances ce2 instance-type virtual-router
set routing-instances ce2 interface ae0.2200
set routing-instances ce2 routing-options static route 0.0.0.0/0 next-hop 192.168.20.254

[edit]
root@CE2#