[实验名称]
配置ISP的Ethernet over MPLS
[实验目的]
使总公司和分公司的网络之间实现二层通信
[背景描述]
某企业由于扩建,在宁波成立了分公司,由于业务需要,要在杭州总公司和宁波分公司之间实现业务互通。由于业务的重要性,对速度和服务质量有很高的要求,于是在ISP服务提供商申请了基于MPLS的×××
[需求分析]
对于总公司和分公司之间,ISP相当于一个透明的二层交换机
[实验拓扑]
[实验设备]
cisco 3725 5台
IOS版本:c3725-adventerprisek9-mz.124-15.T10.extract
[预备知识]
×××常识
MPLS原理
OSPF原理与配置
[实验原理]
在ISP设备上配置MPLS,然后通过建立ISP两端PE的MPLS二层标签来实现桥接互联
[实验步骤]
第一步:基本配置
配置好接口地址(这里指明各个接口地址,详细配置步骤不再列出)
CE1 :
loopback 0:172.16.1.1/24(模拟公司内部网)
F0/0:192.168.1.1/24
CE2:
loopback 0:172.16.2.1/24(模拟公司内部网)
F0/0:192.168.1.2/24
PE1:
loopback 0:2.2.2.2/32
S1/0:23.0.0.1/24
PE2:
loopback 0:4.4.4.4/32
S1/1:34.0.0.1/24
P:
loopback 0:3.3.3.3/32
S1/1:34.0.0.2/24
S1/0:23.0.0.2/24
第二步 ISP内部启用IGP
在ISP内部配置IGP,这里使用OSPF
PE1:
PE1(config)#router ospf 1
PE1(config-router)#router-id 2.2.2.2
PE1(config-router)#net 23.0.0.1 0.0.0.0 a 0
PE1(config-router)#net 2.2.2.2 0.0.0.0 a 0
P:
P(config)#router ospf 1
P(config-router)#router-id 3.3.3.3
P(config-router)#network 3.3.3.3 0.0.0.0 a 0
P(config-router)#network 23.0.0.2 0.0.0.0 a 0
P(config-router)#network 34.0.0.2 0.0.0.0 a 0
PE2
PE2(config)#router ospf 1
PE2(config-router)#network 34.0.0.1 0.0.0.0 a 0
PE2(config-router)#network 4.4.4.4 0.0.0.0 a 0
PE2(config-router)#router-id 4.4.4.4
第三步 ISP内部建立MPLS转发
在ISP内部启用MPLS,建立起MPLS标签转发表,开启MPLS之前首先开启ip cef
PE1:
PE1(config)#ip cef
PE1(config)#mpls label protocol ldp
PE1(config)#mpls ldp router-id loopback 0 force
PE1(config)#int s 1/0
PE1(config-if)#mpls ip
P:P(config)#ip cef
P(config)#mpls label protocol ldp
P(config)#mpls ldp router-id loopback 0 force
P(config)#int s 1/0
P(config-if)#mpls ip
P(config-if)#int s1/1
P(config-if)#mpls ip
PE2:
PE2(config)#ip cef
PE2(config)#mpls label protocol ldp
PE2(config)#mpls ldp router-id loopback 0 force
PE2(config)#int s 1/1
PE2(config-if)#mpls ip
第四步:建立二层×××
连接PE1和PE2之间的基于MPLS的二层×××连接
PE1
PE1(config)#int fastEthernet 0/0
PE1(config-if)#xconnect 4.4.4.4 1 encapsulation mpls
PE2
PE2(config)#interface fastEthernet 0/0
PE2(config-if)#xconnect 2.2.2.2 1 encapsulation mpls
第五步,CE设备上启用OSPF
实现总公司和分公司路由的互通
CE1
CE1(config)#router ospf 1
CE1(config-router)#net 192.168.1.0 0.0.0.255 a 0
CE1(config-router)#net 172.16.1.0 0.0.0.255 a 0
CE2
CE2(config)#router ospf 1
CE2(config-router)#net 192.168.1.0 0.0.0.255 a 0
CE2(config-router)#net 172.16.2.0 0.0.0.255 a 0
第六步:验证测试
在CE1上用172.16.1.1去ping CE2上的172.16.2.1
[注意事项]
在ISP设备上的loopback口必须配置成32位的地址
[参考配置]
CE1:
CE1#show running-config
Building configuration...
Current configuration : 1201 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CE1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
archive
log config
hidekeys
!
!
interface Loopback0
ip address 172.16.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
router ospf 1
log-adjacency-changes
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
!
ip forward-protocol nd
!
!
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
---------------------------华丽的分割线------------------------------------
PE1:
PE1#show running-config
Building configuration...
Current configuration : 1303 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
!
mpls label protocol ldp
multilink bundle-name authenticated
!
archive
log config
hidekeys
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
xconnect 4.4.4.4 1 encapsulation mpls
!
rface Serial1/0
ip address 23.0.0.1 255.255.255.0
mpls ip
serial restart-delay 0
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 23.0.0.1 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
ip http server
no ip http secure-server
!
mpls ldp router-id Loopback0 force
!
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
---------------------------华丽的分割线------------------------------------
P:
P#sh running-config
Building configuration...
Current configuration : 1324 bytes
!
version 12.4
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
memory-size iomem 5
ip cef
!
no ip domain lookup
!
mpls label protocol ldp
multilink bundle-name authenticated
!
!
archive
log config
hidekeys
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Serial1/0
ip address 23.0.0.2 255.255.255.0
mpls ip
serial restart-delay 0
!
interface Serial1/1
ip address 34.0.0.2 255.255.255.0
mpls ip
serial restart-delay 0
!
!
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 23.0.0.2 0.0.0.0 area 0
network 34.0.0.2 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
ip http server
no ip http secure-server
!
mpls ldp router-id Loopback0 force
!
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
---------------------------华丽的分割线------------------------------------
PE2
PE2#sh running-config
Building configuration...
Current configuration : 1303 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
no ip domain lookup
!
mpls label protocol ldp
multilink bundle-name authenticated
!
archive
log config
hidekeys
!
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
xconnect 2.2.2.2 1 encapsulation mpls
!
!
interface Serial1/1
ip address 34.0.0.1 255.255.255.0
mpls ip
serial restart-delay 0
!
router ospf 1
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 34.0.0.1 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
ip http server
no ip http secure-server
!
mpls ldp router-id Loopback0 force
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
---------------------------华丽的分割线------------------------------------
CE2:
CE2#sh running-config
Building configuration...
Current configuration : 1181 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
multilink bundle-name authenticated
!
archive
log config
hidekeys
!
interface Loopback0
ip address 172.16.2.1 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 172.16.2.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
!
ip forward-protocol nd
!
!
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