通信网实验mplsWord下载.docx

上传人:b****6 文档编号:16295926 上传时间:2022-11-22 格式:DOCX 页数:21 大小:469.52KB
下载 相关 举报
通信网实验mplsWord下载.docx_第1页
第1页 / 共21页
通信网实验mplsWord下载.docx_第2页
第2页 / 共21页
通信网实验mplsWord下载.docx_第3页
第3页 / 共21页
通信网实验mplsWord下载.docx_第4页
第4页 / 共21页
通信网实验mplsWord下载.docx_第5页
第5页 / 共21页
点击查看更多>>
下载资源
资源描述

通信网实验mplsWord下载.docx

《通信网实验mplsWord下载.docx》由会员分享,可在线阅读,更多相关《通信网实验mplsWord下载.docx(21页珍藏版)》请在冰豆网上搜索。

通信网实验mplsWord下载.docx

把安装软件包中的C3640-JK9O3S-M-12.4(7a).BIN文件拷贝到C:

\GNS3\IMAGES\目录下.

在GNS3主界面中选择“编辑---IOS和Hypervisor”。

在“IOS”窗口选择CiscoIOS文件为C3640-JK9O3S-M-12.4(7a).BIN,选择IOS文件对应的“平台”和“型号”后,单击“保存”,如下图所示:

(4)创建工程

打开GNS3软件,新建项目,命名为:

MPLS_VPN_学号,如下图所示。

(5)选择路由器

从左竖栏路由器图标中拖出7个c3600路由器,分别为R1~R7,其中R1、R3为PE,R2为P路由器,R1~R3组成MPLS骨干网,R4和R5为CE,R6和R7为普通路由器,R4和R6组成VPN1Site1,R5和R7组成VPN1Site2,如下图所示。

(6)配置路由器插槽

选择R1,右键选择“配置”项,设置插槽如下图所示:

同理设置R2~R7,其中R6和R7只需设置插槽口slot0即可,不需设置slot1。

(7)如图连接路由器

最终创建的网络拓扑结构

2.配置各个路由器相关接口的IP地址并记录在实验报告中。

(1)、设置IdlePC

选择如图所示IDLEPC值

(2)、根据以下代码在SecureCrt中配置各路由器IP接口

在如图框中写代码

R1#configt进入全局配置模式

R1(config)#intf0/0进入接口f0/0配置模式

R1(config-if)#ipaddress12.1.1.1255.255.255.0配置接口f0/0的IP地址

R1(config-if)#noshutdown激活接口f0/0

R1(config-if)#intf1/0

R1(config-if)#ipaddress14.1.1.1255.255.255.0

R1(config-if)#noshutdown

R1(config-if)#intloopback0

R1(config-if)#ipaddress1.1.1.1255.255.255.255配置loopback地址

R1(config-if)#end退出全局配置模式

R1#showipintb显示接口IP配置简报

R1#write保存配置

R2#configt进入全局配置模式

R2(config)#intf0/0进入接口f0/0配置模式

R2(config-if)#ipaddress12.1.1.2255.255.255.0配置接口f0/0的IP地址

R2(config-if)#noshutdown激活接口f0/0

R2(config-if)#intf1/0

R2(config-if)#ipaddress23.1.1.2255.255.255.0

R2(config-if)#noshutdown

R2(config-if)#intloopback0

R2(config-if)#ipaddress2.2.2.2255.255.255.255配置loopback地址

R2(config-if)#end退出全局配置模式

R2#showipintb显示接口IP配置简报

R2#write保存配置

R3#configt进入全局配置模式

R3(config)#intf0/0进入接口f0/0配置模式

R3(config-if)#ipaddress35.1.1.3255.255.255.0配置接口f0/0的IP地址

R3(config-if)#noshutdown激活接口f0/0

R3(config-if)#intf1/0

R3(config-if)#ipaddress23.1.1.3255.255.255.0

R3(config-if)#noshutdown

R3(config-if)#intloopback0

R3(config-if)#ipaddress3.3.3.3255.255.255.255配置loopback地址

R3(config-if)#end退出全局配置模式

R3#showipintb显示接口IP配置简报

R3#write

R4#configt进入全局配置模式

R4(config)#intf0/0进入接口f0/0配置模式

R4(config-if)#ipaddress46.1.1.4255.255.255.0配置接口f0/0的IP地址

R4(config-if)#noshutdown激活接口f0/0

R4(config-if)#intf1/0

R4(config-if)#ipaddress14.1.1.4255.255.255.0

R4(config-if)#noshutdown

R4(config-if)#end退出全局配置模式

R4#showipintb显示接口IP配置简报

R4#write

R5#configt进入全局配置模式

R5(config)#intf0/0进入接口f0/0配置模式

R5(config-if)#ipaddress57.1.1.5255.255.255.0配置接口f0/0的IP地址

R5(config-if)#noshutdown激活接口f0/0

R5(config-if)#intf1/0

R5(config-if)#ipaddress35.1.1.5255.255.255.0

R5(config-if)#noshutdown

R5(config-if)#end退出全局配置模式

R5#showipintb显示接口IP配置简报

R5#write

R6#configt进入全局配置模式

R6(config)#intf0/0进入接口f0/0配置模式

R6(config-if)#ipaddress46.1.1.6255.255.255.0配置接口f0/0的IP地址

R6(config-if)#noshutdown激活接口f0/0

R6(config-if)#intloopback0

R6(config-if)#ipaddress6.6.6.6255.255.255.255配置loopback地址

R6(config-if)#end退出全局配置模式

R6#showipintb显示接口IP配置简报

R6#write

R7#configt进入全局配置模式

R7(config)#intf0/0进入接口f0/0配置模式

R7(config-if)#ipaddress57.1.1.7255.255.255.0配置接口f0/0的IP地址

R7(config-if)#noshutdown激活接口f0/0

R7(config-if)#intloopback0

R7(config-if)#ipaddress7.7.7.7255.255.255.255配置loopback地址

R7(config-if)#end退出全局配置模式

R7#showipintb显示接口IP配置简报

R7#write

3.配置骨干网络路由协议。

(1)、根据下列代码配置骨干网络路由协议

R1#configt

R1(config)#routerospf123建立OSPF路由进程,进程号为123

R1(config-router)#router-id1.1.1.1

R1(config-router)#network1.1.1.10.0.0.0a0

R1(config-router)#network12.1.1.00.0.0.255a0

R1(config-router)#end

R1#write

R2#configt

R2(config)#routerospf123

R2(config-router)#router-id2.2.2.2

R2(config-router)#network2.2.2.20.0.0.0a0

R2(config-router)#network12.1.1.00.0.0.255a0

R2(config-router)#network23.1.1.00.0.0.255a0

R2(config-router)#exit

R2(config)#intf0/0

R2(config-if)#ipospfpriority255

R2(config-if)#end

R2#write

R3#configt

R3(config)#routerospf123

R3(config-router)#router-id3.3.3.3

R3(config-router)#network3.3.3.30.0.0.0a0

R3(config-router)#network23.1.1.00.0.0.255a0

R3(config-router)#end

4.配置骨干网络MPLS协议。

1)利用下列代码全局开启CEF(必须配置):

R1(config)#ipcef

R2(config)#ipcef

R3(config)#ipcef

2)利用下列代码配置LDP(必须配置):

配置R1、R2和R3在骨干网的接口开通LDP。

R1(config-if)#intf0/0

R1(config-if)#mplslabelprotocolldp

R1(config-if)#mplsip

R2(config-if)#mplslabelprotocolldp

R2(config-if)#mplsip

R2(config)#intf1/0

R3(config)#intf1/0

R3(config-if)#mplslabelprotocolldp

R3(config-if)#mplsip

3)利用下列代码保存配置

5.配置普通BGP。

在R1和R3之间配置普通BGP,因为在配置MP-BGP之前,需要保证正常的BGP邻居是正常连通的。

1)在R1上配置普通BGP:

R1(config)#routerbgp100

R1(config-router)#bgprouter-id1.1.1.1

R1(config-router)#noauto-summary

R1(config-router)#nosynchronization

R1(config-router)#neighbor3.3.3.3remote-as100

R1(config-router)#neighbor3.3.3.3update-sourceloopback0

2)在R3上配置普通BGP:

R3(config)#routerbgp100

R3(config-router)#bgprouter-id3.3.3.3

R3(config-router)#noauto-summary

R3(config-router)#nosynchronization

R3(config-router)#neighbor1.1.1.1remote-as100

R3(config-router)#neighbor1.1.1.1update-sourceloopback0

3)利用下列代码保存配置:

6.在PE上创建VRF。

在PE上为用户创建相应的VRF,并且指定RD值,需要通信的两个用户网络之间,VRF和RD值保持一致。

1)在R1上创建VRF,并指定RD值:

R1(config)#ipvrfvpn1

R1(config-vrf)#rd100:

1

2)在R3上创建VRF,并指定RD值:

R3(config)#ipvrfvpn1

R3(config-vrf)#rd100:

3)在PE上将连CE的接口划入VRF

在PE上将相应的CE接口划入相应的VRF,以后从该接口进入的用户数据包,则属于相应的VRF,该用户的数据只能根据该VRF路由表作出转发决策。

①在R1上将连CER4的接口f1/0划入VRF:

R1(config-vrf)#intf1/0

R1(config-if)#ipvrfforwardingvpn1将接口划入名称为vpn1的VRF

R1(config-if)#ipadd14.1.1.1255.255.255.0

②在R3上将连CER5的接口f0/0划入VRF:

R3(config-vrf)#intf0/0

R3(config-if)#ipvrfforwardingvpn1

R3(config-if)#ipadd35.1.1.3255.255.255.0

当一个正常的接口被划入VRF之后,接口上的地址会消失,所以需要重新配置一次该接口的IP地址。

4)利用下列代码保存配置:

7.创建MP-BGP。

通过上面在PE上查看VRF路由表发现,VRF路由表中并没有双方用户的路由,所以必须创建MP-BGP,来为双方用户网络传递路由信息。

1)在PER1及R3上创建MP-BGP:

R1(config-router)#noauto-summary

R1(config-router)#address-familyvpnv4

R1(config-router-af)#neighbor3.3.3.3activate

R1(config-router-af)#neighbor3.3.3.3send-munityboth

R3(config-router)#noauto-summary

R3(config-router)#address-familyvpnv4

R3(config-router-af)#neighbor1.1.1.1activate

R3(config-router-af)#neighbor1.1.1.1send-munityboth

因为要传递vpnv4的路由,所以创建的address-family为vpnv4,并且将正常的BGP邻居在vpnv4里面激活,而且还需要将这些BGP的扩展属性手工强行发给对端,否则对方收到的路由信息不会携带扩展属性,也就无常区分用户的路由信息。

2)为MP-BGP创建VRF

MP-BGP在收到用户的路由信息后,必须将其放入相应的VRF路由表,但是这个VRF表是要手工创建的,并且和该用户相关联的VRF名字保持一致:

R1(config-router)#address-familyipv4vrfvpn1

R1(config-router-af)#nosynchronization

R3(config-router)#address-familyipv4vrfvpn1

R3(config-router-af)#nosynchronization

3)配置RT控制VRF路由信息

MP-BGP的VRF路由表能让什么样的路由进入,是靠RT来控制的,要想让用户的路由被MP-BGP传递,就必须为VRF配置相应的RT,只有RT允许的RD路由,才能进入和出去VRF表。

R1(config)#ipvrfvpn1

R1(config-vrf)#route-targetboth100:

R3(config-vrf)#route-targetboth100:

由以上设置可实现VRFvpn1允许RD为100:

1的路由进入和出去。

4)配置PE-CE的路由协议,并将MP-BGP的路由重分布进该路由协议

虽然MP-BGP的VRF已经允许相应的用户路由进入,但是在PE上,此时并不能获知用户的路由信息,所以MP-BGP的VRF路由表中,依然为空,要想让MP-BGP的VRF路由表能够导入相应的用户路由,那就必须和用户CE之前启用路由协议,以获得对方的路由信息,从而导入MP-BGP的VRF表。

①在PER1一端启用RIP路由协议:

a.在PER1上配置RIP:

R1(config)#routerrip

R1(config-router)#version2

R1(config-router-af)#noauto-summary

R1(config-router-af)#network14.0.0.0

R1(config-router-af)#redistributebgp100metric1

发布路由都是在address-family中进行的,并且请关闭自动汇总功能,且将MP-BGP的路由重分布进RIP,否则对方CE将无法得知远程用户的路由信息。

b.在CER4上配置RIP:

R4(config)#routerrip

R4(config-router)#version2

R4(config-router)#noauto-summary

R4(config-router)#network14.0.0.0

R4(config-router)#network46.0.0.0

②在PER3一端启用OSPF路由协议:

a.在PER3上配置OSPF:

R3(config)#routerospf100vrfvpn1

R3(config-router)#router-id35.1.1.3

R3(config-router)#network35.1.1.30.0.0.0a0

R3(config-router)#redistributebgp100subnets

同样也要将MP-BGP的路由重分布进OSPF,以便传递给CE端。

b.在CER5上配置OSPF:

R5(config)#routerospf100

R5(config-router)#router-id5.5.5.5

R5(config-router)#network35.1.1.50.0.0.0a0

R5(config-router)#network57.1.1.50.0.0.0a0

R5(config-router)#exit

5)将PE-CE间的路由重分布进MP-BGP

PE-CE之间在运行IGP时,无法自动导入MP-BGP,所以手工重分布。

①在R1上将RIP路由导入MP-BGP:

R1(config-router-af)#redistributerip

②在R3上将OSPP路由导入MP-BGP:

R3(config-router-af)#redistributeospf100

6)利用下列代码保存配置:

8.配置用户端路由协议。

用户端(通常称为C路由器)R6及R7加入各自CE的路由协议进程:

R6(config)#routerrip

R6(config-router)#version2

R6(config-router)#noauto-summary

R6(config-router)#network46.0.0.0

R6(config-router)#network6.6.6.6

R7(config)#routerospf100

R7(config-router)#router-id7.7.7.7

R7(config-router)#network7.7.7.70.0.0.0a0

R7(config-router)#network57.1.1.00.0.0.255a0

保存路由器配置和工程。

至此,设置已完全结束。

五、实验结果

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 成人教育 > 专升本

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1