计算机网络局域网的设计 实验报告
- 格式:doc
- 大小:210.50 KB
- 文档页数:8
计算机网络《局域网的设计》姓名:学号:班级:指导教师:拓扑图二、实验所需设备3台路由器,型号为:18413台交换机,型号为:2950-246台个人电脑,型号为:PC-PT Serve-PT地址表二、实验步骤任务1:基本交换机配置执行根据地址表和以下说明配置S1和S2和S3交换机∙配置交换机主机名。
∙禁用DNS查找。
∙将执行模式口令配置为class。
∙为控制台连接配置口令cisco。
∙为vty 连接配置口令cisco。
S1 显示的输出Switch>enableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname S1S1(config)#enable secret classS1(config)#no ip domain-lookupS1(config)#ip default-gateway 172.17.99.21S1(config)#line console 0S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#line vty 0 15S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#end%SYS-5-CONFIG_I: Configured from console by consoleS1#copy running-config startup-config任务2:配置并激活以太网接口使用地址表中的IP 地址和默认网关配置五台PC的以太网接口任务3:在交换机上配置VLAN步骤1. 在交换机S1 上创建VLAN。
在全局配置模式下使用vlan vlan-id命令将VLAN 添加到交换机S1。
创建VLAN 之后,您将处于vlan 配置模式,在该模式下可以使用vlan name命令为VLAN 指定名称。
S1(config)#vlan 99S1(config-vlan)#exitS1(config)#vlan 10S1(config-vlan)#exitS1(config)#vlan 20S1(config-vlan)#exit步骤2. 在交换机上将交换机端口分配给VLAN。
在接口配置模式下使用switchport access vlan vlan-id命令将端口分配给VLAN。
S1(config)#interface fastEthernet0/1S1(config-if)#switchport access vlan10S1(config-if)#interface fastEthernet0/2S1(config-if)#switchport access vlan 20S1(config-if)#endS1#copy running-config startup-configDestination filename [startup-config]? [enter]Building configuration...[OK]步骤3. 分配管理VLAN。
在接口配置模式下,使用ip address命令为交换机分配管理IP 地址。
S1(config)#interface vlan 99S1(config-if)#ip address 172.17.99.21 255.255.255.0S1(config-if)#no shutdownS2(config)#interface vlan 99S2(config-if)#ip address 172.17.99.22 255.255.255.0S2(config-if)#no shutdownS3(config)#interface vlan 99S3(config-if)#ip address 172.17.99.23 255.255.255.0S3(config-if)#no shutdown步骤4. 为所有交换机上的中继端口配置中继和本征VLAN。
中继是交换机之间的连接,它允许交换机交换所有VLAN 的信息。
默认情况下,中继端口属于所有VLAN,而接入端口则仅属于一个VLAN。
S1(config)#interface fa0/1S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk native vlan 99S1(config-if)#endS1(config)#interface fa0/2S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk native vlan 99S1(config-if)#end使用show interface trunk 命令检验中继的配置情况。
S1#show interface trunk步骤5. 检验交换机之间是否能够通信。
从S1 ping S2的管理地址。
S1#ping 172.17.99.22Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.17.99.22, timeout is 2 seconds: ..!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/9 ms 任务4:对路由器进行基本配置。
步骤1. 在路由器上创建基本配置。
∙将路由器主机名配置为R1,R2,R3。
∙禁用DNS 查找。
∙将加密特权执行模式口令配置为class。
∙为控制台连接配置口令cisco。
∙为vty 连接配置口令cisco。
Router#enRouter#conf tRouter(config)#hostname R1R1(config)#enable secret classR1(config)#line console 0R1(config-line)#password ciscoR1(config-line)#loginR1(config-line)#line vty 0 15R1(config-line)#password ciscoR1(config-line)#loginR1(config-line)#endR1#copy running-config startup-config任务 5:配置中继接口步骤1:在路由器上配置中继接口。
∙进入子接口配置模式∙建立中继封装∙将VLAN 与子接口关联起来∙为子接口分配一个VLAN 中的IP 地址R1(config)#interface fastethernet 0/1R1(config-if)#no shutdownR1(config-if)#interface fastethernet 0/0.10R1(config-subif)#encapsulation dot1q 10R1(config-subif)#ip address 172.17.10.1 255.255.255.0R1(config-if)#interface fastethernet 0/0.20R1(config-subif)#encapsulation dot1q 20R1(config-subif)#ip address 172.17.20.1 255.255.255.0R1(config-if)#interface fastethernet 0/0.99R1(config-subif)#encapsulation dot1q 99R1(config-subif)#ip address 172.17.99.1 255.255.255.0步骤2:子接口的配置R1#conf tR1(config)#int fa0/0R1(config-if)#ip add 172.17.53.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#int se0/0/0R1(config-if)#ip add 172.17.12.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR2#conf tR2(config)#int se0/0/0R2(config-if)#ip add 172.17.12.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#int se0/0/1R2(config-if)#ip add 172.17.23.1 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR3#conf tR3(config-if)#int se0/0/0R3(config-if)#ip add 172.17.23.2 255.255.255.0R3(config-if)#no shutdownR3(config-if)#int fa0/0R3(config-if)#ip add 172.17.34.1 255.255.255.0R3(config-if))#no shutdownR3(config-if)#exit步骤3 :配置路由协议R1(config)#router ripR1(config-router)#version 2R1(config-router)#no auto-summaryR1(config-router)#network 172.17.1.0R1(config-router)#network 172.17.10.0R1(config-router)#network 172.17.20.0R1(config-router)#network 172.17.99.0R1(config-router)#exit实验小结通过这次课程设计使我们懂得了理论与实际相结合是很重要的,只有理论知识是远远不够的,只有把所学的理论知识与实践相结合起来,从理论中得出结论,才能真正为社会服务,从而提高自己的实际动手能力和独立思考的能力。
PC1 ping PC2PC1 ping PC3PC1 ping PC4。