1、CISCOOSPFMPLSBGP配置实例加讲解CISCO 路由器OSPF+MPLS+BGP配置实例 二OO八年九月四日 一、网络环境由5台CISCO7204组成的网络,一台为P路由器,两台PE路由器,两台CE路由器;二、网络描述在P和两台PE路由器这间通过OSPF动态路由协议完成MPLS网络的建立,两台PE路由器这间启用BGP路由协议,在PE路由器上向所属的CE路由器指VPN路由,在CE路由器中向PE路由器配置静态路由。配置思路:1、在P和两台PE路由器这间通过OSPF动态路由协议,在P和PE路由器两两互连的端口上启用MPLS,两台PE之间的路为备份路由,这属公网路由。2、两台PE路由器这间启
2、用BGP路由协议,这使得属于VPN的IP地址能在两个网络(两台CE所属的网络)互相发布,这属私网(VPN)路由。3、在PE路由器上向所属的CE路由器指VPN路由,这打通了两个网络(两台CE所属的网络)之间的路由。三、网络拓扑图四、P路由器配置p#SHOW RUNBuilding configuration.Current configuration : 1172 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encry
3、ption!hostname p!boot-start-markerboot-end-marker!no aaa new-modelip subnet-zero!ip cefip audit po max-events 100!interface Loopback0 ip address 202.98.4.3 255.255.255.255!interface FastEthernet0/0 description to_r2 ip address 10.1.1.10 255.255.255.252 ip ospf cost 20 duplex full tag-switching mtu 1
4、508 tag-switching ip!interface FastEthernet1/0 description to_r3 ip address 10.1.1.6 255.255.255.252 ip ospf cost 20 duplex full tag-switching mtu 1508 tag-switching ip!interface FastEthernet2/0 no ip address shutdown duplex half!interface FastEthernet3/0 no ip address shutdown duplex half!router os
5、pf 100 log-adjacency-changes redistribute connected subnets redistribute static subnets network 10.1.1.6 0.0.0.0 area 0 network 10.1.1.10 0.0.0.0 area 0!ip classlessno ip http serverno ip http secure-server!gatekeeper shutdown!line con 0 exec-timeout 0 0 logging synchronous stopbits 1line aux 0 stop
6、bits 1line vty 0 4 login!endp#五、PE1路由器配置pe1#show runBuilding configuration.Current configuration : 1813 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname pe1!boot-start-markerboot-end-marker!no aaa new-modelip subnet-z
7、ero!ip vrf vpna rd 1:100 route-target export 200:1 route-target import 200:1! ip cefip audit po max-events 100!interface Loopback0 ip address 202.98.4.1 255.255.255.255! interface FastEthernet0/0 description to_r5 ip vrf forwarding vpna ip address 172.16.1.1 255.255.255.252 duplex full tag-switching
8、 ip!interface FastEthernet1/0 description to_r1 ip address 10.1.1.5 255.255.255.252 ip ospf cost 20 duplex full tag-switching mtu 1508 tag-switching ip!interface FastEthernet2/0 ip address 10.1.1.1 255.255.255.252 ip ospf cost 100 duplex full tag-switching mtu 1508 tag-switching ip!interface FastEth
9、ernet3/0 no ip address shutdown duplex half!router ospf 100 log-adjacency-changes redistribute connected metric-type 1 subnets network 10.1.1.0 0.0.0.255 area 0 network 202.98.4.0 0.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 n
10、eighbor 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 exit-address-family ! address-family ipv4 vrf vpna redistribute connected redistribute static no auto-summary no synchronization ex
11、it-address-family!ip classlessip route vrf vpna 192.168.3.0 255.255.255.0 172.16.1.2no ip http serverno ip http secure-server!ip ospf name-lookup!gatekeeper shutdown! !line con 0 exec-timeout 0 0 logging synchronous stopbits 1line aux 0 stopbits 1line vty 0 4 login!endpe1# 六、PE2路由器配置pe2#show runBuil
12、ding configuration.Current configuration : 1725 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname pe2!boot-start-markerboot-end-marker!no aaa new-modelip subnet-zero!ip vrf vpna rd 1:100 route-target export 200:1 route
13、-target import 200:1! ip cefip audit po max-events 100!interface Loopback0 ip address 202.98.4.2 255.255.255.255! interface FastEthernet0/0 description to_r1 ip address 10.1.1.9 255.255.255.252 ip ospf cost 20 duplex full tag-switching ip!interface FastEthernet1/0 ip vrf forwarding vpna ip address 1
14、72.16.2.1 255.255.255.0 duplex full tag-switching ip!interface FastEthernet2/0 ip address 10.1.1.2 255.255.255.252 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
15、redistribute static metric-type 1 subnets network 10.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 neighbor 202.98.4.1 update-source Loopback0 neighbor 202.98.4.1 version 4 ! address-family vpnv4 neighbor 202.98.4.1 activ
16、ate neighbor 202.98.4.1 send-community extended exit-address-family ! address-family ipv4 vrf vpna redistribute connected redistribute static no auto-summary no synchronization exit-address-family!ip classlessip route vrf vpna 192.168.4.0 255.255.255.0 172.16.2.2no ip http serverno ip http secure-se
17、rver!gatekeeper shutdown!line con 0 exec-timeout 0 0 logging synchronous stopbits 1line aux 0 stopbits 1line vty 0 4 login!End七、CE1路由器配置ce1#show runBuilding configuration.Current configuration : 892 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno servic
18、e password-encryption!hostname ce1!boot-start-markerboot-end-marker!no aaa new-modelip subnet-zero!ip cefip audit po max-events 100!interface Loopback0 ip address 192.168.3.1 255.255.255.0!interface FastEthernet0/0 description to_r3 ip address 172.16.1.2 255.255.255.252 duplex full! interface FastEt
19、hernet1/0 no ip address shutdown duplex half!interface FastEthernet2/0 no ip address shutdown duplex half!interface FastEthernet3/0 no ip address shutdown duplex half!ip classlessip route 0.0.0.0 0.0.0.0 172.16.1.1no ip http serverno ip http secure-server!gatekeeper shutdown!line con 0 exec-timeout
20、0 0 logging synchronous stopbits 1line aux 0 stopbits 1line vty 0 4 login!end八、CE2路由器配置Ce2#show runBuilding configuration.*Sep 3 13:53:56.167: %SYS-5-CONFIG_I: Configured from console by consoleCurrent configuration : 888 bytes!version 12.3service timestamps debug datetime msecservice timestamps log
21、 datetime msecno service password-encryption!hostname ce2!boot-start-markerboot-end-marker!no aaa new-modelip subnet-zero!ip cefip audit po max-events 100!interface Loopback0 ip address 10.10.13.1 255.255.255.0!interface FastEthernet0/0 no ip address shutdown duplex half! interface FastEthernet1/0 d
22、escription to_r2 ip address 10.10.12.2 255.255.255.0 duplex full!interface FastEthernet2/0 no ip address shutdown duplex half!interface FastEthernet3/0 no ip address shutdown duplex half!ip classlessip route 0.0.0.0 0.0.0.0 172.16.2.1no ip http serverno ip http secure-server!gatekeeper shutdown!line
23、 con 0 exec-timeout 0 0 logging synchronous stopbits 1line aux 0 stopbits 1line vty 0 4 login!end九、业务测试ce1# ping 172.16.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 96/190/324 msce1#ce2#ping 192.168.3.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 336/468/588 msce2#
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2