路由器与交换机配置综合实训
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
综合训练一
实训要求:
1.按照题目要求进行网络拓扑图设计;
2.对题目中的拓扑图正确连线,并使所有连线up;
3.能够对交换机或路由器添加或删除模块;
4.对各主机能够进行IP设置。
图示:
如图完成任务要求
一对Switch0进行配置:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10
Switch(config-vlan)#exi
Switch(config)#interface fa 0/2
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exi
Switch(config)#interface fa 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#exi
Switch(config)#interface fa 0/3
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
Switch(config-if)#exi
Switch(config)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#wr
Building configuration...
[OK]
二对Switch1进行配置:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#exi
Switch(config)#vlan 20
Switch(config-vlan)#exi
Switch(config)#interface fa 0/2
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exi
Switch(config)#interface fa 0/3
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exi
Switch(config)#interface fa 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#exi
Switch(config)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#wr
Building configuration...
[OK]
三对Router0进行配置:
Continue with configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fa 0/1
Router(config-if)#ip add 192.168.12.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#exi
Router(config)#interface fa 0/0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exi
Router(config)#interface fa 0/0.1
%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip add 192.168.1.1 255.255.255.0
Router(config-subif)#no shutdown
Router(config-subif)#exi
Router(config)#interface fa 0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip add 192.168.2.1 255.255.255.0
Router(config-subif)#no shutdown
Router(config-subif)#exi
Router(config)#router rip
Router(config-router)#network 192.168.12.0
Router(config-router)#network 192.168.1.0
Router(config-router)#network 192.168.2.0
Router(config-router)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#wr
Building configuration...
[OK]
四对Multilayer Switch0进行配置:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 30
Switch(config-vlan)#exi
Switch(config)#vlan 40
Switch(config-vlan)#exi
Switch(config)#interface fa 0/1
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exi
Switch(config)#interface fa 0/2
Switch(config-if)#switchport access vlan 40
Switch(config-if)#exi
Switch(config)#interface vlan 30
%LINK-5-CHANGED: Interface Vlan30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up Switch(config-if)#ip add 192.168.12.2 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exi
Switch(config)#interface vlan 40
%LINK-5-CHANGED: Interface Vlan40, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan40, changed state to up Switch(config-if)#ip add 192.168.4.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exi
Switch(config)#router rip
Switch(config-router)#network 192.168.12.0
Switch(config-router)#network 192.168.4.0
Switch(config-router)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#wr
Building configuration...
[OK]
Ping 192.168.1.10
Ping 192.168.2.10
综合训练二
一、实验目的和实验环境
1、学习交换机配置世纪网络建设中的使用;
2、学习以交换机为主的局域网规划和设计;
3、学习配置VTP、划分VLAN等交换机配置;
4、学习配置单臂路由。
实验环境为网络实验室或PT5.3模拟系统。
二、案例说明
某学校需要建设一个网络,具体要求如下:
1、有A、B两个楼要建设网络;
2、A楼有办公和教务,1楼只有办公;
3、B楼有学生和办公;
4、要求学生不能访问办公。
(暂不考虑每个功能区域的计算机数量)
三、网络设计
1、拓扑结构设计
(为简化实验,这里只设置了具有代表性的PC)
2、VLAN规划
3、交换机和路由器端口规划
(1)交换机SW0
(2)、交换机
(3)、交换机
(4)、交换机SW-B
(5)路由器R0
4、IP地址分配
1、连接网络
按照设计的拓扑结构图连接网络。
2、修改设备名称、设置访问密码
(1)将每个设备名称修改为规划的名称,以便后面的设备配置。
Switch(config)#hostname SW-A-1
SW-A-1(config)#
(2)设置设备的访问密码(为了实验方便,密码统一设置为lit)。
3、配置计算机的IP地址
按照规划配置每台PC的IP地址,并使用ping命令测试相互之间的连通情况,记录结果。
按照规划,将所有需要设置为TRUNK的端口配置为TRUNK模式。
SW0(config)#int f0/1
SW0(config-if)#switchport mode trunk
5、配置交换机的VTP模式
(1)在每个交换机上查看当前VTP状态;
SW-A-1#show vtp status
(2)配置交换机的VTP模式,将SW0和SW-A-2设置为VTP server、SWB 和SW-A-1设置为VTP client。
SW0(config)#vtp mode server
Setting device to VTP SERVER mode.
SW0(config)#vtp domain VTP1 VTP域名设置只在SW0上进行就可
以了,其它交换机不用设置。
Domain name already set to VTP1.
SW-A-1(config)#vtp mode client
Setting device to VTP CLIENT mode.
(3)再次在每个交换机上查看当前VTP状态,找出变化并记录。
6、创建VLAN
(1)查看每台交换机的VLAN情况;
SW0#show vlan bri
(2)在SW0或SW-A-2上创建VLAN;
SW0(config)#vlan 10
SW0(config-vlan)#name BANGONG
SW0(config-vlan)#exit
SW0(config)#vlan 20
SW0(config-vlan)#name JIAOWU
SW0(config-vlan)#exit
SW0(config)#vlan 30
SW0(config-vlan)#name XUESHENG
SW0(config-vlan)#end
(3)查看每台交换机的VLAN情况,并记录。
7、将交换机端口划分到VLAN并禁用不用的端口
(1)将交换机端口划分到VLAN
SW-A-2(config)#int f0/4
SW-A-2(config-if)#switchport mode access
SW-A-2(config-if)#switchport access vlan 10
SW-A-2(config-if)#exit
SW-A-2(config)#int f0/4
SW-A-2(config-if)#switchport mode access
SW-A-2(config-if)#switchport access vlan 10
SW-A-2(config-if)#exit
(2)禁用不用的端口
SW-A-2(config)#int f0/3
SW-A-2(config-if)#shutdown
SW-A-2(config-if)#exit
SW-A-2(config)#int range f0/6-24
SW-A-2(config-if-range)#shutdown
SW-A-2(config-if-range)#end
SW-A-2(config)#
(3)查看VLAN配置情况和端口状态,记录结果
SW-A-2#show vlan bri
SW-A-2#show ip int bri
8、配置VTP修剪(因为PT不支持修剪功能,本部分只能在网络实验室完成)
9、配置单臂路由
(1)配置子端口的VLAN和IP地址
R0(config)#int f0/0.10
R0(config-subif)#encapsulation dot1Q 10
R0(config-subif)#ip address 192.168.1.1 255.255.255.0
R0(config-subif)#no shutdown
R0(config)#int f0/0.20
R0(config-subif)#encapsulation dot1Q 20
R0(config-subif)#ip address 192.168.2.1 255.255.255.0
R0(config-subif)#no shutdown
R0(config)#int f0/0.30
R0(config-subif)#encapsulation dot1Q 30
R0(config-subif)#ip address 192.168.3.1 255.255.255.0
R0(config-subif)#no shutdown
(2)打开端口
R0(config)#int f0/0
R0(config-if)#no shutdown
(3)查看路由表
R0#show ip route
(4)测试连通情况
使用ping命令测试各个PC之间的连通情况,记录结果。
这里要求学生(VLAN 30)不能访问办公((VLAN 10),因此在子端口10做访问控制列表。
R0(config-if)#int f0/0.10
R0(config-subif)#ip access-group 101 in (101是访问控制列表编
号,范围为1-199)
R0(config-subif)#exit
R0(config)#access-list 101 deny ip any 192.168.3.0 0.0.0.255
R0(config)#access-list 101 permit ip any any (注意,这两句的顺序一定要正确,否则可能造成访问错误)
(6)测试连通情况
使用ping命令测试各个PC之间的连通情况,看是否学生机不能访问办公机,其它访问正常。
记录结果。
对实验结果进行分析,对实验中进行的工作进行总结。
六、实验报告提交
将实验报告打印后提交(实验报告格式按照学校统一格式),同时通过电子邮件提交PT文件,PT文件名为:学号-姓名-交换机综合练习。
综合训练三
综合实训四
综合实训五
综合实训六。