拓扑:
配置:
interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.12.1 255.255.255.0 ip route 0.0.0.0 0.0.0.0 192.168.12.2 |
interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.12.2 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.23.2 255.255.255.0 duplex auto speed auto ! router ospf 200 router-id 2.2.2.2 log-adjacency-changes network 2.2.2.2 0.0.0.0 area 0 network 192.168.23.0 0.0.0.255 area 0 ! router bgp 200 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 3.3.3.3 remote-as 200 neighbor 3.3.3.3 update-source Loopback0 ! address-family ipv4 neighbor 3.3.3.3 activate neighbor 3.3.3.3 next-hop-self no auto-summary no synchronization network 1.1.1.1 mask 255.255.255.255 exit-address-family ! ip route 1.1.1.1 255.255.255.255 192.168.12.1 |
interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.34.3 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.23.3 255.255.255.0 duplex auto speed auto ! router ospf 200 router-id 3.3.3.3 log-adjacency-changes network 3.3.3.3 0.0.0.0 area 0 network 192.168.23.0 0.0.0.255 area 0 ! router bgp 200 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 2.2.2.2 remote-as 200 neighbor 2.2.2.2 update-source Loopback0 neighbor 7.7.7.7 remote-as 300 neighbor 7.7.7.7 ebgp-multihop 255 neighbor 7.7.7.7 update-source Loopback0 neighbor 192.168.34.4 remote-as 100 ! address-family ipv4 neighbor 2.2.2.2 activate neighbor 2.2.2.2 route-reflector-client neighbor 2.2.2.2 next-hop-self neighbor 7.7.7.7 activate neighbor 7.7.7.7 next-hop-unchanged neighbor 7.7.7.7 route-map ce1 out neighbor 192.168.34.4 activate neighbor 192.168.34.4 route-map ispa out neighbor 192.168.34.4 send-label no auto-summary no synchronization network 2.2.2.2 mask 255.255.255.255 network 3.3.3.3 mask 255.255.255.255 exit-address-family access-list 10 permit 1.1.1.1 access-list 20 permit 2.2.2.2 access-list 20 permit 3.3.3.3 ! ! ! route-map ispa permit 10 match ip address 20 ! route-map ce1 permit 10 match ip address 10 |
ip vrf a rd 1:1 route-target export 1:1 route-target import 1:1 ! mpls label range 400 499 mpls label protocol ldp interface Loopback0 ip address 4.4.4.4 255.255.255.255 ! interface FastEthernet0/0 ip vrf forwarding a ip address 192.168.34.4 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.45.4 255.255.255.0 duplex auto speed auto mpls ip ! router ospf 100 router-id 4.4.4.4 log-adjacency-changes network 4.4.4.4 0.0.0.0 area 0 network 192.168.45.0 0.0.0.255 area 0 ! router bgp 100 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 6.6.6.6 remote-as 100 neighbor 6.6.6.6 update-source Loopback0 ! address-family ***v4 neighbor 6.6.6.6 activate neighbor 6.6.6.6 send-community extended exit-address-family ! address-family ipv4 vrf a neighbor 192.168.34.3 remote-as 200 neighbor 192.168.34.3 activate neighbor 192.168.34.3 send-label no synchronization exit-address-family ! mpls ldp router-id Loopback0 |
mpls label range 500 599 mpls label protocol ldp interface Loopback0 ip address 5.5.5.5 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.45.5 255.255.255.0 duplex auto speed auto mpls ip ! interface FastEthernet0/1 ip address 192.168.56.5 255.255.255.0 duplex auto speed auto mpls ip ! router ospf 100 router-id 5.5.5.5 log-adjacency-changes network 5.5.5.5 0.0.0.0 area 0 network 192.168.45.0 0.0.0.255 area 0 network 192.168.56.0 0.0.0.255 area 0 ! mpls ldp router-id Loopback0 |
ip vrf b rd 2:2 route-target export 1:1 route-target import 1:1 ! mpls label range 600 699 mpls label protocol ldp interface Loopback0 ip address 6.6.6.6 255.255.255.255 ! interface FastEthernet0/0 ip vrf forwarding b ip address 192.168.67.6 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.56.6 255.255.255.0 duplex auto speed auto mpls ip ! router ospf 100 router-id 6.6.6.6 log-adjacency-changes network 6.6.6.6 0.0.0.0 area 0 network 192.168.56.0 0.0.0.255 area 0 ! router bgp 100 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 4.4.4.4 remote-as 100 neighbor 4.4.4.4 update-source Loopback0 ! address-family ***v4 neighbor 4.4.4.4 activate neighbor 4.4.4.4 send-community extended exit-address-family ! address-family ipv4 vrf b neighbor 192.168.67.7 remote-as 300 neighbor 192.168.67.7 activate neighbor 192.168.67.7 send-label no synchronization exit-address-family ! mpls ldp router-id Loopback0 |
interface Loopback0 ip address 7.7.7.7 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.67.7 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.78.7 255.255.255.0 duplex auto speed auto ! router ospf 300 router-id 7.7.7.7 log-adjacency-changes network 7.7.7.7 0.0.0.0 area 0 network 192.168.78.0 0.0.0.255 area 0 ! router bgp 300 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 3.3.3.3 remote-as 200 neighbor 3.3.3.3 ebgp-multihop 255 neighbor 3.3.3.3 update-source Loopback0 neighbor 8.8.8.8 remote-as 300 neighbor 8.8.8.8 update-source Loopback0 neighbor 192.168.67.6 remote-as 100 ! address-family ipv4 neighbor 3.3.3.3 activate neighbor 3.3.3.3 next-hop-unchanged neighbor 3.3.3.3 route-map ce1 out neighbor 8.8.8.8 activate neighbor 8.8.8.8 route-reflector-client neighbor 8.8.8.8 next-hop-self neighbor 192.168.67.6 activate neighbor 192.168.67.6 route-map ispa out neighbor 192.168.67.6 send-label no auto-summary no synchronization network 7.7.7.7 mask 255.255.255.255 network 8.8.8.8 mask 255.255.255.255 exit-address-family ! access-list 10 permit 9.9.9.9 access-list 20 permit 7.7.7.7 access-list 20 permit 8.8.8.8 ! ! ! route-map ispa permit 10 match ip address 20 ! route-map ce1 permit 10 match ip address 10 |
interface Loopback0 ip address 8.8.8.8 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.89.8 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.78.8 255.255.255.0 duplex auto speed auto ! router ospf 300 router-id 8.8.8.8 log-adjacency-changes network 8.8.8.8 0.0.0.0 area 0 network 192.168.78.0 0.0.0.255 area 0 ! router bgp 300 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 7.7.7.7 remote-as 300 neighbor 7.7.7.7 update-source Loopback0 ! address-family ipv4 neighbor 7.7.7.7 activate neighbor 7.7.7.7 next-hop-self no auto-summary no synchronization network 9.9.9.9 mask 255.255.255.255 exit-address-family ! ip route 9.9.9.9 255.255.255.255 192.168.89.9 |
interface Loopback0 ip address 9.9.9.9 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.89.9 255.255.255.0 duplex auto speed auto ! ip route 0.0.0.0 0.0.0.0 192.168.89.8 |
数据流动测试:
连通性测试: