做爲一名網工,之前一直在51CTO上向前輩學習,今天我也試着寫個小實驗,第一次寫,大部都是命令,記錄本身的操做,也但願能夠給別人帶來幫助,謝謝。session
1、拓撲圖
2、實現環境
拓撲圖中爲四臺vmx路由,兩臺做爲PE設備,兩臺做爲CE設備;
PE設備的軟件版本Junos: 18.1R1.9,CE設備的軟件版本爲:Junos: 14.1R1.10dom
CE1配置了兩個vlan2100、vlan2200
CE2配置了兩個vlan2100、vlan2200ide
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.十、192.168.20.10
3、配置步驟
一、配置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 mplsflex
set interfaces lo0 unit 0 family inet address 1.1.1.1/32ui
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 mplsspa
set interfaces lo0 unit 0 family inet address 2.2.2.2/32router
二、配置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.0blog
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
三、配置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 <none>
ge-0/0/1.0 Up <none>
[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#
四、在兩臺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之間的配置:
配置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
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#
4、驗證狀態
一、查看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#
二、 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#
三、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
[edit]
root@PE1#
5、每臺設備的完整配置:
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#