如下图示:
实验目标:CE1和CE2的Loopback0互通。
实验环境:
1.P、PE1和PE2是运营商路由器。CE1和CE2是VPN用户。
2.P、PE1和PE2运行OSPF 进程号1 Area 0。
3.PE1和PE2为iBGP AS 1。
4.CE1和CE2采用RIP V2。
实验步骤:
1.在P、PE1和PE2路由器启用ip cef。
2.在P、PE1和PE2路由器的互连接口启用mpls ip
3.在P、PE1和PE2配置ospf 1。
4.查看mpls vpn相关命令:
show mpls ldp neighbor
show mpls interface
show mpls forwarding-table
5.在PE路由器启用ip vrf、配置rd、在与CE相连接口启用ip vrf forwading和RIP路由
6.在PE1和PE2上配置iBGP、Address-family vpnv4的配置。
7.在PE1和PE2配置bgp和RIP相互间双向路由重分布。
8.在CE1和CE2配置loopback0和相连PE的接口,RIP V2配置。
9.在CE1 ping 5.5.5.5 source 4.4.4.4,在CE2 ping 4.4.4.4 source 5.5.5.5。
P、PE1和PE2 三位一体MPLS VPN主体OSPF贯通。 P: ip cef interface Loopback0 ip address 1.1.1.1 255.255.255.255 interface FastEthernet0/0 ip address 12.1.1.1 255.255.255.0 mpls ip no sh interface FastEthernet0/1 ip address 13.1.1.1 255.255.255.0 mpls ip no sh router ospf 1 router-id 1.1.1.1 network 1.1.1.1 0.0.0.0 area 0 network 12.1.1.0 0.0.0.255 area 0 network 13.1.1.0 0.0.0.255 area 0 PE1: ip cef interface Loopback0 ip address 2.2.2.2 255.255.255.255 interface FastEthernet0/0 ip address 12.1.1.2 255.255.255.0 mpls ip no sh router ospf 1 router-id 2.2.2.2 network 2.2.2.2 0.0.0.0 area 0 network 12.1.1.0 0.0.0.255 area 0 PE2: ip cef interface Loopback0 ip address 3.3.3.3 255.255.255.255 interface FastEthernet0/1 ip address 13.1.1.3 255.255.255.0 mpls ip no sh router ospf 1 router-id 3.3.3.3 network 3.3.3.3 0.0.0.0 area 0 network 13.1.1.0 0.0.0.255 area 0
用户VRF配置: PE1: ip vrf apple rd 45.1.1.2:45 //每个PE的rd和route-target是一样的。 route-target export 45.1.1.2:45 route-target import 45.1.1.2:45 interface FastEthernet0/1 ip vrf forwarding apple ip address 24.1.1.2 255.255.255.0 no sh router rip version 2 address-family ipv4 vrf apple network 24.0.0.0 PE2: ip vrf apple rd 45.1.1.2:45 //每个PE的rd和route-target是一样的。 route-target export 45.1.1.2:45 route-target import 45.1.1.2:45 interface FastEthernet0/1 ip vrf forwarding apple ip address 35.1.1.3 255.255.255.0 no sh router rip version 2 address-family ipv4 vrf apple network 35.0.0.0
PE1和PE2之间的iBGP配置: PE1: router bgp 1 bgp router-id 2.2.2.2 neighbor 3.3.3.3 remote-as 1 neighbor 3.3.3.3 update-source Loopback0 address-family vpnv4 neighbor 3.3.3.3 activate neighbor 3.3.3.3 send-community both PE2: router bgp 1 bgp router-id 3.3.3.3 neighbor 2.2.2.2 remote-as 1 neighbor 2.2.2.2 update-source Loopback0 address-family vpnv4 neighbor 2.2.2.2 activate neighbor 2.2.2.2 send-community both
BGP和RIP双向路由重分发 PE1: router rip address-family ipv4 vrf apple redistribute bgp 1 metric transparent router bgp 1 address-family ipv4 vrf apple redistribute rip PE2: router rip address-family ipv4 vrf apple redistribute bgp 1 metric transparent router bgp 1 address-family ipv4 vrf apple redistribute rip
CE1和CE2配置 CE1: interface Loopback0 ip address 4.4.4.4 255.255.255.255 interface FastEthernet0/1 ip address 24.1.1.4 255.255.255.0 no sh router rip version 2 network 4.0.0.0 network 24.0.0.0 CE2: interface Loopback0 ip address 5.5.5.5 255.255.255.255 interface FastEthernet0/0 ip address 35.1.1.5 255.255.255.0 no sh router rip version 2 network 5.0.0.0 network 35.0.0.0
为了实验的完整性,特把P、PE1和PE2的完整配置一次性show出来供大家查对。
P: ip cef interface Loopback0 ip address 1.1.1.1 255.255.255.255 interface FastEthernet0/0 ip address 12.1.1.1 255.255.255.0 mpls ip no sh interface FastEthernet0/1 ip address 13.1.1.1 255.255.255.0 mpls ip no sh router ospf 1 router-id 1.1.1.1 network 1.1.1.1 0.0.0.0 area 0 network 12.1.1.0 0.0.0.255 area 0 network 13.1.1.0 0.0.0.255 area 0
PE1: hostname PE1 ip cef ip vrf apple rd 45.1.1.2:45 route-target export 45.1.1.2:45 route-target import 45.1.1.2:45 interface Loopback0 ip address 2.2.2.2 255.255.255.255 interface FastEthernet0/0 ip address 12.1.1.2 255.255.255.0 mpls ip no sh interface FastEthernet0/1 ip vrf forwarding apple ip address 24.1.1.2 255.255.255.0 no sh router ospf 1 router-id 2.2.2.2 network 2.2.2.2 0.0.0.0 area 0 network 12.1.1.0 0.0.0.255 area 0 router rip version 2 address-family ipv4 vrf apple redistribute bgp 1 metric transparent network 24.0.0.0 router bgp 1 no synchronization bgp router-id 2.2.2.2 neighbor 3.3.3.3 remote-as 1 neighbor 3.3.3.3 update-source Loopback0 address-family vpnv4 neighbor 3.3.3.3 activate neighbor 3.3.3.3 send-community both address-family ipv4 vrf apple redistribute rip
PE2: hostname PE2 ip cef ip vrf apple rd 45.1.1.2:45 route-target export 45.1.1.2:45 route-target import 45.1.1.2:45 interface Loopback0 ip address 3.3.3.3 255.255.255.255 interface FastEthernet0/0 ip vrf forwarding apple ip address 35.1.1.3 255.255.255.0 no sh interface FastEthernet0/1 ip address 13.1.1.3 255.255.255.0 mpls ip no sh router ospf 1 router-id 3.3.3.3 network 3.3.3.3 0.0.0.0 area 0 network 13.1.1.0 0.0.0.255 area 0 router rip version 2 address-family ipv4 vrf apple redistribute bgp 1 metric transparent network 35.0.0.0 router bgp 1 bgp router-id 3.3.3.3 neighbor 2.2.2.2 remote-as 1 neighbor 2.2.2.2 update-source Loopback0 address-family vpnv4 neighbor 2.2.2.2 activate neighbor 2.2.2.2 send-community both address-family ipv4 vrf apple redistribute rip
时间: 2024-10-29 10:46:40