
MPLS ×××是一种基于MPLS技术的IP-×××,是在网络路由和交换设备上应用MPLS技术,简化核心路由器的路由选择方式,利用结合传统路由技术的标记交换实现的IP虚拟专用网络(IP ×××),可用来构造宽带的Intranet、Extranet,满足多种灵活的业务需求。
下面介绍一些基本的配置
下面介绍一些基本的配置
配置如下:
PE.1
=====================================
=====================================
hostname PE.1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip vrf A
rd 1:1
route-target export 100:100
route-target import 200:200
!
!
mpls label range 100 199
mpls label protocol ldp
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 202.1.1.1 255.255.255.0
ip router isis
!
interface Serial1/0
ip vrf forwarding A
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 202.12.1.1 255.255.255.0
ip router isis
mpls ip
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10 vrf A
router-id 2.2.2.2
log-adjacency-changes
redistribute bgp 1 subnets
network 12.1.1.2 0.0.0.0 area 0
!
router isis
net 49.0001.0000.0000.0001.00
!
router bgp 1
bgp router-id 202.1.1.1
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 202.2.2.2 remote-as 1
neighbor 202.2.2.2 update-source Loopback0
neighbor 202.3.3.3 remote-as 1
neighbor 202.3.3.3 update-source Loopback0
!
address-family ipv4
neighbor 202.2.2.2 activate
neighbor 202.3.3.3 activate
no auto-summary
no synchronization
exit-address-family
!
address-family ***v4
neighbor 202.2.2.2 activate
neighbor 202.2.2.2 send-community extended
neighbor 202.3.3.3 activate
neighbor 202.3.3.3 send-community extended
exit-address-family
!
address-family ipv4 vrf A
redistribute ospf 10 vrf A
redistribute odr
no synchronization
exit-address-family
!
ip http server
no ip http secure-server
!
!
!
!
!
mpls ldp router-id Loopback0
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
PE.2
====================================
hostname PE.2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip vrf A
rd 2:2
route-target export 200:200
route-target import 100:100
!
!
mpls label range 200 299
mpls label protocol ldp
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 202.2.2.2 255.255.255.0
ip router isis
!
interface Serial1/0
ip address 202.12.1.2 255.255.255.0
ip router isis
mpls ip
serial restart-delay 0
!
interface Serial1/1
ip address 202.23.1.1 255.255.255.0
ip router isis
mpls ip
serial restart-delay 0
!
interface Serial1/2
ip vrf forwarding A
ip address 23.1.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10 vrf A
router-id 4.4.4.4
log-adjacency-changes
redistribute bgp 1 subnets
network 23.1.1.2 0.0.0.0 area 0
!
router isis
net 49.0001.0000.0000.0002.00
!
router bgp 1
bgp router-id 202.2.2.2
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 202.1.1.1 remote-as 1
neighbor 202.1.1.1 update-source Loopback0
!
address-family ipv4
neighbor 202.1.1.1 activate
no auto-summary
no synchronization
exit-address-family
!
address-family ***v4
neighbor 202.1.1.1 activate
neighbor 202.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf A
redistribute ospf 10 vrf A
no synchronization
exit-address-family
!
ip http server
no ip http secure-server
!
!
!
!
!
mpls ldp router-id Loopback0
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip vrf A
rd 2:2
route-target export 200:200
route-target import 100:100
!
!
mpls label range 200 299
mpls label protocol ldp
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 202.2.2.2 255.255.255.0
ip router isis
!
interface Serial1/0
ip address 202.12.1.2 255.255.255.0
ip router isis
mpls ip
serial restart-delay 0
!
interface Serial1/1
ip address 202.23.1.1 255.255.255.0
ip router isis
mpls ip
serial restart-delay 0
!
interface Serial1/2
ip vrf forwarding A
ip address 23.1.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10 vrf A
router-id 4.4.4.4
log-adjacency-changes
redistribute bgp 1 subnets
network 23.1.1.2 0.0.0.0 area 0
!
router isis
net 49.0001.0000.0000.0002.00
!
router bgp 1
bgp router-id 202.2.2.2
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 202.1.1.1 remote-as 1
neighbor 202.1.1.1 update-source Loopback0
!
address-family ipv4
neighbor 202.1.1.1 activate
no auto-summary
no synchronization
exit-address-family
!
address-family ***v4
neighbor 202.1.1.1 activate
neighbor 202.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf A
redistribute ospf 10 vrf A
no synchronization
exit-address-family
!
ip http server
no ip http secure-server
!
!
!
!
!
mpls ldp router-id Loopback0
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
PE.3
=====================================
=====================================
hostname PE.3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip vrf A
rd 3:3
route-target export 200:200
route-target import 100:100
!
!
mpls label range 300 399
mpls label protocol ldp
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 202.3.3.3 255.255.255.0
ip router isis
!
interface Serial1/0
ip address 202.23.1.2 255.255.255.0
ip router isis
mpls ip
serial restart-delay 0
!
interface Serial1/1
ip vrf forwarding A
ip address 34.1.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10 vrf A
router-id 6.6.6.6
log-adjacency-changes
redistribute bgp 1 subnets
network 34.1.1.2 0.0.0.0 area 0
!
router isis
net 49.0001.0000.0000.0003.00
!
router bgp 1
bgp router-id 202.3.3.3
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 202.1.1.1 remote-as 1
!
address-family ipv4
neighbor 202.1.1.1 activate
no auto-summary
no synchronization
exit-address-family
!
address-family ***v4
neighbor 202.1.1.1 activate
neighbor 202.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf A
redistribute ospf 10 vrf A
no synchronization
exit-address-family
!
ip http server
no ip http secure-server
!
!
!
!
!
mpls ldp router-id Loopback0
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
HUB
=======================================
hostname hub
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10
router-id 1.1.1.1
log-adjacency-changes
network 10.1.1.1 0.0.0.0 area 0
network 12.1.1.1 0.0.0.0 area 0
!
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10
router-id 1.1.1.1
log-adjacency-changes
network 10.1.1.1 0.0.0.0 area 0
network 12.1.1.1 0.0.0.0 area 0
!
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
SPOKE1
===============================
hostname CE.spoke1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 20.1.1.1 255.255.255.0
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
ip address 23.1.1.1 255.255.255.0
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10
router-id 3.3.3.3
log-adjacency-changes
network 20.1.1.1 0.0.0.0 area 0
network 23.1.1.1 0.0.0.0 area 0
!
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 20.1.1.1 255.255.255.0
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
ip address 23.1.1.1 255.255.255.0
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10
router-id 3.3.3.3
log-adjacency-changes
network 20.1.1.1 0.0.0.0 area 0
network 23.1.1.1 0.0.0.0 area 0
!
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
SPOKE2
=======================================
=======================================
hostname CE.spoke2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 30.1.1.1 255.255.255.0
!
interface Serial1/0
ip address 34.1.1.1 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 10
router-id 5.5.5.5
log-adjacency-changes
network 30.1.1.1 0.0.0.0 area 0
network 34.1.1.1 0.0.0.0 area 0
!
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
转载于:https://blog.51cto.com/ccie2010/218616