本文共 4028 字,大约阅读时间需要 13 分钟。
R1、R5路由器用动态路由协议OSPF来宣告路由;R2、R4建立BGP邻居,连接R1、R5、R6、R7的接口启动vrf空间,配置MPLS-×××,生成×××V4下的BGP表;R2、R3、R4用MPLS防止路由黑洞,R2、R4通过双向重发布是全网获得所有路由;R6、R7启动BGP,保持和R2、R4相同的route-target值,可以使全网互通。
配置如下:R1: interface Loopback0ip address 192.168.1.1 255.255.255.0interface Serial1/1ip address 192.168.2.1 255.255.255.0router ospf 1router-id 192.168.1.1log-adjacency-changesnetwork 192.168.1.1 0.0.0.0 area 0network 192.168.2.1 0.0.0.0 area 0R2:ip vrf 6rd 100:6route-target export 1:1route-target import 1:1ip vrf eilmrd 100:1route-target export 1:1route-target import 1:1ip vrf forwardingip cefmpls label range 200 299interface Loopback0
ip address 2.2.2.2 255.255.255.0!interface FastEthernet0/0ip vrf forwarding 6ip address 26.1.1.2 255.255.255.0duplex half!interface Serial1/0ip vrf forwarding eilmip address 192.168.2.2 255.255.255.0serial restart-delay 0!interface Serial1/1ip address 23.1.1.2 255.255.255.0router eigrp 90network 2.0.0.0network 23.0.0.0no auto-summary!router ospf 1 vrf eilmrouter-id 2.2.2.2log-adjacency-changesredistribute bgp 1 subnetsnetwork 192.168.2.2 0.0.0.0 area 0!router bgp 1no synchronizationbgp router-id 2.2.2.2bgp log-neighbor-changesneighbor 4.4.4.4 remote-as 1neighbor 4.4.4.4 update-source Loopback0no auto-summary! address-family ***v4neighbor 4.4.4.4 activateneighbor 4.4.4.4 send-community bothexit-address-family!address-family ipv4 vrf eilmredistribute ospf 1no auto-summaryno synchronizationexit-address-family!address-family ipv4 vrf 6neighbor 26.1.1.6 remote-as 6neighbor 26.1.1.6 activateno auto-summaryno synchronizationexit-address-familyR3:ip cefmpls label range 300 399interface Loopback0ip address 3.3.3.3 255.255.255.0interface Serial1/0ip address 23.1.1.3 255.255.255.0tag-switching ipserial restart-delay 0!interface Serial1/1ip address 34.1.1.3 255.255.255.0router eigrp 90network 3.0.0.0network 23.0.0.0network 34.0.0.0no auto-summaryR4:ip vrf 7
rd 100:7route-target export 1:1route-target import 1:1!ip vrf easonrd 100:5route-target export 1:1route-target import 1:1!ip cefmpls label range 400 499interface Loopback0ip address 4.4.4.4 255.255.255.0!interface FastEthernet0/0ip vrf forwarding 7ip address 47.1.1.4 255.255.255.0duplex half!interface Serial1/0ip address 34.1.1.4 255.255.255.0tag-switching ipserial restart-delay 0!interface Serial1/1ip vrf forwarding easonip address 192.168.3.1 255.255.255.0router eigrp 90network 4.0.0.0network 34.0.0.0no auto-summary!router ospf 1 vrf easonrouter-id 4.4.4.4log-adjacency-changesredistribute bgp 1 subnetsnetwork 192.168.3.1 0.0.0.0 area 0!router bgp 1no synchronizationbgp router-id 4.4.4.4bgp log-neighbor-changesneighbor 2.2.2.2 remote-as 1neighbor 2.2.2.2 update-source Loopback0no auto-summary!address-family ***v4neighbor 2.2.2.2 activateneighbor 2.2.2.2 send-community bothexit-address-family!address-family ipv4 vrf easonredistribute ospf 1no auto-summaryno synchronizationexit-address-family!address-family ipv4 vrf 7neighbor 47.1.1.7 remote-as 7neighbor 47.1.1.7 activateno auto-summaryno synchronizationexit-address-familyR5:interface Loopback0ip address 192.168.4.1 255.255.255.0interface Serial1/0ip address 192.168.3.2 255.255.255.0router ospf 1router-id 192.168.4.1log-adjacency-changesnetwork 192.168.3.2 0.0.0.0 area 0network 192.168.4.1 0.0.0.0 area 0R6:interface Loopback0
ip address 6.6.6.6 255.255.255.0!interface FastEthernet0/0ip address 26.1.1.6 255.255.255.0router bgp 6no synchronizationbgp router-id 6.6.6.6bgp log-neighbor-changesnetwork 6.6.6.0 mask 255.255.255.0neighbor 26.1.1.2 remote-as 1no auto-summaryR7:interface Loopback0ip address 7.7.7.7 255.255.255.0!interface FastEthernet0/0ip address 47.1.1.7 255.255.255.0router bgp 7no synchronizationbgp router-id 7.7.7.7bgp log-neighbor-changesnetwork 7.7.7.0 mask 255.255.255.0neighbor 47.1.1.4 remote-as 1no auto-summary实验结果:BGP表
转载于:https://blog.51cto.com/13597470/2106580