OSPF+MPLS+BGP配置实例

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
network10.1.1.0 0.0.0.255 area 0
network 202.98.4.00.0.0.255 area 0
!
router bgp 100
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 202.98.4.2 remote-as 100
!
interface FastEthernet1/0
ip vrf forwarding vpna
ip address 172.16.2.1 255.255.255.0
duplex full
tag-switching ip
!
interface FastEthernet2/0
ip address10.1.1.2 255.255.255.252
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname pe2
!
boot-start-marker
boot-end-marker
ip address 202.98.4.2 255.255.255.255
!
interface FastEthernet0/0
description to_r1
ip address10.1.1.9 255.255.255.252
ip ospf cost 20
duplex full
tag-switching ip
三、网络拓扑图
四、
p#SHOW RUN
Building configuration...
Current configuration : 1172 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname p
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
ip audit po max-events 100
!
!
interface Loopback0
redistribute static metric-type 1 subnets
network10.1.1.0 0.0.0.255 area 0
!
router bgp 100
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 202.98.4.1 remote-as 100
Current configuration : 1813 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
ip route vrf vpna 192.168.4.0 255.255.255.0 172.16.2.2
no ip http server
no ip http secure-server
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
ip address 202.98.4.3 255.255.255.255
!
interface FastEthernet0/0
description to_r2
ip address10.1.1.10 255.255.255.252
ip ospf cost 20
duplex full
tag-switching mtu 1508
tag-switching ip
!
interface FastEthernet3/0
no ip address
shutdown
duplex half
!
router ospf 100
log-adjacency-changes
redistribute connected metric-type 1 subnets
neighbor 202.98.4.2 update-source Loopback0
neighbor 202.98.4.2 version 4
!
address-family vpnv4
neighbor 202.98.4.2 activate
neighbor 202.98.4.2 send-community extended
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip vrf vpna
rd 1:100
route-target export 200:1
route-target import 200:1
!
ip cef
ip audit po max-events 100
!
!
interface Loopback0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
pe1#
六、
pe2#show run
Building configuration...
Current configuration : 1725 bytes
!
version 12.3
配置思路:
1、在P和两台PE路由器这间通过OSPF动态路由协议,在P和PE路由器两两互连的端口上启用MPLS,两台PE之间的路为备份路由,这属公网路由。
2、两台PE路由器这间启用BGP路由协议,这使得属于VPN的IP地址能在两个网络(两台CE所属的网络)互相发布,这属私网(VPN)路由。
3、在PE路由器上向所属的CE路由器指VPN路由,这打通了两个网络(两台CE所属的网络)之间的路由。
!
interface FastEthernet2/0
no ip address
shutdown
duplex half
!
interface FastEthernet3/0
no ip address
shutdown
duplex half
!
router ospf 100
log-adjacency-changes
neighbor 202.98.4.1 update-source Loopback0
neighbor 202.98.4.1 version 4
!
address-family vpnv4
neighbor 202.98.4.1 activate
neighbor 202.98.4.1 send-community extended
ip address 172.16.1.1 255.255.255.252
duplex full
tag-switching ip
!
interface FastEthernet1/0
description to_r1
ip address10.1.1.5 255.255.255.252
ip ospf cost 20
ip route vrf vpna 192.168.3.0 255.255.255.0 172.16.1.2
no ip http server
no ip http secure-server
!
ip ospf name-lookup
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
tag-switching ip
!
interface FastEthernet1/0
description to_r3
ip address10.1.1.6 255.255.255.252
ip ospf cost 20
duplex full
tag-switching mtu 1508
tag-switching ip
redistribute connected subnets
redistribute static subnets
network10.1.1.6 0.0.0.0 area 0
network10.1.1.10 0.0.0.0 area 0
!
ip classless
no ip http server
no ip http secure-server
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
p#
五、
pe1#show run
Building configuration...
!
hostname pe1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip vrf vpna
rd 1:100
route-target export 200:1
route-target import 200:1
duplex full
tag-switching mtu 1508
tag-switching ip
!
interface FastEthernet2/0
ip address10.1.1.1 255.255.255.252
ip ospf cost 100
duplex full
tag-switching mtu 1508
ip ospf cost 100
duplex full
tag-switching ip
!
interface FastEthernet3/0
no ip address
shutdown
duplex half
!
router ospf 100
log-adjacency-changes
redistribute connected metric 1 subnets
exit-address-family
!
address-family ipv4 vrf vpna
redistribute connected
redistribute static
no auto-summary
no synchronization
exit-address-family
!
ip classless
service timestamps log datetime msec
no service password-encryption
!
hostname ce1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
ip cef
ip audit po max-events wk.baidu.com00
!
!
interface Loopback0
ip address 202.98.4.1 255.255.255.255
!
interface FastEthernet0/0
description to_r5
ip vrf forwarding vpna
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
End
七、
ce1#show run
Building configuration...
Current configuration : 892 bytes
!
version 12.3
service timestamps debug datetime msec
CISCO路由器
OSPF+MPLS+BGP配置实例
二OO八年九月四日
一、
由5台CISCO7204组成的网络,一台为P路由器,两台PE路由器,两台CE路由器;
二、
在P和两台PE路由器这间通过OSPF动态路由协议完成MPLS网络的建立,两台PE路由器这间启用BGP路由协议,在PE路由器上向所属的CE路由器指VPN路由,在CE路由器中向PE路由器配置静态路由。
exit-address-family
!
address-family ipv4 vrf vpna
redistribute connected
redistribute static
no auto-summary
no synchronization
exit-address-family
!
ip classless
相关文档
最新文档