• 根据上图构建逻辑拓扑
• 在R1,R2,R3和R4之间配置OSPF区域0
• 在R1,R2,R3和R4之间的接口上使用LDP配置MPLS
• 在R3上创建环回150.1.3.3/32并通告进OSPF
• 在R4上创建环回150.1.4.4/32并通告进OSPF
• R3和R4在AS1内使用环回接口建立对等关系
• R3 和SW1通过EBGP建立对等关系
• R4 和R5 通过 EBGP建立对等关系
• 在R5上创建环回接口10.1.5.5/24 并通告进BGP
• 在SW1上创建环回口 10.1.7.7/24 并通告进BGP
R1#
ip cef
!
mpls label protocol ldp
!
interface FastEthernet0/0
ip address 150.1.12.1 255.255.255.0
tag-switching ip
!
interface Serial0/1
ip address 150.1.13.1 255.255.255.0
tag-switching ip
!
router ospf 1
network 150.1.12.1 0.0.0.0 area 0
network 150.1.13.1 0.0.0.0 area 0
R2#
ip cef
!
mpls label protocol ldp
!
interface FastEthernet0/0
ip address 150.1.12.2 255.255.255.0
tag-switching ip
!
interface Serial0/0
encapsulation frame-relay
!
interface Serial0/0.1 point-to-point
ip address 150.1.24.2 255.255.255.0
tag-switching ip
frame-relay interface-dlci 204
!
router ospf 1
network 150.1.12.2 0.0.0.0 area 0
network 150.1.24.2 0.0.0.0 area 0
R3#
ip cef
!
mpls label protocol ldp
!
interface Loopback0
ip address 150.1.3.3 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.37.3 255.255.255.0
!
interface Serial1/2
ip address 150.1.13.3 255.255.255.0
tag-switching ip
clockrate 64000
!
router ospf 1
network 150.1.3.3 0.0.0.0 area 0
network 150.1.13.3 0.0.0.0 area 0
!
router bgp 1
neighbor 10.1.37.7 remote-as 100
neighbor 150.1.4.4 remote-as 1
neighbor 150.1.4.4 update-source Loopback0
neighbor 150.1.4.4 next-hop-self
R4#
ip cef
!
mpls label protocol ldp
!
interface Loopback0
ip address 150.1.4.4 255.255.255.255
!
interface Serial0/0
encapsulation frame-relay
!
interface Serial0/0.1 point-to-point
ip address 150.1.24.4 255.255.255.0
tag-switching ip
frame-relay interface-dlci 402
!
interface Ethernet0/1
ip address 10.1.45.4 255.255.255.0
!
router ospf 1
network 150.1.4.4 0.0.0.0 area 0
network 150.1.24.4 0.0.0.0 area 0
!
router bgp 1
neighbor 10.1.45.5 remote-as 200
neighbor 150.1.3.3 remote-as 1
neighbor 150.1.3.3 update-source Loopback0
neighbor 150.1.3.3 next-hop-self
no auto-summary
R5#
interface Loopback0
ip address 10.1.5.5 255.255.255.0
!
interface Ethernet0/0
ip address 10.1.45.5 255.255.255.0
!
router bgp 200
network 10.1.5.0 mask 255.255.255.0
neighbor 10.1.45.4 remote-as 1
SW1#
interface Loopback0
ip address 10.1.7.7 255.255.255.0
!
interface FastEthernet0/1
switchport access vlan 12
!
interface FastEthernet0/2
switchport access vlan 12
!
interface FastEthernet0/3
no switchport
ip address 10.1.37.7 255.255.255.0
!
interface FastEthernet0/5
switchport access vlan 45
!
router bgp 100
network 10.1.7.0 mask 255.255.255.0
neighbor 10.1.37.3 remote-as 1
SW2#
interface FastEthernet0/4
switchport access vlan 45
验证:
SW1#ping 10.1.5.5 source 10.1.7.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.5.5, timeout is 2 seconds:
Packet sent with a source address of 10.1.7.7
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/88/92 ms
R1#show ip route