Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Блок кода
titlePE1
ESR(config)# hostname PE1
ESR(config)# system jumbo-frames
ESR(config)# router bgp log-neighbor-changes
ESR(config)# router bgp 65500
ESR(config-bgp)#   neighbor 10.10.1.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     update-source 10.10.1.1
ESR(config-bgp-neighbor)#     address-family l2vpn vpls
ESR(config-bgp-neighbor-af)#       send-community extended
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# 
ESR(config)# router ospf 1
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# 
ESR(config)# bridge 100
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# bridge 200
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# 
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   description "to CE1"
ESR(config-subif)#   bridge-group 100
ESR(config-subif)# exit
ESR(config)# interface gigabitethernet 1/0/1.200
ESR(config-subif)#   description "to CE2"
ESR(config-subif)#   bridge-group 200
ESR(config-subif)# exit
ESR(config)# interface gigabitethernet 1/0/2
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   ip firewall disable
ESR(config-if-gi)#   ip address 10.100.0.1/30
ESR(config-if-gi)#   ip ospf instance 1
ESR(config-if-gi)#   ip ospf
ESR(config-if-gi)# exit
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.10.1.1/32
ESR(config-loopback)#   ip ospf instance 1
ESR(config-loopback)#   ip ospf
ESR(config-loopback)# exit
ESR(config)# mpls
ESR(config-mpls)#   ldp
ESR(config-ldp)#     router-id 10.10.1.1
ESR(config-ldp)#     address-family ipv4
ESR(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ESR(config-ldp-af-ipv4-if)#       exit
ESR(config-ldp-af-ipv4)#     exit
ESR(config-ldp)#     enable
ESR(config-ldp)#   exit
ESR(config-mpls)#   l2vpn
ESR(config-l2vpn)#     vpls CE1
ESR(config-l2vpn-vpls)#       bridge-group 100
ESR(config-l2vpn-vpls)#       autodiscovery bgp
ESR(config-bgp)#         vpn id 1
ESR(config-bgp)#         ve id 2
ESR(config-bgp)#         rd 65500:1
ESR(config-bgp)#         route-target export 65500:1
ESR(config-bgp)#         route-target import 65500:1
ESR(config-bgp)#       exit
ESR(config-l2vpn-vpls)#       enable
ESR(config-l2vpn-vpls)#     exit
ESR(config-l2vpn)#     vpls CE2
ESR(config-l2vpn-vpls)#       bridge-group 200
ESR(config-l2vpn-vpls)#       autodiscovery bgp
ESR(config-bgp)#         vpn id 2
ESR(config-bgp)#         ve id 2
ESR(config-bgp)#         rd 65500:2
ESR(config-bgp)#         route-target export 65500:2
ESR(config-bgp)#         route-target import 65500:2
ESR(config-bgp)#       exit
ESR(config-l2vpn-vpls)#       enable
ESR(config-l2vpn-vpls)#     exit
ESR(config-l2vpn)#   exit
ESR(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ESR(config-mpls)# exit
ESR(config)# do com
ESR(config)# do conf

...

Блок кода
titlePE2
ESR(config)# hostname ESR
ESR(config)# system jumbo-frames
ESR(config)# 
ESR(config)# router bgp log-neighbor-changes
ESR(config)# router bgp 65500
ESR(config-bgp)#   router-id 10.11.1.1
ESR(config-bgp)#   neighbor 10.11.1.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     update-source 10.11.1.1
ESR(config-bgp-neighbor)#     address-family l2vpn vpls
ESR(config-bgp-neighbor-af)#       send-community extended
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# 
ESR(config)# router ospf 1
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# 
ESR(config)# bridge 100
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# bridge 200
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# 
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   description "to CE3"
ESR(config-subif)#   bridge-group 100
ESR(config-subif)# exit
ESR(config)# interface gigabitethernet 1/0/1.200
ESR(config-subif)#   description "to CE4"
ESR(config-subif)#   bridge-group 200
ESR(config-subif)# exit
ESR(config)# interface gigabitethernet 1/0/2
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   ip firewall disable
ESR(config-if-gi)#   ip address 10.101.0.1/30
ESR(config-if-gi)#   ip ospf instance 1
ESR(config-if-gi)#   ip ospf
ESR(config-if-gi)# exit
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.11.1.1/32
ESR(config-loopback)#   ip ospf instance 1
ESR(config-loopback)#   ip ospf
ESR(config-loopback)# exit
ESR(config)# mpls
ESR(config-mpls)#   ldp
ESR(config-ldp)#     router-id 10.11.1.1
ESR(config-ldp)#     address-family ipv4
ESR(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ESR(config-ldp-af-ipv4-if)#       exit
ESR(config-ldp-af-ipv4)#     exit
ESR(config-ldp)#     enable
ESR(config-ldp)#   exit
ESR(config-mpls)#   l2vpn
ESR(config-l2vpn)#     vpls CE1
ESR(config-l2vpn-vpls)#       bridge-group 100
ESR(config-l2vpn-vpls)#       autodiscovery bgp
ESR(config-bgp)#         vpn id 1
ESR(config-bgp)#         ve id 2
ESR(config-bgp)#         rd 65500:1
ESR(config-bgp)#         route-target export 65500:1
ESR(config-bgp)#         route-target import 65500:1
ESR(config-bgp)#       exit
ESR(config-l2vpn-vpls)#       enable
ESR(config-l2vpn-vpls)#     exit
ESR(config-l2vpn)#     vpls CE2
ESR(config-l2vpn-vpls)#       bridge-group 200
ESR(config-l2vpn-vpls)#       autodiscovery bgp
ESR(config-bgp)#         vpn id 2
ESR(config-bgp)#         ve id 2
ESR(config-bgp)#         rd 65500:2
ESR(config-bgp)#         route-target export 65500:2
ESR(config-bgp)#         route-target import 65500:2
ESR(config-bgp)#       exit
ESR(config-l2vpn-vpls)#       enable
ESR(config-l2vpn-vpls)#     exit
ESR(config-l2vpn)#   exit
ESR(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ESR(config-mpls)# exit
ESR(config)# do com
ESR(config)# do conf

...

Блок кода
titleASBR1
ESR(config)#  hostname ASBR1
ESR(config)# 
ESR(config)# system jumbo-frames
ESR(config)# 
ESR(config)# vlan 100,200
ESR(config-vlan)# exit
ESR(config)# 
ESR(config)# router bgp 65500
ESR(config-bgp)#   router-id 10.10.1.2
ESR(config-bgp)#   neighbor 10.10.1.1
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     update-source 10.10.1.2
ESR(config-bgp-neighbor)#     address-family l2vpn vpls
ESR(config-bgp-neighbor-af)#       send-community extended
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# 
ESR(config)# router ospf 1
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# 
ESR(config)# bridge 10
ESR(config-bridge)#   vlan 100
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# bridge 20
ESR(config-bridge)#   vlan 200
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# 
ESR(config)# interface gigabitethernet 1/0/1
ESR(config-if-gi)#   description "to ASBR2"
ESR(config-if-gi)#   mode switchport
ESR(config-if-gi)#   spanning-tree disable
ESR(config-if-gi)#   switchport forbidden default-vlan
ESR(config-if-gi)#   switchport mode trunk
ESR(config-if-gi)#   switchport trunk allowed vlan add 100,200
ESR(config-if-gi)# exit
ESR(config)# interface gigabitethernet 1/0/2
ESR(config-if-gi)#   description "to PE1"
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   ip firewall disable
ESR(config-if-gi)#   ip address 10.100.0.2/30
ESR(config-if-gi)#   ip ospf instance 1
ESR(config-if-gi)#   ip ospf
ESR(config-if-gi)# exit
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.10.1.2/32
ESR(config-loopback)#   ip ospf instance 1
ESR(config-loopback)#   ip ospf
ESR(config-loopback)# exit
ESR(config)# mpls
ESR(config-mpls)#   ldp
ESR(config-ldp)#     router-id 10.10.1.2
ESR(config-ldp)#     address-family ipv4
ESR(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ESR(config-ldp-af-ipv4-if)#       exit
ESR(config-ldp-af-ipv4)#     exit
ESR(config-ldp)#     enable
ESR(config-ldp)#   exit
ESR(config-mpls)#   l2vpn
ESR(config-l2vpn)#     vpls CE1
ESR(config-l2vpn-vpls)#       bridge-group 10
ESR(config-l2vpn-vpls)#       autodiscovery bgp
ESR(config-bgp)#         vpn id 1
ESR(config-bgp)#         ve id 1
ESR(config-bgp)#         rd 65500:1
ESR(config-bgp)#         route-target export 65500:1
ESR(config-bgp)#         route-target import 65500:1
ESR(config-bgp)#       exit
ESR(config-l2vpn-vpls)#       enable
ESR(config-l2vpn-vpls)#     exit
ESR(config-l2vpn)#     vpls CE2
ESR(config-l2vpn-vpls)#       bridge-group 20
ESR(config-l2vpn-vpls)#       autodiscovery bgp
ESR(config-bgp)#         vpn id 2
ESR(config-bgp)#         ve id 1
ESR(config-bgp)#         rd 65500:2
ESR(config-bgp)#         route-target export 65500:2
ESR(config-bgp)#         route-target import 65500:2
ESR(config-bgp)#       exit
ESR(config-l2vpn-vpls)#       enable
ESR(config-l2vpn-vpls)#     exit
ESR(config-l2vpn)#   exit
ESR(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ESR(config-mpls)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titleASBR2
ESR(config)#  hostname ASBR2
ESR(config)# 
ESR(config)# system jumbo-frames
ESR(config)# 
ESR(config)# vlan 100,200
ESR(config-vlan)# exit
ESR(config)# 
ESR(config)# router bgp 65500
ESR(config-bgp)#   router-id 10.10.1.2
ESR(config-bgp)#   neighbor 10.10.1.1
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     update-source 10.10.1.2
ESR(config-bgp-neighbor)#     address-family l2vpn vpls
ESR(config-bgp-neighbor-af)#       send-community extended
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# 
ESR(config)# router ospf 1
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# 
ESR(config)# bridge 10
ESR(config-bridge)#   vlan 100
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# bridge 20
ESR(config-bridge)#   vlan 200
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# 
ESR(config)# interface gigabitethernet 1/0/1
ESR(config-if-gi)#   description "to ASBR1"
ESR(config-if-gi)#   mode switchport
ESR(config-if-gi)#   spanning-tree disable
ESR(config-if-gi)#   switchport forbidden default-vlan
ESR(config-if-gi)#   switchport mode trunk
ESR(config-if-gi)#   switchport trunk allowed vlan add 100,200
ESR(config-if-gi)# exit
ESR(config)# interface gigabitethernet 1/0/2
ESR(config-if-gi)#   description "to PE1"
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   ip firewall disable
ESR(config-if-gi)#   ip address 10.100.0.2/30
ESR(config-if-gi)#   ip ospf instance 1
ESR(config-if-gi)#   ip ospf
ESR(config-if-gi)# exit
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.10.1.2/32
ESR(config-loopback)#   ip ospf instance 1
ESR(config-loopback)#   ip ospf
ESR(config-loopback)# exit
ESR(config)# mpls
ESR(config-mpls)#   ldp
ESR(config-ldp)#     router-id 10.10.1.2
ESR(config-ldp)#     address-family ipv4
ESR(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ESR(config-ldp-af-ipv4-if)#       exit
ESR(config-ldp-af-ipv4)#     exit
ESR(config-ldp)#     enable
ESR(config-ldp)#   exit
ESR(config-mpls)#   l2vpn
ESR(config-l2vpn)#     vpls CE1
ESR(config-l2vpn-vpls)#       bridge-group 10
ESR(config-l2vpn-vpls)#       autodiscovery bgp
ESR(config-bgp)#         vpn id 1
ESR(config-bgp)#         ve id 1
ESR(config-bgp)#         rd 65500:1
ESR(config-bgp)#         route-target export 65500:1
ESR(config-bgp)#         route-target import 65500:1
ESR(config-bgp)#       exit
ESR(config-l2vpn-vpls)#       enable
ESR(config-l2vpn-vpls)#     exit
ESR(config-l2vpn)#     vpls CE2
ESR(config-l2vpn-vpls)#       bridge-group 20
ESR(config-l2vpn-vpls)#       autodiscovery bgp
ESR(config-bgp)#         vpn id 2
ESR(config-bgp)#         ve id 1
ESR(config-bgp)#         rd 65500:2
ESR(config-bgp)#         route-target export 65500:2
ESR(config-bgp)#         route-target import 65500:2
ESR(config-bgp)#       exit
ESR(config-l2vpn-vpls)#       enable
ESR(config-l2vpn-vpls)#     exit
ESR(config-l2vpn)#   exit
ESR(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ESR(config-mpls)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titleСE1
ESR(config)# hostname CE1
ESR(config)# 
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp 65501
ESR(config-bgp)#   neighbor 192.168.1.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     address-family ipv4 unicast
ESR(config-bgp-neighbor-af)#       route-map BGP out
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   address-family ipv4 unicast
ESR(config-bgp-af)#     network 10.110.0.1/32
ESR(config-bgp-af)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.1.1/30
ESR(config-subif)# exit 
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.110.0.1/32
ESR(config-loopback)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titleСE2
ESR(config)# hostname CE2
ESR(config)# 
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp 65501
ESR(config-bgp)#   neighbor 192.168.2.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     address-family ipv4 unicast
ESR(config-bgp-neighbor-af)#       route-map BGP out
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   address-family ipv4 unicast
ESR(config-bgp-af)#     network 10.112.0.1/32
ESR(config-bgp-af)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.2.1/30
ESR(config-subif)# exit
ESR(config)# 
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.112.0.1/32
ESR(config-loopback)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titleСE3
ESR(config)# hostname CE3
ESR(config)# 
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp 65501
ESR(config-bgp)#   neighbor 192.168.3.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     address-family ipv4 unicast
ESR(config-bgp-neighbor-af)#       route-map BGP out
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   address-family ipv4 unicast
ESR(config-bgp-af)#     network 10.113.0.1/32
ESR(config-bgp-af)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.3.1/30
ESR(config-subif)# exit
ESR(config)# 
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.113.0.1/32
ESR(config-loopback)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titleСE4
ESR(config)# hostname CE4
ESR(config)# 
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp 65501
ESR(config-bgp)#   neighbor 192.168.4.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     address-family ipv4 unicast
ESR(config-bgp-neighbor-af)#       route-map BGP out
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   address-family ipv4 unicast
ESR(config-bgp-af)#     network 10.114.0.1/32
ESR(config-bgp-af)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.4.1/30
ESR(config-subif)# exit
ESR(config)# 
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.114.0.1/32
ESR(config-loopback)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titlePE1
ESR(config)# hostname PE1
ESR(config)# 
ESR(config)# ip vrf CE1
ESR(config-vrf)#   ip protocols bgp max-routes 100
ESR(config-vrf)#   rd 65500:1
ESR(config-vrf)#   route-target export 65500:1
ESR(config-vrf)#   route-target import 65500:1
ESR(config-vrf)# exit
ESR(config)# ip vrf CE2
ESR(config-vrf)#   ip protocols bgp max-routes 100
ESR(config-vrf)#   rd 65500:2
ESR(config-vrf)#   route-target export 65500:2
ESR(config-vrf)#   route-target import 65500:2
ESR(config-vrf)# exit
ESR(config)# 
ESR(config)# system jumbo-frames
ESR(config)# 
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp log-neighbor-changes
ESR(config)# router bgp 65500
ESR(config-bgp)#   neighbor 10.10.1.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     update-source 10.10.1.1
ESR(config-bgp-neighbor)#     address-family vpnv4 unicast
ESR(config-bgp-neighbor-af)#       send-community extended
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)#   vrf CE1
ESR(config-bgp-vrf)#     neighbor 192.168.1.1
ESR(config-bgp-vrf-neighbor)#       remote-as 65501
ESR(config-bgp-vrf-neighbor)#       address-family ipv4 unicast
ESR(config-bgp-neighbor-af-vrf)#         route-map BGP out
ESR(config-bgp-neighbor-af-vrf)#         enable
ESR(config-bgp-neighbor-af-vrf)#       exit
ESR(config-bgp-vrf-neighbor)#       enable
ESR(config-bgp-vrf-neighbor)#     exit
ESR(config-bgp-vrf)#     address-family ipv4 unicast
ESR(config-bgp-vrf-af)#       redistribute bgp 65500 route-map BGP
ESR(config-bgp-vrf-af)#     exit
ESR(config-bgp-vrf)#     enable
ESR(config-bgp-vrf)#   exit
ESR(config-bgp)#   vrf CE2
ESR(config-bgp-vrf)#     neighbor 192.168.2.1
ESR(config-bgp-vrf-neighbor)#       remote-as 65501
ESR(config-bgp-vrf-neighbor)#       address-family ipv4 unicast
ESR(config-bgp-neighbor-af-vrf)#         route-map BGP out
ESR(config-bgp-neighbor-af-vrf)#         enable
ESR(config-bgp-neighbor-af-vrf)#       exit
ESR(config-bgp-vrf-neighbor)#       enable
ESR(config-bgp-vrf-neighbor)#     exit
ESR(config-bgp-vrf)#     address-family ipv4 unicast
ESR(config-bgp-vrf-af)#       redistribute bgp 65500 route-map BGP
ESR(config-bgp-vrf-af)#     exit
ESR(config-bgp-vrf)#     enable
ESR(config-bgp-vrf)#   exit
ESR(config-bgp)# exit
ESR(config)# 
ESR(config)# router ospf 1
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# 
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip vrf forwarding CE1
ESR(config-subif)#   description "to CE1"
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.1.2/30
ESR(config-subif)# exit
ESR(config)# interface gigabitethernet 1/0/1.200
ESR(config-subif)#   ip vrf forwarding CE2
ESR(config-subif)#   description "to CE2"
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.2.2/30
ESR(config-subif)# exit
ESR(config)# interface gigabitethernet 1/0/2
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   ip firewall disable
ESR(config-if-gi)#   ip address 10.100.0.1/30
ESR(config-if-gi)#   ip ospf instance 1
ESR(config-if-gi)#   ip ospf
ESR(config-if-gi)# exit
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.10.1.1/32
ESR(config-loopback)#   ip ospf instance 1
ESR(config-loopback)#   ip ospf
ESR(config-loopback)# exit
ESR(config)# mpls
ESR(config-mpls)#   ldp
ESR(config-ldp)#     router-id 10.10.1.1
ESR(config-ldp)#     address-family ipv4
ESR(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ESR(config-ldp-af-ipv4-if)#       exit
ESR(config-ldp-af-ipv4)#     exit
ESR(config-ldp)#     enable
ESR(config-ldp)#   exit
ESR(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ESR(config-mpls)# exit
ESR(config)# do com
ESR(config)# do conf

...

Блок кода
titlePE2
ESR(config)# hostname PE2
ESR(config)# 
ESR(config)# ip vrf CE1
ESR(config-vrf)#   ip protocols bgp max-routes 100
ESR(config-vrf)#   rd 65500:1
ESR(config-vrf)#   route-target export 65500:1
ESR(config-vrf)#   route-target import 65500:1
ESR(config-vrf)# exit
ESR(config)# ip vrf CE2
ESR(config-vrf)#   ip protocols bgp max-routes 100
ESR(config-vrf)#   rd 65500:2
ESR(config-vrf)#   route-target export 65500:2
ESR(config-vrf)#   route-target import 65500:2
ESR(config-vrf)# exit
ESR(config)# 
ESR(config)# system jumbo-frames
ESR(config)# 
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp log-neighbor-changes
ESR(config)# router bgp 65500
ESR(config-bgp)#   router-id 10.11.1.1
ESR(config-bgp)#   neighbor 10.11.1.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     update-source 10.11.1.1
ESR(config-bgp-neighbor)#     address-family vpnv4 unicast
ESR(config-bgp-neighbor-af)#       send-community extended
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)#   vrf CE1
ESR(config-bgp-vrf)#     neighbor 192.168.3.1
ESR(config-bgp-vrf-neighbor)#       remote-as 65501
ESR(config-bgp-vrf-neighbor)#       address-family ipv4 unicast
ESR(config-bgp-neighbor-af-vrf)#         route-map BGP out
ESR(config-bgp-neighbor-af-vrf)#         enable
ESR(config-bgp-neighbor-af-vrf)#       exit
ESR(config-bgp-vrf-neighbor)#       enable
ESR(config-bgp-vrf-neighbor)#     exit
ESR(config-bgp-vrf)#     address-family ipv4 unicast
ESR(config-bgp-vrf-af)#       redistribute bgp 65500 route-map BGP
ESR(config-bgp-vrf-af)#     exit
ESR(config-bgp-vrf)#     enable
ESR(config-bgp-vrf)#   exit
ESR(config-bgp)#   vrf CE2
ESR(config-bgp-vrf)#     neighbor 192.168.4.1
ESR(config-bgp-vrf-neighbor)#       remote-as 65501
ESR(config-bgp-vrf-neighbor)#       address-family ipv4 unicast
ESR(config-bgp-neighbor-af-vrf)#         route-map BGP out
ESR(config-bgp-neighbor-af-vrf)#         enable
ESR(config-bgp-neighbor-af-vrf)#       exit
ESR(config-bgp-vrf-neighbor)#       enable
ESR(config-bgp-vrf-neighbor)#     exit
ESR(config-bgp-vrf)#     address-family ipv4 unicast
ESR(config-bgp-vrf-af)#       redistribute bgp 65500 route-map BGP
ESR(config-bgp-vrf-af)#     exit
ESR(config-bgp-vrf)#     enable
ESR(config-bgp-vrf)##exit
  exit
ESR(config-bgp)# exit
ESR(config)# 
ESR(config)# router ospf 1
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# 
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip vrf forwarding CE1
ESR(config-subif)#   description "to CE3"
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.3.2/30
ESR(config-subif)# exit
ESR(config)# interface gigabitethernet 1/0/1.200
ESR(config-subif)#   ip vrf forwarding CE2
ESR(config-subif)#   description "to CE4"
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.4.2/30
ESR(config-subif)# exit
ESR(config)# interface gigabitethernet 1/0/2
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   ip firewall disable
ESR(config-if-gi)#   ip address 10.101.0.1/30
ESR(config-if-gi)#   ip ospf instance 1
ESR(config-if-gi)#   ip ospf
ESR(config-if-gi)# exit
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.11.1.1/32
ESR(config-loopback)#   ip ospf instance 1
ESR(config-loopback)#   ip ospf
ESR(config-loopback)# exit
ESR(config)# mpls
ESR(config-mpls)#   ldp
ESR(config-ldp)#     router-id 10.11.1.1
ESR(config-ldp)#     address-family ipv4
ESR(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ESR(config-ldp-af-ipv4-if)#       exit
ESR(config-ldp-af-ipv4)#     exit
ESR(config-ldp)#     enable
ESR(config-ldp)#   exit
ESR(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ESR(config-mpls)# exit
ESR(config)# do com
ESR(config)# do conf

...

Блок кода
titleASBR1
ESR(config)# hostname ASBR1
ESR(config)# 
ESR(config)# ip vrf CE1
ESR(config-vrf)#   ip protocols ospf max-routes 100
ESR(config-vrf)#   rd 65500:1
ESR(config-vrf)#   route-target export 65500:1
ESR(config-vrf)#   route-target import 65500:1
ESR(config-vrf)# exit
ESR(config)# ip vrf CE2
ESR(config-vrf)#   ip protocols ospf max-routes 100
ESR(config-vrf)#   rd 65500:2
ESR(config-vrf)#   route-target export 65500:2
ESR(config-vrf)#   route-target import 65500:2
ESR(config-vrf)# exit
ESR(config)# 
ESR(config)# system jumbo-frames
ESR(config)# 
ESR(config)# vlan 100,200
ESR(config-vlan)# exit
ESR(config)# 
ESR(config)# router bgp 65500
ESR(config-bgp)#   router-id 10.10.1.2
ESR(config-bgp)#   neighbor 10.10.1.1
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     update-source 10.10.1.2
ESR(config-bgp-neighbor)#     address-family vpnv4 unicast
ESR(config-bgp-neighbor-af)#       send-community extended
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)#   vrf CE1
ESR(config-bgp-vrf)#     address-family ipv4 unicast
ESR(config-bgp-vrf-af)#       redistribute ospf 1 intra-area inter-area external1 external2
ESR(config-bgp-vrf-af)#     exit
ESR(config-bgp-vrf)#   exit
ESR(config-bgp)#   vrf CE2
ESR(config-bgp-vrf)#     address-family ipv4 unicast
ESR(config-bgp-vrf-af)#       redistribute ospf 1 intra-area inter-area external1 external2
ESR(config-bgp-vrf-af)#     exit
ESR(config-bgp-vrf)#   exit
ESR(config-bgp)# exit
ESR(config)# 
ESR(config)# router ospf log-adjacency-changes
ESR(config)# router ospf 1
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# router ospf 1 vrf CE1
ESR(config-ospf)#   redistribute bgp 65500
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# router ospf 1 vrf CE2
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# 
ESR(config)# bridge 10
ESR(config-bridge)#   ip vrf forwarding CE1
ESR(config-bridge)#   vlan 100
ESR(config-bridge)#   ip firewall disable
ESR(config-bridge)#   ip address 172.16.32.1/30
ESR(config-bridge)#   ip ospf instance 1
ESR(config-bridge)#   ip ospf
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# bridge 20
ESR(config-bridge)#   ip vrf forwarding CE2
ESR(config-bridge)#   vlan 200
ESR(config-bridge)#   ip firewall disable
ESR(config-bridge)#   ip address 172.16.32.5/30
ESR(config-bridge)#   ip ospf instance 1
ESR(config-bridge)#   ip ospf
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# 
ESR(config)# interface gigabitethernet 1/0/1
ESR(config-if-gi)#   description "to ASBR2"
ESR(config-if-gi)#   mode switchport
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   spanning-tree disable
ESR(config-if-gi)#   switchport forbidden default-vlan
ESR(config-if-gi)#   switchport mode trunk
ESR(config-if-gi)#   switchport trunk allowed vlan add 100,200
ESR(config-if-gi)# exit
ESR(config)# interface gigabitethernet 1/0/2
ESR(config-if-gi)#   description "to PE1"
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   ip firewall disable
ESR(config-if-gi)#   ip address 10.100.0.2/30
ESR(config-if-gi)#   ip ospf instance 1
ESR(config-if-gi)#   ip ospf
ESR(config-if-gi)# exit
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.10.1.2/32
ESR(config-loopback)#   ip ospf instance 1
ESR(config-loopback)#   ip ospf
ESR(config-loopback)# exit
ESR(config)# mpls
ESR(config-mpls)#   ldp
ESR(config-ldp)#     router-id 10.10.1.2
ESR(config-ldp)#     address-family ipv4
ESR(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ESR(config-ldp-af-ipv4-if)#       exit
ESR(config-ldp-af-ipv4)#     exit
ESR(config-ldp)#     enable
ESR(config-ldp)#   exit
ESR(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ESR(config-mpls)# exit
ESR(config)# do com
ESR(config)# do conf

...

Блок кода
titleASBR2
ESR(config)# hostname ASBR2
ESR(config)# 
ESR(config)# ip vrf CE1
ESR(config-vrf)#   ip protocols ospf max-routes 100
ESR(config-vrf)#   rd 65500:1
ESR(config-vrf)#   route-target export 65500:1
ESR(config-vrf)#   route-target import 65500:1
ESR(config-vrf)# exit
ESR(config)# ip vrf CE2
ESR(config-vrf)#   ip protocols ospf max-routes 100
ESR(config-vrf)#   rd 65500:2
ESR(config-vrf)#   route-target export 65500:2
ESR(config-vrf)#   route-target import 65500:2
ESR(config-vrf)# exit
ESR(config)# 
ESR(config)# system jumbo-frames
ESR(config)# 
ESR(config)# vlan 100,200
ESR(config-vlan)# exit
ESR(config)# 
ESR(config)# router bgp 65500
ESR(config-bgp)#   router-id 10.11.1.2
ESR(config-bgp)#   neighbor 10.11.1.1
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     update-source 10.11.1.2
ESR(config-bgp-neighbor)#     address-family vpnv4 unicast
ESR(config-bgp-neighbor-af)#       send-community extended
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)#   vrf CE1
ESR(config-bgp-vrf)#     address-family ipv4 unicast
ESR(config-bgp-vrf-af)#       redistribute ospf 1 intra-area inter-area external1 external2
ESR(config-bgp-vrf-af)#     exit
ESR(config-bgp-vrf)#   exit
ESR(config-bgp)#   vrf CE2
ESR(config-bgp-vrf)#     address-family ipv4 unicast
ESR(config-bgp-vrf-af)#       redistribute ospf 1 intra-area inter-area external1 external2
ESR(config-bgp-vrf-af)#     exit
ESR(config-bgp-vrf)#   exit
ESR(config-bgp)# exit
ESR(config)# 
ESR(config)# router ospf log-adjacency-changes
ESR(config)# router ospf 1
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# router ospf 1 vrf CE1
ESR(config-ospf)#   redistribute bgp 65500
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# router ospf 1 vrf CE2
ESR(config-ospf)#   redistribute bgp 65500
ESR(config-ospf)#   area 0.0.0.0
ESR(config-ospf-area)#     enable
ESR(config-ospf-area)#   exit
ESR(config-ospf)#   enable
ESR(config-ospf)# exit
ESR(config)# 
ESR(config)# bridge 10
ESR(config-bridge)#   ip vrf forwarding CE1
ESR(config-bridge)#   vlan 100
ESR(config-bridge)#   ip firewall disable
ESR(config-bridge)#   ip address 172.16.32.2/30
ESR(config-bridge)#   ip ospf instance 1
ESR(config-bridge)#   ip ospf
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# bridge 20
ESR(config-bridge)#   ip vrf forwarding CE2
ESR(config-bridge)#   vlan 200
ESR(config-bridge)#   ip firewall disable
ESR(config-bridge)#   ip address 172.16.32.6/30
ESR(config-bridge)#   ip ospf instance 1
ESR(config-bridge)#   ip ospf
ESR(config-bridge)#   enable
ESR(config-bridge)# exit
ESR(config)# 
ESR(config)# interface gigabitethernet 1/0/1
ESR(config-if-gi)#   description "to ASBR1"
ESR(config-if-gi)#   mode switchport
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   spanning-tree disable
ESR(config-if-gi)#   switchport forbidden default-vlan
ESR(config-if-gi)#   switchport mode trunk
ESR(config-if-gi)#   switchport trunk allowed vlan add 100,200
ESR(config-if-gi)# exit
ESR(config)# interface gigabitethernet 1/0/2
ESR(config-if-gi)#   description "to PE2"
ESR(config-if-gi)#   mtu 1522
ESR(config-if-gi)#   ip firewall disable
ESR(config-if-gi)#   ip address 10.101.0.2/30
ESR(config-if-gi)#   ip ospf instance 1
ESR(config-if-gi)#   ip ospf
ESR(config-if-gi)# exit
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.11.1.2/32
ESR(config-loopback)#   ip ospf instance 1
ESR(config-loopback)#   ip ospf
ESR(config-loopback)# exit
ESR(config)# mpls
ESR(config-mpls)#   ldp
ESR(config-ldp)#     router-id 10.11.1.2
ESR(config-ldp)#     address-family ipv4
ESR(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ESR(config-ldp-af-ipv4-if)#       exit
ESR(config-ldp-af-ipv4)#     exit
ESR(config-ldp)#     enable
ESR(config-ldp)#   exit
ESR(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ESR(config-mpls)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titleСE1
ESR(config)# hostname CE1
ESR(config)# 
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp 65501
ESR(config-bgp)#   neighbor 192.168.1.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     address-family ipv4 unicast
ESR(config-bgp-neighbor-af)#       route-map BGP out
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   address-family ipv4 unicast
ESR(config-bgp-af)#     network 10.110.0.1/32
ESR(config-bgp-af)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.1.1/30
ESR(config-subif)# exit 
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.110.0.1/32
ESR(config-loopback)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titleCE2
ESR(config)# hostname CE2
ESR(config)# 
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp 65501
ESR(config-bgp)#   neighbor 192.168.2.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     address-family ipv4 unicast
ESR(config-bgp-neighbor-af)#       route-map BGP out
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   address-family ipv4 unicast
ESR(config-bgp-af)#     network 10.112.0.1/32
ESR(config-bgp-af)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.2.1/30
ESR(config-subif)# exit
ESR(config)# 
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.112.0.1/32
ESR(config-loopback)# exit
ESR(config)# do com 
ESR(config)# do conf

...

Блок кода
titleCE3
ESR(config)# hostname CE3
ESR(config)#
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp 65501
ESR(config-bgp)#   neighbor 192.168.3.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     address-family ipv4 unicast
ESR(config-bgp-neighbor-af)#       route-map BGP out
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   address-family ipv4 unicast
ESR(config-bgp-af)#     network 10.113.0.1/32
ESR(config-bgp-af)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.3.1/30
ESR(config-subif)# exit
ESR(config)#
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.113.0.1/32
ESR(config-loopback)# exit
ESR(config)# do com
ESR(config)# do conf

...

Блок кода
titleCE4
ESR(config)# hostname CE4
ESR(config)#
ESR(config)# route-map BGP
ESR(config-route-map)#   rule 1
ESR(config-route-map-rule)#   exit
ESR(config-route-map)# exit
ESR(config)# router bgp 65501
ESR(config-bgp)#   neighbor 192.168.4.2
ESR(config-bgp-neighbor)#     remote-as 65500
ESR(config-bgp-neighbor)#     address-family ipv4 unicast
ESR(config-bgp-neighbor-af)#       route-map BGP out
ESR(config-bgp-neighbor-af)#       enable
ESR(config-bgp-neighbor-af)#     exit
ESR(config-bgp-neighbor)#     enable
ESR(config-bgp-neighbor)#   exit
ESR(config-bgp)#   address-family ipv4 unicast
ESR(config-bgp-af)#     network 10.114.0.1/32
ESR(config-bgp-af)#   exit
ESR(config-bgp)#   enable
ESR(config-bgp)# exit
ESR(config)# interface gigabitethernet 1/0/1.100
ESR(config-subif)#   ip firewall disable
ESR(config-subif)#   ip address 192.168.4.1/30
ESR(config-subif)# exit
ESR(config)#
ESR(config)# interface loopback 1
ESR(config-loopback)#   ip address 10.114.0.1/32
ESR(config-loopback)# exit
ESR(config)# do com
ESR(config)# do conf

...

Блок кода
titlePE2
PE2(config)# hostname PE2
PE2(config)# 
PE2(config)# ip vrf CE1
PE2(config-vrf)#   ip protocols bgp max-routes 100
PE2(config-vrf)#   rd 65501:1
PE2(config-vrf)#   route-target export 65501:1
PE2(config-vrf)#   route-target import 65501:1
PE2(config-vrf)# exit
PE2(config)# ip vrf CE2
PE2(config-vrf)#   ip protocols bgp max-routes 100
PE2(config-vrf)#   rd 65501:2
PE2(config-vrf)#   route-target export 65501:2
PE2(config-vrf)#   route-target import 65501:2
PE2(config-vrf)# exit
PE2(config)# 
PE2(config)# system jumbo-frames
PE2(config)# 
PE2(config)# route-map BGP_OUT
PE2(config-route-map)#   rule 1
PE2(config-route-map-rule)#   exit
PE2(config-route-map)# exit
PE2(config)# router bgp 65500
PE2(config-bgp)#   neighbor 10.11.1.2
PE2(config-bgp-neighbor)#     remote-as 65500
PE2(config-bgp-neighbor)#     update-source 10.11.1.1
PE2(config-bgp-neighbor)#     address-family vpnv4 unicast
PE2(config-bgp-neighbor-af)#       send-community extended
PE2(config-bgp-neighbor-af)#       enable
PE2(config-bgp-neighbor-af)#     exit
PE2(config-bgp-neighbor)#     enable
PE2(config-bgp-neighbor)#   exit
PE2(config-bgp)#   enable
PE2(config-bgp)#   vrf CE1
PE2(config-bgp-vrf)#     neighbor 192.168.3.1
PE2(config-bgp-vrf-neighbor)#       remote-as 65512
PE2(config-bgp-vrf-neighbor)#       address-family ipv4 unicast
PE2(config-bgp-neighbor-af-vrf)#         route-map BGP_OUT out
PE2(config-bgp-neighbor-af-vrf)#         enable
PE2(config-bgp-neighbor-af-vrf)#       exit
PE2(config-bgp-vrf-neighbor)#       enable
PE2(config-bgp-vrf-neighbor)#     exit
PE2(config-bgp-vrf)#     address-family ipv4 unicast
PE2(config-bgp-vrf-af)#       redistribute bgp 65500 route-map BGP_OUT
PE2(config-bgp-vrf-af)#     exit
PE2(config-bgp-vrf)#     enable
PE2(config-bgp-vrf)#   exit
PE2(config-bgp)#   vrf CE2
PE2(config-bgp-vrf)#     neighbor 192.168.4.1
PE2(config-bgp-vrf-neighbor)#       remote-as 65513
PE2(config-bgp-vrf-neighbor)#       address-family ipv4 unicast
PE2(config-bgp-neighbor-af-vrf)#         route-map BGP_OUT out
PE2(config-bgp-neighbor-af-vrf)#         enable
PE2(config-bgp-neighbor-af-vrf)#       exit
PE2(config-bgp-vrf-neighbor)#       enable
PE2(config-bgp-vrf-neighbor)#     exit
PE2(config-bgp-vrf)#     address-family ipv4 unicast
PE2(config-bgp-vrf-af)#       redistribute bgp 65500 route-map BGP_OUT
PE2(config-bgp-vrf-af)#     exit
PE2(config-bgp-vrf)#     enable
PE2(config-bgp-vrf)#   exit
PE2(config-bgp)# exit
PE2(config)# 
PE2(config)# router ospf 1
PE2(config-ospf)#   router-id 10.11.1.1
PE2(config-ospf)#   area 0.0.0.0
PE2(config-ospf-area)#     enable
PE2(config-ospf-area)#   exit
PE2(config-ospf)#   enable
PE2(config-ospf)# exit
PE2(config)# 
PE2(config)# interface gigabitethernet 1/0/1.100
PE2(config-subif)#   ip vrf forwarding CE1
PE2(config-subif)#   description "to CE3"
PE2(config-subif)#   ip firewall disable
PE2(config-subif)#   ip address 192.168.3.2/30
PE2(config-subif)# exit
PE2(config)# interface gigabitethernet 1/0/1.200
PE2(config-subif)#   ip vrf forwarding CE2
PE2(config-subif)#   description "CE4"
PE2(config-subif)#   ip firewall disable
PE2(config-subif)#   ip address 192.168.4.2/30
PE2(config-subif)# exit
PE2(config)# interface gigabitethernet 1/0/2
PE2(config-if-gi)#   description "to ASBR2"
PE2(config-if-gi)#   mtu 1522
PE2(config-if-gi)#   ip firewall disable
PE2(config-if-gi)#   ip address 10.102.0.1/30
PE2(config-if-gi)#   ip ospf instance 1
PE2(config-if-gi)#   ip ospf
PE2(config-if-gi)# exit
PE2(config)# interface loopback 1
PE2(config-loopback)#   ip address 10.11.1.1/32
PE2(config-loopback)#   ip ospf instance 1
PE2(config-loopback)#   ip ospf
PE2(config-loopback)# exit
PE2(config)# mpls
PE2(config-mpls)#   ldp
PE2(config-ldp)#     router-id 10.11.1.1
PE2(config-ldp)#     address-family ipv4
PE2(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
PE2(config-ldp-af-ipv4-if)#       exit
PE2(config-ldp-af-ipv4)#     exit
PE2(config-ldp)#     enable
PE2(config-ldp)#   exit
PE2(config-mpls)#   forwarding interface gigabitethernet 1/0/2
PE2(config-mpls)# exit
PE2(config)# do com
PE2(config)# do conf

...

Блок кода
titleASBR1
ASBR1(config)# hostname ASBR1
ASBR1(config)# 
ASBR1(config)# system jumbo-frames
ASBR1(config)# 
ASBR1(config)# route-map VPNv4
ASBR1(config-route-map)#   rule 1
ASBR1(config-route-map-rule)#   exit
ASBR1(config-route-map)# exit
ASBR1(config)# router bgp 65501
ASBR1(config-bgp)#   router-id 10.10.1.2
ASBR1(config-bgp)#   neighbor 10.10.1.1
ASBR1(config-bgp-neighbor)#     remote-as 65501
ASBR1(config-bgp-neighbor)#     update-source 10.10.1.2
ASBR1(config-bgp-neighbor)#     address-family vpnv4 unicast
ASBR1(config-bgp-neighbor-af)#       next-hop-self
ASBR1(config-bgp-neighbor-af)#       send-community extended
ASBR1(config-bgp-neighbor-af)#       enable
ASBR1(config-bgp-neighbor-af)#     exit
ASBR1(config-bgp-neighbor)#     enable
ASBR1(config-bgp-neighbor)#   exit
ASBR1(config-bgp)#   neighbor 10.101.0.1
ASBR1(config-bgp-neighbor)#     remote-as 65500
ASBR1(config-bgp-neighbor)#     address-family vpnv4 unicast
ASBR1(config-bgp-neighbor-af)#       route-map VPNv4 out
ASBR1(config-bgp-neighbor-af)#       send-community extended
ASBR1(config-bgp-neighbor-af)#       enable
ASBR1(config-bgp-neighbor-af)#     exit
ASBR1(config-bgp-neighbor)#     enable
ASBR1(config-bgp-neighbor)#   exit
ASBR1(config-bgp)#   enable
ASBR1(config-bgp)# exit
ASBR1(config)# 
ASBR1(config)# router ospf 1
ASBR1(config-ospf)#   area 0.0.0.0
ASBR1(config-ospf-area)#     enable
ASBR1(config-ospf-area)#   exit
ASBR1(config-ospf)#   enable
ASBR1(config-ospf)# exit
ASBR1(config)# 
ASBR1(config)# interface gigabitethernet 1/0/1
ASBR1(config-if-gi)#   description "to ASBR2"
ASBR1(config-if-gi)#   ip firewall disable
ASBR1(config-if-gi)#   ip address 10.101.0.2/30
ASBR1(config-if-gi)# exit
ASBR1(config)# interface gigabitethernet 1/0/2
ASBR1(config-if-gi)#   description "to PE1"
ASBR1(config-if-gi)#   mtu 1522
ASBR1(config-if-gi)#   ip firewall disable
ASBR1(config-if-gi)#   ip address 10.100.0.2/30
ASBR1(config-if-gi)#   ip ospf instance 1
ASBR1(config-if-gi)#   ip ospf
ASBR1(config-if-gi)# exit
ASBR1(config)# interface loopback 1
ASBR1(config-loopback)#   ip address 10.10.1.2/32
ASBR1(config-loopback)#   ip ospf instance 1
ASBR1(config-loopback)#   ip ospf
ASBR1(config-loopback)# exit
ASBR1(config)# mpls
ASBR1(config-mpls)#   ldp
ASBR1(config-ldp)#     router-id 10.10.1.2
ASBR1(config-ldp)#     address-family ipv4
ASBR1(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ASBR1(config-ldp-af-ipv4-if)#       exit
ASBR1(config-ldp-af-ipv4)#     exit
ASBR1(config-ldp)#     enable
ASBR1(config-ldp)#   exit
ASBR1(config-mpls)#   forwarding interface gigabitethernet 1/0/1
ASBR1(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ASBR1(config-mpls)# exit
ASBR1(config)# do com
ASBR1(config)# do conf

...

Блок кода
titleASBR2
ASBR2(config)# hostname ASBR2
ASBR2(config)# 
ASBR2(config)# system jumbo-frames
ASBR2(config)# 
ASBR2(config)# route-map VPNv4
ASBR2(config-route-map)#   rule 1
ASBR2(config-route-map-rule)#   exit
ASBR2(config-route-map)# exit
ASBR2(config)# router bgp 65500
ASBR2(config-bgp)#   router-id 10.11.1.2
ASBR2(config-bgp)#   neighbor 10.101.0.2
ASBR2(config-bgp-neighbor)#     remote-as 65501
ASBR2(config-bgp-neighbor)#     address-family vpnv4 unicast
ASBR2(config-bgp-neighbor-af)#       route-map VPNv4 out
ASBR2(config-bgp-neighbor-af)#       send-community extended
ASBR2(config-bgp-neighbor-af)#       enable
ASBR2(config-bgp-neighbor-af)#     exit
ASBR2(config-bgp-neighbor)#     enable
ASBR2(config-bgp-neighbor)#   exit
ASBR2(config-bgp)#   neighbor 10.11.1.1
ASBR2(config-bgp-neighbor)#     remote-as 65500
ASBR2(config-bgp-neighbor)#     update-source 10.11.1.2
ASBR2(config-bgp-neighbor)#     address-family vpnv4 unicast
ASBR2(config-bgp-neighbor-af)#       next-hop-self
ASBR2(config-bgp-neighbor-af)#       send-community extended
ASBR2(config-bgp-neighbor-af)#       enable
ASBR2(config-bgp-neighbor-af)#     exit
ASBR2(config-bgp-neighbor)#     enable
ASBR2(config-bgp-neighbor)#   exit
ASBR2(config-bgp)#   enable
ASBR2(config-bgp)# exit
ASBR2(config)# 
ASBR2(config)# router ospf 1
ASBR2(config-ospf)#   router-id 10.11.1.2
ASBR2(config-ospf)#   area 0.0.0.0
ASBR2(config-ospf-area)#     enable
ASBR2(config-ospf-area)#   exit
ASBR2(config-ospf)#   enable
ASBR2(config-ospf)# exit
ASBR2(config)# 
ASBR2(config)# interface gigabitethernet 1/0/1
ASBR2(config-if-gi)#   description "to ASBR1"
ASBR2(config-if-gi)#   ip firewall disable
ASBR2(config-if-gi)#   ip address 10.101.0.1/30
ASBR2(config-if-gi)# exit
ASBR2(config)# interface gigabitethernet 1/0/2
ASBR2(config-if-gi)#   description "to PE2"
ASBR2(config-if-gi)#   mtu 1522
ASBR2(config-if-gi)#   ip firewall disable
ASBR2(config-if-gi)#   ip address 10.102.0.2/30
ASBR2(config-if-gi)#   ip ospf instance 1
ASBR2(config-if-gi)#   ip ospf
ASBR2(config-if-gi)# exit
ASBR2(config)# interface loopback 1
ASBR2(config-loopback)#   ip address 10.11.1.2/32
ASBR2(config-loopback)#   ip ospf instance 1
ASBR2(config-loopback)#   ip ospf
ASBR2(config-loopback)# exit
ASBR2(config)# mpls
ASBR2(config-mpls)#   ldp
ASBR2(config-ldp)#     router-id 10.11.1.2
ASBR2(config-ldp)#     address-family ipv4
ASBR2(config-ldp-af-ipv4)#       interface gigabitethernet 1/0/2
ASBR2(config-ldp-af-ipv4-if)#       exit
ASBR2(config-ldp-af-ipv4)#     exit
ASBR2(config-ldp)#     enable
ASBR2(config-ldp)#   exit
ASBR2(config-mpls)#   forwarding interface gigabitethernet 1/0/1
ASBR2(config-mpls)#   forwarding interface gigabitethernet 1/0/2
ASBR2(config-mpls)# exit
ASBR2(config)# do com
ASBR2(config)# do conf

...

Блок кода
titleESR1
ESR1(config)# hostname ESR1
ESR1(config)# 
ESR1(config)# system cpu load-balance mpls passenger ip
ESR1(config)# system cpu load-balance mpls passenger ipoe-pw-without-cw
ESR1(config)# security zone trusted
ESR1(config-zone)# exit
ESR1(config)# security zone untrusted
ESR1(config-zone)# exit
ESR1(config)# 
ESR1(config)# router ospf 1
ESR1(config-ospf)#   area 0.0.0.0
ESR1(config-ospf-area)#     enable
ESR1(config-ospf-area)#   exit
ESR1(config-ospf)#   enable
ESR1(config-ospf)# exit
ESR1(config)# 
ESR1(config)# interface gigabitethernet 1/0/1
ESR1(config-if-gi)#   security-zone untrusted
ESR1(config-if-gi)#   ip address 192.0.2.1/30
ESR1(config-if-gi)# exit
ESR1(config)# interface gigabitethernet 1/0/2
ESR1(config-if-gi)#   description "From CE1"
ESR1(config-if-gi)#   mode switchport
ESR1(config-if-gi)# exit
ESR1(config)# interface loopback 1
ESR1(config-loopback)#   ip address 10.100.0.1/32
ESR1(config-loopback)#   ip ospf instance 1
ESR1(config-loopback)#   ip ospf
ESR1(config-loopback)# exit
ESR1(config)# tunnel gre 1
ESR1(config-gre)#   key 60
ESR1(config-gre)#   ttl 64
ESR1(config-gre)#   mtu 1458
ESR1(config-gre)#   ip firewall disable
ESR1(config-gre)#   local address 192.0.2.1
ESR1(config-gre)#   remote address 192.0.2.2
ESR1(config-gre)#   ip address 10.0.0.1/30
ESR1(config-gre)#   ip ospf instance 1
ESR1(config-gre)#   ip ospf network point-to-point
ESR1(config-gre)#   ip ospf
ESR1(config-gre)#   enable
ESR1(config-gre)# exit
ESR1(config)# 
ESR1(config)# mpls
ESR1(config-mpls)#   ldp
ESR1(config-ldp)#     router-id 10.100.0.1
ESR1(config-ldp)#     address-family ipv4
ESR1(config-ldp-af-ipv4)#       interface gre 1
ESR1(config-ldp-af-ipv4-if)#       exit
ESR1(config-ldp-af-ipv4)#     exit
ESR1(config-ldp)#     enable
ESR1(config-ldp)#   exit
ESR1(config-mpls)#   l2vpn
ESR1(config-l2vpn)#     pw-class VPWS
ESR1(config-l2vpn-pw-class)#     exit
ESR1(config-l2vpn)#     p2p EoMPLS
ESR1(config-l2vpn-p2p)#       interface gigabitethernet 1/0/2
ESR1(config-l2vpn-p2p)#       pw 100 10.100.0.2
ESR1(config-l2vpn-pw)#         pw-class VPWS
ESR1(config-l2vpn-pw)#         enable
ESR1(config-l2vpn-pw)#       exit
ESR1(config-l2vpn-p2p)#       enable
ESR1(config-l2vpn-p2p)#     exit
ESR1(config-l2vpn)#   exit
ESR1(config-mpls)#   forwarding interface gre 1
ESR1(config-mpls)# exit
ESR1(config)# security zone-pair untrusted self
ESR1(config-zone-pair)#   rule 1
ESR1(config-zone-pair-rule)#     action permit
ESR1(config-zone-pair-rule)#     match protocol gre
ESR1(config-zone-pair-rule)#     enable
ESR1(config-zone-pair-rule)#   exit
ESR1(config-zone-pair)# exit
ESR1(config)# do com
ESR1(config)# do conf

...

Блок кода
titleESR2
ESR2(config)# hostname ESR2
ESR2(config)# 
ESR2(config)# system cpu load-balance mpls passenger ip
ESR2(config)# system cpu load-balance mpls passenger ipoe-pw-without-cw
ESR2(config)# security zone trusted
ESR2(config-zone)# exit
ESR2(config)# security zone untrusted
ESR2(config-zone)# exit
ESR2(config)# 
ESR2(config)# router ospf 1
ESR2(config-ospf)#   area 0.0.0.0
ESR2(config-ospf-area)#     enable
ESR2(config-ospf-area)#   exit
ESR2(config-ospf)#   enable
ESR2(config-ospf)# exit
ESR2(config)# 
ESR2(config)# interface gigabitethernet 1/0/1
ESR2(config-if-gi)#   security-zone untrusted
ESR2(config-if-gi)#   ip address 192.0.2.2/30
ESR2(config-if-gi)# exit
ESR2(config)# interface gigabitethernet 1/0/2
ESR2(config-if-gi)#   description "From CE2"
ESR2(config-if-gi)#   mode switchport
ESR2(config-if-gi)# exit
ESR2(config)# interface loopback 1
ESR2(config-loopback)#   ip address 10.100.0.2/32
ESR2(config-loopback)#   ip ospf instance 1
ESR2(config-loopback)#   ip ospf
ESR2(config-loopback)# exit
ESR2(config)# tunnel gre 1
ESR2(config-gre)#   key 60
ESR2(config-gre)#   ttl 64
ESR2(config-gre)#   mtu 1458
ESR2(config-gre)#   ip firewall disable
ESR2(config-gre)#   local address 192.0.2.2
ESR2(config-gre)#   remote address 192.0.2.1
ESR2(config-gre)#   ip address 10.0.0.2/30
ESR2(config-gre)#   ip ospf instance 1
ESR2(config-gre)#   ip ospf network point-to-point
ESR2(config-gre)#   ip ospf
ESR2(config-gre)#   enable
ESR2(config-gre)# exit
ESR2(config)# 
ESR2(config)# mpls
ESR2(config-mpls)#   ldp
ESR2(config-ldp)#     router-id 10.100.0.2
ESR2(config-ldp)#     address-family ipv4
ESR2(config-ldp-af-ipv4)#       interface gre 1
ESR2(config-ldp-af-ipv4-if)#       exit
ESR2(config-ldp-af-ipv4)#     exit
ESR2(config-ldp)#     enable
ESR2(config-ldp)#   exit
ESR2(config-mpls)#   l2vpn
ESR2(config-l2vpn)#     pw-class VPWS
ESR2(config-l2vpn-pw-class)#     exit
ESR2(config-l2vpn)#     p2p EoMPLS
ESR2(config-l2vpn-p2p)#       interface gigabitethernet 1/0/2
ESR2(config-l2vpn-p2p)#       pw 100 10.100.0.1
ESR2(config-l2vpn-pw)#         pw-class VPWS
ESR2(config-l2vpn-pw)#         enable
ESR2(config-l2vpn-pw)#       exit
ESR2(config-l2vpn-p2p)#       enable
ESR2(config-l2vpn-p2p)#     exit
ESR2(config-l2vpn)#   exit
ESR2(config-mpls)#   forwarding interface gre 1
ESR2(config-mpls)# exit
ESR2(config)# security zone-pair untrusted self
ESR2(config-zone-pair)#   rule 1
ESR2(config-zone-pair-rule)#     action deny
ESR2(config-zone-pair-rule)#     match protocol gre
ESR2(config-zone-pair-rule)#     enable
ESR2(config-zone-pair-rule)#   exit
ESR2(config-zone-pair)# exit
ESR2(config)# do com
ESR2(config)# do conf

...

Блок кода
titleCE1
CE1(config)# hostname CE1
CE1(config)# 
CE1(config)# route-map BGP_OUT
CE1(config-route-map)#   rule 1
CE1(config-route-map-rule)#   exit
CE1(config-route-map)# exit
CE1(config)# router bgp 65501
CE1(config-bgp)#   neighbor 10.10.0.2
CE1(config-bgp-neighbor)#     remote-as 65500
CE1(config-bgp-neighbor)#     address-family ipv4 unicast
CE1(config-bgp-neighbor-af)#       route-map BGP_OUT out
CE1(config-bgp-neighbor-af)#       enable
CE1(config-bgp-neighbor-af)#     exit
CE1(config-bgp-neighbor)#     enable
CE1(config-bgp-neighbor)#   exit
CE1(config-bgp)#   address-family ipv4 unicast
CE1(config-bgp-af)#     network 10.100.0.0/24
CE1(config-bgp-af)#   exit
CE1(config-bgp)#   enable
CE1(config-bgp)# exit
CE1(config)# 
CE1(config)# 
CE1(config)# interface gigabitethernet 1/0/2
CE1(config-if-gi)#   description "to ESR1"
CE1(config-if-gi)#   ip firewall disable
CE1(config-if-gi)#   ip address 10.10.0.1/30
CE1(config-if-gi)# exit
CE1(config)# interface loopback 1
CE1(config-loopback)#   ip address 10.100.0.1/24
CE1(config-loopback)# exit

...

Блок кода
titleCE2
CE2(config)# hostname CE2
CE2(config)# 
CE2(config)# route-map BGP_OUT
CE2(config-route-map)#   rule 1
CE2(config-route-map-rule)#   exit
CE2(config-route-map)# exit
CE2(config)# router bgp 65502
CE2(config-bgp)#   neighbor 10.10.0.5
CE2(config-bgp-neighbor)#     remote-as 65500
CE2(config-bgp-neighbor)#     address-family ipv4 unicast
CE2(config-bgp-neighbor-af)#       route-map BGP_OUT out
CE2(config-bgp-neighbor-af)#       enable
CE2(config-bgp-neighbor-af)#     exit
CE2(config-bgp-neighbor)#     enable
CE2(config-bgp-neighbor)#   exit
CE2(config-bgp)#   address-family ipv4 unicast
CE2(config-bgp-af)#     network 10.101.0.0/24
CE2(config-bgp-af)#   exit
CE2(config-bgp)#   enable
CE2(config-bgp)# exit
CE2(config)# 
CE2(config)# 
CE2(config)# interface gigabitethernet 1/0/2
CE2(config-if-gi)#   description "to ESR2"
CE2(config-if-gi)#   ip firewall disable
CE2(config-if-gi)#   ip address 10.10.0.6/30
CE2(config-if-gi)# exit
CE2(config)# interface loopback 1
CE2(config-loopback)#   ip address 10.101.0.1/24
CE2(config-loopback)# exit

...

Блок кода
titleESR1
ESR1(config)# hostname ESR1
ESR1(config)# 
ESR1(config)# ip vrf l3vpn_service
ESR1(config-vrf)#   ip protocols bgp max-routes 100
ESR1(config-vrf)#   rd 65500:1
ESR1(config-vrf)#   route-target export 65500:1
ESR1(config-vrf)#   route-target import 65500:1
ESR1(config-vrf)# exit
ESR1(config)# 
ESR1(config)# 
ESR1(config)# system cpu load-balance mpls passenger ip
ESR1(config)# security zone untrusted
ESR1(config-zone)# exit
ESR1(config)# security zone trusted
ESR1(config-zone)# exit
ESR1(config)# 
ESR1(config)# route-map BGP_OUT
ESR1(config-route-map)#   rule 1
ESR1(config-route-map-rule)#   exit
ESR1(config-route-map)# exit
ESR1(config)# router bgp 65500
ESR1(config-bgp)#   router-id 10.12.0.1
ESR1(config-bgp)#   neighbor 10.12.0.2
ESR1(config-bgp-neighbor)#     remote-as 65500
ESR1(config-bgp-neighbor)#     update-source 10.12.0.1
ESR1(config-bgp-neighbor)#     address-family vpnv4 unicast
ESR1(config-bgp-neighbor-af)#       send-community extended
ESR1(config-bgp-neighbor-af)#       enable
ESR1(config-bgp-neighbor-af)#     exit
ESR1(config-bgp-neighbor)#     enable
ESR1(config-bgp-neighbor)#   exit
ESR1(config-bgp)#   enable
ESR1(config-bgp)#   vrf l3vpn_service
ESR1(config-bgp-vrf)#     neighbor 10.10.0.1
ESR1(config-bgp-vrf-neighbor)#       remote-as 65501
ESR1(config-bgp-vrf-neighbor)#       address-family ipv4 unicast
ESR1(config-bgp-neighbor-af-vrf)#         route-map BGP_OUT out
ESR1(config-bgp-neighbor-af-vrf)#         enable
ESR1(config-bgp-neighbor-af-vrf)#       exit
ESR1(config-bgp-vrf-neighbor)#       enable
ESR1(config-bgp-vrf-neighbor)#     exit
ESR1(config-bgp-vrf)#     address-family ipv4 unicast
ESR1(config-bgp-vrf-af)#       redistribute bgp 65500 route-map BGP_OUT
ESR1(config-bgp-vrf-af)#     exit
ESR1(config-bgp-vrf)#     enable
ESR1(config-bgp-vrf)#   exit
ESR1(config-bgp)# exit
ESR1(config)# 
ESR1(config)# router ospf 1
ESR1(config-ospf)#   router-id 10.12.0.1
ESR1(config-ospf)#   area 0.0.0.0
ESR1(config-ospf-area)#     enable
ESR1(config-ospf-area)#   exit
ESR1(config-ospf)#   enable
ESR1(config-ospf)# exit
ESR1(config)# 
ESR1(config)# interface gigabitethernet 1/0/1
ESR1(config-if-gi)#   security-zone untrusted
ESR1(config-if-gi)#   ip address 192.0.2.1/30
ESR1(config-if-gi)# exit
ESR1(config)# interface gigabitethernet 1/0/2
ESR1(config-if-gi)#   ip vrf forwarding l3vpn_service
ESR1(config-if-gi)#   description "from CE1"
ESR1(config-if-gi)#   ip firewall disable
ESR1(config-if-gi)#   ip address 10.10.0.2/30
ESR1(config-if-gi)# exit
ESR1(config)# interface loopback 1
ESR1(config-loopback)#   ip address 10.12.0.1/32
ESR1(config-loopback)#   ip ospf instance 1
ESR1(config-loopback)#   ip ospf
ESR1(config-loopback)# exit
ESR1(config)# tunnel gre 1
ESR1(config-gre)#   key 60
ESR1(config-gre)#   ttl 64
ESR1(config-gre)#   mtu 1472
ESR1(config-gre)#   ip firewall disable
ESR1(config-gre)#   local address 192.0.2.1
ESR1(config-gre)#   remote address 192.0.2.2
ESR1(config-gre)#   ip address 10.11.0.1/30
ESR1(config-gre)#   ip ospf instance 1
ESR1(config-gre)#   ip ospf
ESR1(config-gre)#   enable
ESR1(config-gre)# exit
ESR1(config)# 
ESR1(config)# mpls
ESR1(config-mpls)#   ldp
ESR1(config-ldp)#     router-id 10.12.0.1
ESR1(config-ldp)#     address-family ipv4
ESR1(config-ldp-af-ipv4)#       interface gre 1
ESR1(config-ldp-af-ipv4-if)#       exit
ESR1(config-ldp-af-ipv4)#     exit
ESR1(config-ldp)#     enable
ESR1(config-ldp)#   exit
ESR1(config-mpls)#   forwarding interface gre 1
ESR1(config-mpls)# exit
ESR1(config)# security zone-pair untrusted self
ESR1(config-zone-pair)#   rule 1
ESR1(config-zone-pair-rule)#     action permit
ESR1(config-zone-pair-rule)#     match protocol gre
ESR1(config-zone-pair-rule)#     enable
ESR1(config-zone-pair-rule)#   exit
ESR1(config-zone-pair)# exit

...

Блок кода
ESR2(config)# hostname ESR2
ESR2(config)# 
ESR2(config)# ip vrf l3vpn_service
ESR2(config-vrf)#   ip protocols bgp max-routes 100
ESR2(config-vrf)#   rd 65500:1
ESR2(config-vrf)#   route-target export 65500:1
ESR2(config-vrf)#   route-target import 65500:1
ESR2(config-vrf)# exit
ESR2(config)# 
ESR2(config)# 
ESR2(config)# system cpu load-balance mpls passenger ip
ESR2(config)# security zone untrusted
ESR2(config-zone)# exit
ESR2(config)# security zone trusted
ESR2(config-zone)# exit
ESR2(config)# 
ESR2(config)# route-map BGP_OUT
ESR2(config-route-map)#   rule 1
ESR2(config-route-map-rule)#   exit
ESR2(config-route-map)# exit
ESR2(config)# router bgp 65500
ESR2(config-bgp)#   router-id 10.12.0.2
ESR2(config-bgp)#   neighbor 10.12.0.1
ESR2(config-bgp-neighbor)#     remote-as 65500
ESR2(config-bgp-neighbor)#     update-source 10.12.0.2
ESR2(config-bgp-neighbor)#     address-family vpnv4 unicast
ESR2(config-bgp-neighbor-af)#       send-community extended
ESR2(config-bgp-neighbor-af)#       enable
ESR2(config-bgp-neighbor-af)#     exit
ESR2(config-bgp-neighbor)#     enable
ESR2(config-bgp-neighbor)#   exit
ESR2(config-bgp)#   enable
ESR2(config-bgp)#   vrf l3vpn_service
ESR2(config-bgp-vrf)#     neighbor 10.10.0.6
ESR2(config-bgp-vrf-neighbor)#       remote-as 65502
ESR2(config-bgp-vrf-neighbor)#       address-family ipv4 unicast
ESR2(config-bgp-neighbor-af-vrf)#         route-map BGP_OUT out
ESR2(config-bgp-neighbor-af-vrf)#         enable
ESR2(config-bgp-neighbor-af-vrf)#       exit
ESR2(config-bgp-vrf-neighbor)#       enable
ESR2(config-bgp-vrf-neighbor)#     exit
ESR2(config-bgp-vrf)#     address-family ipv4 unicast
ESR2(config-bgp-vrf-af)#       redistribute bgp 65500 route-map BGP_OUT
ESR2(config-bgp-vrf-af)#     exit
ESR2(config-bgp-vrf)#     enable
ESR2(config-bgp-vrf)#   exit
ESR2(config-bgp)# exit
ESR2(config)# 
ESR2(config)# router ospf 1
ESR2(config-ospf)#   router-id 10.12.0.2
ESR2(config-ospf)#   area 0.0.0.0
ESR2(config-ospf-area)#     enable
ESR2(config-ospf-area)#   exit
ESR2(config-ospf)#   enable
ESR2(config-ospf)# exit
ESR2(config)# 
ESR2(config)# interface gigabitethernet 1/0/1
ESR2(config-if-gi)#   security-zone untrusted
ESR2(config-if-gi)#   ip address 192.0.2.2/30
ESR2(config-if-gi)# exit
ESR2(config)# interface gigabitethernet 1/0/2
ESR2(config-if-gi)#   ip vrf forwarding l3vpn_service
ESR2(config-if-gi)#   description "from CE2"
ESR2(config-if-gi)#   ip firewall disable
ESR2(config-if-gi)#   ip address 10.10.0.5/30
ESR2(config-if-gi)# exit
ESR2(config)# interface loopback 1
ESR2(config-loopback)#   ip address 10.12.0.2/32
ESR2(config-loopback)#   ip ospf instance 1
ESR2(config-loopback)#   ip ospf
ESR2(config-loopback)# exit
ESR2(config)# tunnel gre 1
ESR2(config-gre)#   key 60
ESR2(config-gre)#   ttl 64
ESR2(config-gre)#   mtu 1472
ESR2(config-gre)#   ip firewall disable
ESR2(config-gre)#   local address 192.0.2.2
ESR2(config-gre)#   remote address 192.0.2.1
ESR2(config-gre)#   ip address 10.11.0.2/30
ESR2(config-gre)#   ip ospf instance 1
ESR2(config-gre)#   ip ospf
ESR2(config-gre)#   enable
ESR2(config-gre)# exit
ESR2(config)# 
ESR2(config)# mpls
ESR2(config-mpls)#   ldp
ESR2(config-ldp)#     router-id 10.12.0.2
ESR2(config-ldp)#     address-family ipv4
ESR2(config-ldp-af-ipv4)#       interface gre 1
ESR2(config-ldp-af-ipv4-if)#       exit
ESR2(config-ldp-af-ipv4)#     exit
ESR2(config-ldp)#     enable
ESR2(config-ldp)#   exit
ESR2(config-mpls)#   forwarding interface gre 1
ESR2(config-mpls)# exit
ESR2(config)# security zone-pair untrusted self
ESR2(config-zone-pair)#   rule 1
ESR2(config-zone-pair-rule)#     action permit
ESR2(config-zone-pair-rule)#     match protocol gre
ESR2(config-zone-pair-rule)#     enable
ESR2(config-zone-pair-rule)#   exit
ESR2(config-zone-pair)# exit

...