...
Произведем настройку PE1 и PE2:
Блок кода |
---|
|
ESRPE1(config)# hostname PE1
ESRPE1(config)# ESR
PE1(config)# ip vrf CE1
ESRPE1(config-vrf)# ip protocols bgp max-routes 100
ESRPE1(config-vrf)# rd 6550065501:1
ESRPE1(config-vrf)# route-target export 6550065501:1
ESRPE1(config-vrf)# route-target import 6550065501:1
ESRPE1(config-vrf)# exit
ESRPE1(config)# ip vrf CE2
ESRPE1(config-vrf)# ip protocols bgp max-routes 100
ESRPE1(config-vrf)# rd 6550065501:2
ESRPE1(config-vrf)# route-target export 6550065501:2
ESRPE1(config-vrf)# route-target import 6550065501:2
ESRPE1(config-vrf)# exit
ESRPE1(config)# ESR
PE1(config)# system jumbo-frames
ESRPE1(config)# ESR
PE1(config)# route-map BGP_OUT
ESRPE1(config-route-map)# rule 1
ESRPE1(config-route-map-rule)# exit
ESRPE1(config-route-map)# exit
ESRPE1(config)# router bgp log-neighbor-changes
ESR(config)# router bgp 65500
ESR(config65501
PE1(config-bgp)# neighbor 10.10.1.2
ESRPE1(config-bgp-neighbor)# remote-as 6550065501
ESRPE1(config-bgp-neighbor)# update-source 10.10.1.1
ESRPE1(config-bgp-neighbor)# address-family vpnv4 unicast
ESRPE1(config-bgp-neighbor-af)# send-community extended
ESRPE1(config-bgp-neighbor-af)# enable
ESRPE1(config-bgp-neighbor-af)# exit
ESRPE1(config-bgp-neighbor)# enable
ESRPE1(config-bgp-neighbor)# exit
ESRPE1(config-bgp)# enable
ESRPE1(config-bgp)# vrf CE1
ESRPE1(config-bgp-vrf)# neighbor 192.168.1.1
ESRPE1(config-bgp-vrf-neighbor)# remote-as 6550165510
ESRPE1(config-bgp-vrf-neighbor)# address-family ipv4 unicast
ESRPE1(config-bgp-neighbor-af-vrf)# route-map BGP_OUT out
ESRPE1(config-bgp-neighbor-af-vrf)# enable
ESRPE1(config-bgp-neighbor-af-vrf)# exit
ESRPE1(config-bgp-vrf-neighbor)# enable
ESRPE1(config-bgp-vrf-neighbor)# exit
ESRPE1(config-bgp-vrf)# address-family ipv4 unicast
ESRPE1(config-bgp-vrf-af)# redistribute bgp 6550065501 route-map BGP_OUT
ESRPE1(config-bgp-vrf-af)# exit
ESRPE1(config-bgp-vrf)# enable
ESRPE1(config-bgp-vrf)# exit
ESRPE1(config-bgp)# vrf CE2
ESRPE1(config-bgp-vrf)# neighbor 192.168.2.1
ESRPE1(config-bgp-vrf-neighbor)# remote-as 6550165511
ESRPE1(config-bgp-vrf-neighbor)# address-family ipv4 unicast
ESRPE1(config-bgp-neighbor-af-vrf)# route-map BGP_OUT out
ESRPE1(config-bgp-neighbor-af-vrf)# enable
ESRPE1(config-bgp-neighbor-af-vrf)# exit
ESRPE1(config-bgp-vrf-neighbor)# enable
ESRPE1(config-bgp-vrf-neighbor)# exit
ESRPE1(config-bgp-vrf)# address-family ipv4 unicast
ESRPE1(config-bgp-vrf-af)# redistribute bgp 6550065501 route-map BGP_OUT
ESRPE1(config-bgp-vrf-af)# exit
ESRPE1(config-bgp-vrf)# enable
ESRPE1(config-bgp-vrf)# exit
ESRPE1(config-bgp)# exit
ESRPE1(config)# ESR
PE1(config)# router ospf 1
ESRPE1(config-ospf)# area 0.0.0.0
ESRPE1(config-ospf-area)# enable
ESRPE1(config-ospf-area)# exit
ESRPE1(config-ospf)# enable
ESRPE1(config-ospf)# exit
ESRPE1(config)# ESR
PE1(config)# interface gigabitethernet 1/0/1.100
ESRPE1(config-subif)# ip vrf forwarding CE1
ESRPE1(config-subif)# description "to CE1"
ESRPE1(config-subif)# ip firewall disable
ESRPE1(config-subif)# ip address 192.168.1.2/30
ESRPE1(config-subif)# exit
ESRPE1(config)# interface gigabitethernet 1/0/1.200
ESRPE1(config-subif)# ip vrf forwarding CE2
ESRPE1(config-subif)# description "to CE2"
ESRPE1(config-subif)# ip firewall disable
ESRPE1(config-subif)# ip address 192.168.2.2/30
ESRPE1(config-subif)# exit
ESRPE1(config)# interface gigabitethernet 1/0/2
ESRPE1(config-if-gi)# description "to ASBR1"
PE1(config-if-gi)# mtu 1522
ESRPE1(config-if-gi)# ip firewall disable
ESRPE1(config-if-gi)# ip address 10.100.0.1/30
ESRPE1(config-if-gi)# ip ospf instance 1
ESRPE1(config-if-gi)# ip ospf
ESRPE1(config-if-gi)# exit
ESRPE1(config)# interface loopback 1
ESRPE1(config-loopback)# ip address 10.10.1.1/32
ESRPE1(config-loopback)# ip ospf instance 1
ESRPE1(config-loopback)# ip ospf
ESRPE1(config-loopback)# exit
ESRPE1(config)# mpls
ESRPE1(config-mpls)# ldp
ESRPE1(config-ldp)# router-id 10.10.1.1
ESRPE1(config-ldp)# address-family ipv4
ESRPE1(config-ldp-af-ipv4)# interface gigabitethernet 1/0/2
ESRPE1(config-ldp-af-ipv4-if)# exit
ESRPE1(config-ldp-af-ipv4)# exit
ESRPE1(config-ldp)# enable
ESRPE1(config-ldp)# exit
ESRPE1(config-mpls)# forwarding interface gigabitethernet 1/0/2
ESRPE1(config-mpls)# exit
ESRPE1(config)# do com
ESRPE1(config)# do conf |
Блок кода |
---|
|
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: