使用 BGP、RIP 和 OSPF 的 MPLS VPN 网络

网络工程 虚拟专用网 bgp ospf 聚光灯 撕裂
2021-07-08 16:46:34

我正在配置 MPLS VPN 网络。

这是我正在使用的内容:

网络拓扑结构

从 CE1 我希望能够 ping CE2 的环回地址,反之亦然,这尚不可能,我不知道我哪里出错了......到目前为止我采取的步骤如下:

先决条件:

  • 在 P 和 PE 路由器上启用 OSPF 在网络内部以及环回中进行广告
  • 在 P 和 PE 路由器上启用 MPLS

采取的步骤:

  1. 在 PE 和 CE 路由器上,我启用了 RIP V2
  2. 在两个 PE 路由器上,我都为客户端启用了 VRF(在 PE2 上重复)

        PE1(config)#ip  vrf  client1
        PE1(config-vrf)#rd 999:1 
        PE1(config-vrf)#route-target  export  64999 :1
        PE1(config-vrf)#route-target  import  64999 :1
    
  3. 将两个 PE 路由器上的 VRF 分配给面向 CE 路由器的接口

  4. 在两个 PE 路由器上设置基本 BGP 我将列出两个 PE 路由器的运行配置:

PE1配置

Current configuration : 2176 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
ip vrf client1
 rd 999:1
 route-target export 64999:1
 route-target import 64999:1
!
no ip domain lookup
!
multilink bundle-name authenticated
!
archive
 log config
  hidekeys
!
!
!
!
ip tcp synwait-time 5
!

interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip vrf forwarding client1
 ip address 10.1.1.2 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.1.1 255.255.255.252
 duplex auto
 speed auto
 mpls label protocol ldp
 mpls ip
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex auto
 speed auto
!

router ospf 10
 log-adjacency-changes
 network 1.1.1.1 0.0.0.0 area 0
 network 192.168.1.0 0.0.0.3 area 0
!
router rip
 version 2
 network 10.0.0.0
 no auto-summary
 !
 address-family ipv4 vrf client1
  redistribute bgp 64999 metric 1
  network 10.0.0.0
  no auto-summary
  version 2
 exit-address-family
!
router bgp 64999
 no bgp default ipv4-unicast
 bgp log-neighbor-changes
 neighbor 4.4.4.4 remote-as 64999
 neighbor 4.4.4.4 update-source Loopback0
 !
 address-family vpnv4
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf client1
  redistribute rip metric 1
  no synchronization
 exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
control-plane
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end

PE2配置

Building configuration...

Current configuration : 2145 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!

ip vrf client2
 rd 999:1
 route-target export 64999:1
 route-target import 64999:1
!
no ip domain lookup
!
multilink bundle-name authenticated
!

archive
 log config
  hidekeys
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
 ip vrf forwarding client2
 ip address 10.1.1.6 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.1.9 255.255.255.252
 duplex auto
 speed auto
 mpls label protocol ldp
 mpls ip
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex auto
 speed auto
!

router ospf 10
 log-adjacency-changes
 network 4.4.4.4 0.0.0.0 area 0
 network 192.168.1.8 0.0.0.3 area 0
!
router rip
 version 2
 network 10.0.0.0
 no auto-summary
 !
 address-family ipv4 vrf client2
  redistribute bgp 64999 metric 1
  no auto-summary
 exit-address-family
!
router bgp 64999
 no bgp default ipv4-unicast
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 64999
 neighbor 1.1.1.1 update-source Loopback0
 !
 address-family vpnv4
  neighbor 1.1.1.1 activate
  neighbor 1.1.1.1 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf client2
  redistribute rip metric 1
  no synchronization
 exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
control-plane
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end
  1. 将 RIP 配置为对 PE1 和 PE2 使用 VRF 表。

    PE1(config)#router  rip
    PE1(config-router)#address-family  ipv4  vrf  client1
    PE1(config-router-af)#version 2
    PE1(config-router-af)#network 10.0.0.0
    PE1(config-router-af)#no auto-summary
    
  2. 路由的重新分配
    • RIP 路由到 BGP
    • BGP 路由到 RIP

完成上述配置后,我运行了以下命令...

CE1 - 只能看到 CE1 和 CE2 上的连接路由

     10.0.0.0/30 is subnetted, 2 subnets
C       10.1.1.8 is directly connected, Loopback0
C       10.1.1.0 is directly connected, FastEthernet0/0

PE1

PE1#show ip route
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/11] via 192.168.1.2, 01:02:04, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/21] via 192.168.1.2, 01:02:04, FastEthernet0/1
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/31] via 192.168.1.2, 01:02:04, FastEthernet0/1
     192.168.1.0/30 is subnetted, 3 subnets
O       192.168.1.8 [110/30] via 192.168.1.2, 01:02:06, FastEthernet0/1
C       192.168.1.0 is directly connected, FastEthernet0/1
O       192.168.1.4 [110/20] via 192.168.1.2, 01:02:06, FastEthernet0/1

PE1#show ip route vrf client1
     10.0.0.0/30 is subnetted, 2 subnets
R       10.1.1.8 [120/1] via 10.1.1.1, 00:00:18, FastEthernet0/0
C       10.1.1.0 is directly connected, FastEthernet0/0

PE2

PE2#show ip route

     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/31] via 192.168.1.10, 01:08:58, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/21] via 192.168.1.10, 01:09:08, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 192.168.1.10, 01:09:08, FastEthernet0/1
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     192.168.1.0/30 is subnetted, 3 subnets
C       192.168.1.8 is directly connected, FastEthernet0/1
O       192.168.1.0 [110/30] via 192.168.1.10, 01:08:59, FastEthernet0/1
O       192.168.1.4 [110/20] via 192.168.1.10, 01:09:09, FastEthernet0/1

PE2#show ip route vrf client2
     10.0.0.0/30 is subnetted, 3 subnets
B       10.1.1.8 [200/1] via 1.1.1.1, 00:55:41
B       10.1.1.0 [200/0] via 1.1.1.1, 00:55:41
C       10.1.1.4 is directly connected, FastEthernet0/0
  • 为什么我只能在 PE1 中看到 RIP 路由?并且只有PE2 中的BGP 路由?
  • 我是否应该看到从 PE1 和 2 到 CE 网络的 BGP 和 RIP 路由?
  • 我错过了什么/做错了什么,使我无法从 CE1 ping 到 CE2,反之亦然?

添加运行配置

CE2:

CE2#show run
Building configuration...

Current configuration : 1396 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  hidekeys
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface Loopback0
 ip address 10.1.1.17 255.255.255.252
!
interface FastEthernet0/0
 ip address 10.1.1.5 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
router rip
 version 2
 network 10.0.0.0
 no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end

提前致谢!

2个回答

缺少PE2

address-family  ipv4  vrf  client1

RIP配置下

PE2 丢失(在 RIP address-family ipv4 vrf client2 下)

version 2
network 10.0.0.0
no auto-summary