...
Блок кода |
---|
|
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
|
Произведем настройку PE1 и PE2:
Блок кода |
---|
|
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)# 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)# 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
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)# 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
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 |