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

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

Ключ

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

...

Блок кода
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

Настроим ASBR1 и ASBR2:

Блок кода
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

...