最近研究BGP有点High,又鼓捣了下MPLS ×××协议,网上有些配置都写错了,搞得很郁闷,经过不断的百度和show,终于搞定了,拓扑图如下:
本次的PC-CE跑RIPv2协议,PE-P-PE之间的IGP协议为OSPF
R1配置如下:
ip cef
interface Loopback1
ip address 172.30.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.15.10 255.255.255.0
no shut
!
router rip
version 2
network 172.30.0.0
network 192.168.15.0
no auto-summary
R2配置如下:
ip cef
ip vrf ***1
rd 100:1
route-target export 100:1
route-target import 100:1
!
ip vrf ***2
rd 200:2
route-target export 200:2
route-target import 200:2
!
interface Loopback1
ip address 172.11.11.1 255.255.255.255
!
interface FastEthernet0/0
ip address 10.100.1.1 255.255.255.252
no shut
mpls ip
!
interface FastEthernet1/0
ip vrf forwarding ***1
ip address 192.168.15.1 255.255.255.0
no shut
!
router ospf 1
log-adjacency-changes
network 10.100.1.0 0.0.0.3 area 0
network 172.11.11.1 0.0.0.0 area 0
!
router rip
version 2
no auto-summary
!
address-family ipv4 vrf ***1
redistribute bgp 65500 metric 10
network 192.168.15.0
no auto-summary
exit-address-family
!
router bgp 65500
no synchronization
bgp log-neighbor-changes
neighbor 172.12.12.4 remote-as 65500
neighbor 172.12.12.4 update-source Loopback1
no auto-summary
!
address-family ***v4
neighbor 172.12.12.4 activate
neighbor 172.12.12.4 send-community both
neighbor 172.12.12.4 next-hop-self
exit-address-family
!
address-family ipv4 vrf ***1
redistribute rip
no synchronization
exit-address-family
R3配置如下:
ip cef
!
interface Loopback1
ip address 172.12.12.1 255.255.255.255
!
interface FastEthernet0/0
ip address 10.100.1.2 255.255.255.252
no shut
mpls ip
!
interface FastEthernet0/1
ip address 10.12.1.1 255.255.255.0
no shut
mpls ip
!
router ospf 1
log-adjacency-changes
network 10.12.1.0 0.0.0.255 area 0
network 10.100.1.0 0.0.0.3 area 0
network 172.12.12.1 0.0.0.0 area 0
R4配置:
ip cef
!
ip vrf ***1
rd 100:1
route-target export 100:1
route-target import 100:1
!
ip vrf ***2
rd 200:2
route-target export 200:2
route-target import 200:2
!
interface Loopback11
ip address 172.12.12.4 255.255.255.255
!
interface FastEthernet0/0
ip address 10.12.1.2 255.255.255.0
no shut
mpls ip
!
interface FastEthernet1/1
ip vrf forwarding ***1
ip address 192.168.18.1 255.255.255.0
no shut
!
router ospf 11
log-adjacency-changes
network 10.12.1.0 0.0.0.255 area 0
network 172.12.12.4 0.0.0.0 area 0
!
router rip
version 2
no auto-summary
!
address-family ipv4 vrf ***1
redistribute bgp 65500 metric 10
network 192.168.18.0
no auto-summary
exit-address-family
!
router bgp 65500
no synchronization
bgp log-neighbor-changes
neighbor 172.11.11.1 remote-as 65500
neighbor 172.11.11.1 update-source Loopback11
no auto-summary
!
address-family ***v4
neighbor 172.11.11.1 activate
neighbor 172.11.11.1 send-community both
neighbor 172.11.11.1 next-hop-self
exit-address-family
!
address-family ipv4 vrf ***1
redistribute rip metric 200
no synchronization
exit-address-family
!
R5配置:
ip cef
!
interface Loopback1
ip address 172.30.5.5 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.18.10 255.255.255.0
no shut
!
router rip
version 2
network 172.30.0.0
network 192.168.18.0
no auto-summary
R1上的路由表如下:
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.15.0/24 is directly connected, FastEthernet0/0
172.30.0.0/32 is subnetted, 2 subnets
R 172.30.5.5 [120/10] via 192.168.15.1, 00:00:25, FastEthernet0/0
C 172.30.1.1 is directly connected, Loopback1
R 192.168.18.0/24 [120/10] via 192.168.15.1, 00:00:25, FastEthernet0/0
R5上的路由表如下
R5#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
R 192.168.15.0/24 [120/10] via 192.168.18.1, 00:00:10, FastEthernet0/0
172.30.0.0/32 is subnetted, 2 subnets
C 172.30.5.5 is directly connected, Loopback1
R 172.30.1.1 [120/10] via 192.168.18.1, 00:00:10, FastEthernet0/0
C 192.168.18.0/24 is directly connected, FastEthernet0/0
本次配置的另一个实例未使用,后续打算加2个CE,然后在PC-CE之间运行EIGRP进行测试。