首页 实验4 路由器与静态路由配置

实验4 路由器与静态路由配置

举报
开通vip

实验4 路由器与静态路由配置实验4 路由器与静态路由配置 实验学时:2 一、实验目的 1、熟悉CISCO IOS和CLI命令模式的使用; 2、了解和掌握路由器基本配置命令的使用; 3、掌握动态路由协议的配置; 4、掌握VLAN中路由器的设置。 二、实验设备与环境 Windows 2000 Server/Advance Server主机局域网、CISCO Catalyst 2950交换机和2600系列路由器,Cisco Packet Tracer软件。 三、预备知识 1、路由器工作原理及配置 1)工作原理 根据TCP/I...

实验4 路由器与静态路由配置
实验4 路由器与静态路由配置 实验学时:2 一、实验目的 1、熟悉CISCO IOS和CLI命令模式的使用; 2、了解和掌握路由器基本配置命令的使用; 3、掌握动态路由协议的配置; 4、掌握VLAN中路由器的设置。 二、实验设备与环境 Windows 2000 Server/Advance Server主机局域网、CISCO Catalyst 2950交换机和2600系列路由器,Cisco Packet Tracer软件。 三、预备知识 1、路由器工作原理及配置 1)工作原理 根据TCP/IP协议,路由器的数据包转发具体过程是: 网络接口接收数据包,这一步负责网络物理层处理,即把经编码调制后的数据信号还原为数据。 根据网络物理接口,路由器调用相应的链路层功能模块,以解释处理此数据包的链路层协议报头。这一步处理比较简单,主要是对数据完整性的验证,如CRC校验、帧长度检查。 在链路层完成对数据帧的完整性验证后,路由器开始处理此数据帧的IP层。这一过程是路由器功能的核心。根据数据帧中IP包头的目的IP地址,路由器在路由 关于同志近三年现实表现材料材料类招标技术评分表图表与交易pdf视力表打印pdf用图表说话 pdf 中查找下一跳的IP地址,IP数据包头的TTL(Time To Live)域开始减数,并计算新校验和(Checksum)。 根据路由表中所查到的下一跳IP地址,将IP数据包送往相应的输出链路层,被封装上相应的链路层包头,最后经输出网络物理接口发送出去。 简单地说,路由器的主要工作就是为经过路由器的每个数据帧寻找一条最佳传输路径,并将该数据有效地传送到目的站点。由此可见,选择最佳路径策略或叫选择最佳路由算法是路由器的关键所在。为了完成这项工作,在路由器中保存着各种传输路径的相关数据——路由表(Routing Table),供路由选择时使用。路径表中保存着子网的标志信息、网上路由器的个数和下一个路由器的名称等内容。路由表可以是由系统管理员固定设置好的,也可以是由系统动态修改,可以由路由器自动调整,也可以由主机控制。路由器根据路由选择协议(Routing Protocol)提供的功能,自动学习和记忆网络运行情况,在需要时自动计算数据传输的最佳路径。 2)路由器的基本配置 (1)基本设置方式 1)一般来说,路由器可以用5种方式来设置路由器: 2)通过CONSOLE口用超级终端上。 3)通过AUX口所接的MODEM,从远端拨号用超级终端上。 4)通过ETHERNET上的TFTP服务器。 5)在ETHERNET内工作站用TELNET上 6)SNMP网管工作站(局域网)内。 但是路由器第一次设置必须从CONSOLE口上而且超级终端设置必须是: 波特率:9600,数据位:8,停止位:1,奇偶效验无。 (2) 配置模式 路由器(CISCO)有以下命令模式:用户模式、特许模式、全局模式、局部设置模式和RXBOOT模式、SETUP模式。 配置模式及提示: 配置模式 提示符 说明 Interface Router(config-if)# 端口配置 Subinterface Router(config-subif)# 子端口配置 Controller Router(config-controller)# 控制器配置 Map-list Router(config-map-list)# 影像表配置 Map-class Router(config-map-class)# 影像配置 Line Router(config-line)# 线路配置 Router Router(config-router)# 路由配置 Ipx-router Router(config-ipx-router)# IPX路由配置 Router-map Router(config-route-map)# 路由影像配置 , router> 路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容。 , router# 在router>提示符下键入enable,路由器进入特权命令状态router#,这时不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。 , router(config)# 在router#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。退出全局设置状态 end。 , router(config-if)#; router(config-line)#; router(config-router)#; 路由器处于局部设置状态,这时可以设置路由器某个局部的参数。进入端口设置状态 interface type slot/number 进入子端口设置状态 interface type number.subinterface [point-to-point | multipoint] 进入线路设置状态 line type slot/number 进入路由设置状态 router protocol。退出局部设置状态 exit。 , > 路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。 , 设置对话状态 这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状 态,这时可通过对话方式对路由器进行设置。 (3)基本设置命令 任务 命令 进入特权命令状态 enable 退出特权命令状态 disable 进入设置对话状态 setup 进入全局设置状态 config terminal 退出全局设置状态 end 进入端口设置状态 interface type slot/number 进入子端口设置状态 interface type number.subinterface 进入线路设置状态 line type slot/number 进入路由设置状态 router protocol 退出局部设置状态 exit 查看版本信息 show version 查看运行设置 show running-config 查看开机设置 show startup-config 显示端口信息 show interface type slot/number 显示路由信息 show ip route 在IOS操作中,无论任何状态和位置,都可以键入“,”得到系统的帮助。 接入全局配置模式 config terminal password 设置访问用户及密码 username username password 设置特权密码 enable secret password 设置路由器名 hostname name 设置静态路由 ip route destination subnet-mask next-hop 端口设置 interface type slot/number 设置IP地址 ip address address subnet-mask 设置IPX网络 ipx network network 激活端口 no shutdown 物理线路设置 line type number 启动登录进程 login [local|tacacs server] 设置登录密码 password password (4)接口IP地址配置 接口设置 interface type slot/number 为接口设置IP地址 ip address ip-address mask 在串行链路上,一方必须提供时钟信号,由DCE(Data Communications Equipment)提供, 如CSU/DSU(Channel Service Unit/Data Service Unit);另一方是DTE。通常,Cisco路由器 被默认为DTE设备,但有时可用作DCE设备。如果使用接口提供时钟,必须使用clock rate 命令指定时钟频率。 Router(config)#interface serial 0/0 Router(config-if)#clock rate 1000000 (5)静态路由配置 静态路由是人工定义的路由,包从某源端按特定路径至某目的端。Ip route命令建立一个静态路由: Router(config)#ip route network [mask] [address | interface] [distance] [permanent]参数解释如下表: Network 目的网络或子网号 Mask 子网掩码 Ethernet 0 以太网端口 Address IP地址或下一跳路由器 Interface 接口名称用于到达目的网络 Distance 管理距离 Permanent 指定即使端口关闭仍然保持该路由 其中的管理距离是指路由选择信息源使用0到255之间的一个数字值表达的可信度等级。例如,管理距离是253,则其可信度极低。静态路由允许人工配置路由表中的一个静态路由。只要这条路径是有效的,路由表中的这一条目就不会动态的更改。一条静态路由可能反映网络管理员所知的某些关于网络情况的特殊知识。为静态路由人工输入的管理距离值通常是一些小数字。如果仅仅是通过静态路由定义了,那么就不在链路上发送路由选择更新数据,从而可以保持带宽。 一个路由器不可能知道到其他网络的所有路由,为提供可靠路由,它用一些路由器作为缺省路由器,并把其他路由器指向它们。ip default-network命令设置缺省路由:ip default-network network-number network-number是IP网络号或子网网络号,或ip route 0.0.0.0 0.0.0.0 {address | interface } [distance]。路由表中不存在目的网络的入口时,数据包就被发送到缺省的网络。当你需要一个路由,而该路由又只有目的网络的部分信息时,使用缺省网络号。因为该路由并不完全知道所有的目的网络,所以它可以用缺省网络号指明将作为未知网络号的方向。 2、路由器操作说明 1)登陆到路由器进入特权模式 从用户模式进入特权模式的指令:enable 从特权模式退出到用户模式的指令:disable 从路由器注销的指令:logout,exit 注:在特权模式下执行exit也会注销 2)指令基础 显示出当前模式下的所有可用指令: ? 显示出当前模式下的所有以show开头的可用指令:show ? 从特权模式进入配置模式的指令:config terminal 从配置模式退出到特权模式:ctrl+z,exit 例如:显示了所包含的时钟速率 R1(config-if)#clock rate ? Speed (bits per second 1200 2400 4800 9600 19200 38400 56000 64000 72000 125000 128000 148000 250000 500000 800000 1000000 1300000 2000000 4000000 <300-4000000> Choose clockrate from list above R1(config-if)#clock rate 72000 3) show指令介绍 显示路由器基本配置:show version 显示目前的路由协议:show protocols 显示闪存配置:show flash 显示当前路由器运行配置文件:show running-config 显示命令历史:show history 显示时间:show clock 显示主机名称:show hosts 显示当前用户:show users 显示路由器接口信息:show interfaces 4)CDP协议 CDP协议用来发现邻居路由器的信息;CDP工作在数据链路层,只能找到直连的路由器;CDP配 置默认是启动的。 1)全局配置指令: 关闭本路由器的CDP协议:no cdp run 启动CDP协议:cdp run 调整CDP协议的广播时间:cdp timer 120 (秒) 2)接口模式配置指令 启动该接口CDP协议:cdp enable 关闭该接口CDP协议:no cdp enable 3)显示CDP协议运行状态 显示接口上的CDP状态:show cdp interface 显示直连邻居路由器:show cdp neighhor 显示直连邻居路由器详细信息:show cpd neighbor detail 显示CDP协议基本状态:show cdp 5)指令基础 配置特权模式密码:enable password xxxx 配置特权模式密码(加密):enable secret xxxx 6)配置MOTD信息 配置进入路由器的欢迎信息: router#config>banner motd z welcom to hrb z 7)配置信息的保存 启动配置文件startup-config保存在NVRAM里面,路由器启动时,将startup-config拷贝到 内存中形成运行配置文件running-config 显示启动配置文件:show startup-config 显示当前运行配置文件:show running-config 将当前配置保存:copy running-config startup-config 8)端口配置 路由器端口类型:令牌环网,FDDI,以太网,串口,ISDN。 看端口状态:show interfaces 看某个具体端口信息:show interface serial 0 看所有端口基本状态:show ip int brief DTE和DCE的区别(DCE设备必须设置时钟) 判断某个接口属于DCE还是DTE:show controllers serial 0 配置某DCE端口的例子: eRouter#config t Enter configuration commands, one per line. End with CNTL/Z. eRouter(config)#interface serial 0 eRouter(config-if)#clock rate 56000 eRouter(config-if)#end 9)IP地址的基本配置方法 格式:ip address ip-address mask 10)Ping指令的使用 Router#ping ip-address 11)显示路由器IP状态 Router#shoe ip interface brief 12)ARP基础 显示ARP表:show arp 清除ARP表:clear arp 13)Host表 show hosts 14)静态路由配置 配置静态路由指令格式: ip route 目标网段 目标网段子网掩码 下一跳路由器端口 四、实验内容 课内实验任务:路由器的基本配置 1、实验准备 运用Cisco Packet Tracer软件设计如下网络拓扑图。不同型号的交换机配置命令不同,这里选择2600系列路由器的2621型号,交换机选择2900系列。IP地址、掩码和连接路由器的端口号如图所示。将网络拓扑图保存,并在Cisco Packet Tracer模拟器中打开该图。 IP: 11.0.0.2/24 IP: 192.168.1.2/24 f0/0 IP: 11.0.0.1/24 f0/0 f0/2 IP: 10.0.0.1/24 IP: 12.0.0.1/24 f0/1 s0/0 f0/1 f0/3 s0/0 IP: 12.0.0.2/24 IP: 192.168.1.3/24 f0/0 f0/0 IP: 10.0.0.2/24 IP: 192.168.1.1/24 2、实验过程 PC机2 台;Router-22621可扩展路由4台;Switch_2950交换机1台;DCE串口线;交叉线。 对于Router3和Router-4需要添加扩展 标准 excel标准偏差excel标准偏差函数exl标准差函数国标检验抽样标准表免费下载红头文件格式标准下载 串口模块(下图所示)。标准的串行端口通常从外观就能判断是DTE还是DCE,DTE是针头(俗称公头),DCE是孔头(俗称母头),这样两种接口才能接在一起。DCE端需要设置时钟,Cisco的串口线 模块WIC-1T, NM-4T, NM-4A/S,两头都是60针,两端分别标有DCE,DTE,可以分别插入 DB60 接口上。本实验完全在 Cisco Packet Tracer模拟器上完成,下面红色下划线文字均为配置过程输入的命令。 想? 1、 先点击关闭电源 2、 拖动添加WIC-1T模块, 增加Serial串口,扩展路由器功能 3、 再次打开电源 1)路由器基本配置 (1)连接到路由器Router3,熟悉路由器的基本操作指令。按照如下的命令对路由器进行操作。 Router>enable //enable用于进入特权模式 Router#conf terminal //进入配置模式 Router(config)#hostname R3 //设置Router3路由器的主机名为R3 R3(config)#enable password 123 //设置路由器的密码为123 R3(config)#enable secret 456 //设置路由器的特权模式密码为456 R3(config)#exit //退出全局配置模式 R3#show version //显示系统硬件和软件的状态 R3#show flash //显示系统闪存的信息 R3#show protocol //显示激活的网络路由信息 R3#show interface //显示当前的接口信息与状态 R3#show running-config //显示路由器的当前配置信息 R3#show startup-config //显示路由器的启动配置信息 R3#show ip route //显示当前的IP路由表 (2)按照网络拓扑图所示的IP地址规划、配置路由器R3的接口,操作如下。 R3#conf terminal //进入配置模式 R3(config)#interface fastEthernet 0/0 //配置快速以太网接口f0/0 R3(config-if)#ip address 11.0.0.1 255.255.255.0 //设置该接口IP地址和子网掩码 R3(config-if)#no shutdown //激活以太网接口f0/0端口 R3(config-if)#exit R3(config)#interface fastEthernet 0/1 //配置以太网接口f0/1 R3(config-if)#ip address 12.0.0.1 255.255.255.0 //设置该接口IP地址和子网掩码 R3(config-if)#no shutdown //激活以太网接口E1端口 R3(config-if)#exit R3(config)#interface serial 0/0 //配置串行接口S0 R3(config-if)#ip address 10.0.0.1 255.255.255.0 //设置该接口IP地址和子网掩码 R3(config-if)#bandwidth 128 //设置链路带宽为128kbit/s R3(config-if)#clock rate 64000 //设置DCE设备的时钟速率 R3(config-if)#no shutdown //激活串行接口S0端口 R3(config-if)#end (3)按照步骤(2)并根据实际的各接口参数完成对路由器R1、R2和R4各接口的配置。 2)为路由器添加静态路由和默认路由 (1)连接到PC1和PC2,设置IP地址,然后PING测试连接R1 ~ R4各接口的连通性。 (2)在路由器R3上添加一条静态路由,当存在目标网络为192.168.1.0/24的数据包时,通过 静态路由将该数据包转发到路由器R4,命令如下: R3(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.2 R3(config)#end (3)在R4路由器上添加一条默认路由,当网络192.168.1.0/24中的主机向外网发送数据包时, 无论目标网络为何地址,R4缺省将数据包转发到R3的S0端口,命令如下: R4(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1 R3(config)#end 3)测试路由器接口、静态路由和缺省路由 (1)连接到路由器R3,测试R3各接口及连接到各个路由接口和主机的的连通状态,测试到R4 的静态路由。 R3#ping 11.0.0.2 R3#ping 12.0.0.2 R3#ping 10.0.0.2 R3#ping 192.168.1.1 R3#ping 192.168.1.2 R3#traceroute 192.168.1.1 R3#ping 11.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 11.0.0.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms R3#ping 12.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms R3#ping 10.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms R3#ping 192.168.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/32 ms R3#ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 2/23/31 ms R3#tra R3#traceroute 192.168.1.1 Type escape sequence to abort. Tracing the route to 192.168.1.1 1 10.0.0.2 31 msec 0 msec 16 msec R3# (2)连接到路由器R4,测试R4各接口及连接到各个路由接口和主机的的连通状态,测试到R3的默认路由。 R4#ping 10.0.0.2 R4#traceroute 10.0.0.1 Router#ping 10.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 47/59/62 ms Router#rea Router#tra Router#traceroute 10.0.0.1 Type escape sequence to abort. Tracing the route to 10.0.0.1 1 10.0.0.1 16 msec 16 msec 16 msec Router# (3)连接到PC1和PC2,PING测试连接R1 ~ R4各接口的连通性。是否连通,若不能连通,原因是什么,如何解决, PC1 PC2与R1 R2各接口都不通 与R3 R4可通 (4)配置R1和R2路由器的静态路由或者默认路由,再次连接到PC1和PC2,PING测试连接R1 ~ R4各接口的连通性。是否连通, 在R1上添加静态路由 R1>enable Password: Password: R1#conf ter R1#conf terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route 192.168.1.0 255.255.255.0 11.0.0.1 R1(config)#end 在R2上添加默认路由 Router>enable Router#conf ter Router#conf terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ip rou Router(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.1 Router(config)#end 此时PC1 PC2与R1-R4各接口都可通 C:\>ping 11.0.0.2 Pinging 11.0.0.2 with 32 bytes of data: Reply from 11.0.0.2: bytes=32 time=1ms TTL=253 Reply from 11.0.0.2: bytes=32 time=1ms TTL=253 Ping statistics for 11.0.0.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 1ms, Average = 1ms Control-C ^C C:\>ping 12.0.0.2 Pinging 12.0.0.2 with 32 bytes of data: Reply from 12.0.0.2: bytes=32 time=1ms TTL=253 Reply from 12.0.0.2: bytes=32 time=1ms TTL=253 Ping statistics for 12.0.0.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 1ms, Average = 1ms Control-C ^C C:\> C:\>ping 11.0.0.1 Pinging 11.0.0.1 with 32 bytes of data: Reply from 11.0.0.1: bytes=32 time=1ms TTL=254 Reply from 11.0.0.1: bytes=32 time=2ms TTL=254 Ping statistics for 11.0.0.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 2ms, Average = 1ms Control-C ^C C:\>ping 12.0.0.1 Pinging 12.0.0.1 with 32 bytes of data: Reply from 12.0.0.1: bytes=32 time=1ms TTL=254 Ping statistics for 12.0.0.1: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 1ms, Average = 1ms Control-C ^C C:\>ping 10.0.0.1 Pinging 10.0.0.1 with 32 bytes of data: Reply from 10.0.0.1: bytes=32 time=2ms TTL=254 Ping statistics for 10.0.0.1: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 2ms, Maximum = 2ms, Average = 2ms Control-C ^C C:\>ping 10.0.0.2 Pinging 10.0.0.2 with 32 bytes of data: Reply from 10.0.0.2: bytes=32 time<1ms TTL=255 Ping statistics for 10.0.0.2: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 192.168.1.1 Pinging 192.168.1.1 with 32 bytes of data: Reply from 192.168.1.1: bytes=32 time<1ms TTL=255 Ping statistics for 192.168.1.1: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\> 实验小结 Cisco路由器IOS软件的指令集提供了丰富的指令以完成对路由器的设置、监控和查询,需要 很好地熟悉这些指令。当使用静态和默认路由配置后,在路由器的路由表中就会添加一条静态路由 或默认路由,可以通过“show ip route”命令查看。另外,本实验是针对Cisco公司路由器设计的, 如有其他厂商的路由器,也可以按照此方法进行实验,但操作指令会有差异。 4.2 课外实验任务: VLAN间的路由器配置(单臂路由) 1、相关知识 VLAN中继协议(VTP,VLAN TRUNKING PROTOCOL)是CISCO专用协议,大多数交换机都支持该协议。VTP负责在VTP域内同步VLAN信息,这样就不必在每个交换上配置相同的VLAN信息。VTP只负责通告vlan,而具体哪个端口属于哪个vlan需要网络管理员在不同的交换机上进行不同配置。 也就是说,网络管理员在通告vlan的VTP服务器上把某个端口配置给某个vlan,在其它交换机上是看不到的。 1)VTP的工作原理 VLAN中继协议(VTP)利用第2层中继帧,在一组交换机之间进行VLAN通信(VTP从一个中心控制点开始,维护整个企业网上VLAN的添加和重命名工作,确保配置的一致性。为了实现此功能,必须先建立一个VTP管理域,以使它能管理网络上当前的VLAN。在同一管理域中的交换机共享它们的VLAN信息,并且,一个交换机只能参加到一个VTP管理域,不同域中的交换机不能共享VTP信息。 交换机间交换下列信息: , 管理域域名 , 配置的修订号 , 已知虚拟局域网的配置信息 交换机使用配置修正号,来决定当前交换机的内部数据是否应该接受从其他交换机发来的VTP更新信息。如果接收到的VTP更新配置修订号与内部数据库的修订号相同域者比它小,交换机忽略更新。否则,就更新内部数据库,接受更新信息。 VTP管理域在安全模式下,必须配置一个在VTP域中所有交换机惟一的口令。VTP的运行特点: , VTP通过发送到特定MAC地址01,00,0C,CC,CC,CC的组播VTP消息进行工作; , VTP通告只通过中继端口传递; , VTP消息通过VLAN1传送((这就是不能将VLAN1从中继链路中去除的原因); , VTP域内的每台交换机都定期在每个中继端口上发送通告到保留的VTP组播地址; , VTP通告可以封装在ISL或者IEEE802.1Q帧内。 缺省情况下,交换机处于VTP服务器模式,并且不属于任何管理域,直到交换机通过中继链路接收了关于一个域的通告,或者在交换机上配置了一个VLAN管理域,交换机才能在VTP服务器上把创建或者更改VLAN的消息通告给本管理域内的其他交换机。 如果在VTP服务器上进行了VLAN配置变更,所做的修改会传播到VTP域内的所有交换机上。如果交换机配置为:透明:模式,可以创建或者修改VLAN,但所做的修改只影响单个的交换机 控制VTP功能的一项关键参数是VTP配置修改编号。这个32位的数字表明了VTP配置的特定修改版本。配置修改编号的取值从0开始,每修改一次,就增加1直到达到4294967295,然后循环归0,并重新开始增加。每个VTP设备会记录自己的VTP配置修改编号;VTP数据包会包含发送者的VTP配置 这一信息用于确定接收到的信息是否比当前的信息更新。 修改编号。 2)VTP的运行模式 VTP模式有3种,分别是: , 服务器模式(SERVER 缺省) VTP服务器控制着它们所在域中VALN的生成和修改(所有的VTP信息都被通告在本域中的其他交换机,而且,所有这些VTP信息都是被其他交换机同步接收的( , 客户机模式(CLIENT) VTP客户机不允许管理员创建、修改或删除VLAN。它们监听本域中其他交换机的VTP通告,并相应修改它们的VTP配置情况( , 透明模式(TRANSPARENT) VTP透明模式中的交换机不参与VTP(当交换机处于透明模式时,它不通告其VLAN配置信息(而 且,它的VLAN数据库更新与收到的通告也不保持同步(但它可以创建和删除本地的VLAN(不过,这些VLAN的变更不会传播到其他任何交换机上。 2、实验准备 运用Cisco Packet Tracer软件设计如下网络拓扑图。不同型号的交换机配置命令不同,这里选择2900系列交换机的2950型号,路由器采用2600系列的2620型号。PC的IP地址、子网掩码和连接交换机的端口号如图所示。将网络拓扑图保存,并在Cisco Packet Tracer模拟器中打开该图。 f0/0.1 IP : 172.16.10.1/24 f0/0.2 IP : 172.16.20.1/24 f0/0.3 IP : 172.16.30.1/24 管理IP : 172.16.10.2/24 封装802.1q f0/1 : trunk 管理IP : 172.16.10.3/24 f0/2 : vlan 2 f0/0 f0/2 : vlan 2 f0/3 : vlan 3 f0/3 : vlan 3 f0/4 : trunk f0/4 : trunk f0/5 : trunk f0/5 : trunk f0/1 f0/4 f0/4 f0/2 f0/5 f0/5 f0/3 f0/3 f0/2 IP : 172.16.20.2/24 IP : 172.16.20.3/24 Gatway : 172.16.20.1 Gatway : 172.16.20.1 IP : 172.16.30.3/24 IP : 172.16.30.2/24 Gatway : 172.16.30.1 Gatway : 172.16.30.1 3、实验过程 在下列各项的操作中,黑色字体为提示符,红色文字为操作命令,绿色字体为操作的注释。 (1)配置各个PC主机的IP和网关地址(方法参见实验3) (2)交换机2950A配置 1、选择Switch0,配置交换机主机名、管理ip、默认网关 Switch>en Switch#config t Switch(config)#hostname 2950A 2950A(config)#int vlan1 //进入vlan1接口模式 2950A(config-if)#ip address 172.16.10.2 255.255.255.0 //设置管理IP地址 2950A(config-if)#no shut 2950A(config-if)#exit 2950A(config)#ip default-gateway 172.16.10.1 //设置默认网关IP地址 2950A(config)#exit 2、配置vtp,把2950A交换机设置成客户机模式,2950A从2950B接收vlan信息 2950A#vlan database 2950A(vlan)#vtp client //将设置为2950A交换机设置成VTP客户机模式 2950A(vlan)#vtp domain cisco // 设置VTP域为cisco 3、创建Vlan 2950A(vlan)#vlan 2 name sales // 将vlan 2设置名称为sales 2950A(vlan)#vlan 3 name markets // 将vlan 3设置名称为markets 2950A(vlan)#exit 4、将交换机端口分配到vlan中 2950A#config t 2950A(config)#int f0/2 2950A (config-if)#switchport mode access //设置2端口为access模式 2950A(config-if)#switchport access vlan 2 2950A(config-if)#exit 2950A(config)#int f0/3 2950A (config-if)#switchport mode access //设置3端口为access模式 2950A(config-if)#switchport access vlan 3 2950A(config-if)#end 5、用ping命令测试PC、交换机和路由器之间的连通性,记录结果。 使用2950A PING各PC机无法联通 2950A#ping 172.16.20.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.2, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) 2950A#ping 172.16.30.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.2, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) 2950A#ping 172.16.20.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) 2950A#ping 172.16.30.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) 6、配置中继口(即trunk口) 2950A#config t 2950A(config)#int f0/1 //进入f0/1端口 2950A(config-if)#switchport mode trunk //设置f0/1端口为trunk模式 2950A(config-if)#exit 2950A(config)#int f0/4 //进入f0/4端口 2950A(config-if)#switchport mode trunk //设置f0/4端口为trunk模式 2950A(config-if)#exit 2950A(config)#int f0/5 //进入f0/5端口 2950A(config-if)#switchport mode trunk //设置f0/5端口为trunk模式 2950A(config-if)#end 7、保存配置 2950A#copy run start (3)交换机2950B配置 1、选择Switch1,配置交换机主机名、管理ip、默认网关 Switch>en Switch#config t Switch(config)#hostname 2950B 2950B(config)#int vlan 1 2950B(config-if)#ip address 172.16.10.3 255.255.255.0 2950B(config-if)#no shut 2950B(config-if)#exit 2950A(config)#ip default-gateway 172.16.10.1 2950B(config)#exit 2、配置vtp,把2950B交换机设置成服务器模式,2950A从2950B接收vlan信息 2950B#vlan database 2950B(vlan)#vtp server //将设置为2950B交换机设置成VTP服务器模式 2950B(vlan)#vtp domain cisco // 设置VTP域为cisco 3、创建Vlan 2950B(vlan)#vlan 2 name sales 2950B(vlan)#vlan 3 name markets 2950B(vlan)#exit 4、将交换机端口分配到vlan中 2950B#config t 2950B(config)#int f0/2 2950B(config-if)#switchport mode access //设置2端口为access模式 2950B(config-if)#switchport access vlan 2 2950B(config-if)#exit 2950B(config)#int f0/3 2950B (config-if)#switchport mode access //设置3端口为access模式 2950B(config-if)#switchport access vlan 3 2950B(config-if)#end 5、用ping命令测试PC、交换机和路由器之间的连通性,记录结果。 使用2950B PING各PC机无法联通 2950B#ping 172.16.20.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.2, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) 2950B#ping 172.16.30.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.2, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) 2950B#ping 172.16.20.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) 2950B#ping 172.16.30.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) PING交换机2950A可联通 2950B#ping 172.16.10.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.10.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/3 ms 6、配置中继口(即trunk口) 2950B#config t 2950B(config)#int f0/4 //进入f0/4端口 2950B(config-if)#switchport mode trunk //设置f0/4端口为trunk模式 2950B(config-if)#exit 2950B(config)#int f0/5 //进入f0/5端口 2950B(config-if)#switchport mode trunk //设置f0/5端口为trunk模式 2950B(config-if)#end 2950B# 7、保存配置 2950B#copy run start (4)vlan网络的路由器配置 1、配置路由器主机名、清除f0/0端口ip地址、启动f0/0端口 Router>en Router#config t Router(config)#hostname TrunkRouter TrunkRouter(config)#int f0/0 TrunkRouter(config-if)#no ip address //删除f0/0端口的IP地址 TrunkRouter(config-if)#no shut TrunkRouter(config-if)#exit 2、将路由器的快速以太网端口fa0/0划分为三个子接口fa0/0.1、fa0/0.2和fa0/0.3,对每个子 接口配置,并采用802.1q的数据封装。创建子接口,并定义封装类型,给子接口分配ip地址 TrunkRouter(config)#int f0/0.1 TrunkRouter(config-subif)#encapsulation dot1q 1 TrunkRouter(config-subif)#ip address 172.16.10.1 255.255.255.0 TrunkRouter(config-subif)#exit TrunkRouter(config)#int f0/0.2 TrunkRouter(config-subif)#encapsulation dot1q 2 TrunkRouter(config-subif)#ip address 172.16.20.1 255.255.255.0 TrunkRouter(config-subif)#exit TrunkRouter(config)#int f0/0.3 TrunkRouter(config-subif)#encapsulation dot1q 3 TrunkRouter(config-subif)#ip address 172.16.30.1 255.255.255.0 TrunkRouter(config-subif)#end 3、保存配置 TrunkRouter#copy run start (5)实验验证 1)连通性测试: A、在路由器上用ping命令测试与交换机和其他主机的连通性,验证各个主机之间的连通性。 截图记录连通性测试结果。 路由器与各交换机和各PC机均可联通 TrunkRouter#ping 172.16.10.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.10.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms TrunkRouter#ping 172.16.10.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.10.3, timeout is 2 seconds: ..!!! Success rate is 60 percent (3/5), round-trip min/avg/max = 0/2/3 ms TrunkRouter#ping 172.16.20.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 0/1/2 ms TrunkRouter#ping 172.16.30.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/3 ms TrunkRouter#ping 172.16.20.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.3, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/1 ms TrunkRouter#ping 172.16.30.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.3, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/3 ms B、在交换机上用ping命令测试与路由器和其他主机的连通性,验证各个主机之间的连通性。 截图记录连通性测试结果。 交换机2950A与路由器、交换机2950B、各PC机,均可联通 2950A>ping 172.16.10.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms 2950A>ping 172.16.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms 2950A>ping 172.16.30.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms 2950A>ping 172.16.10.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.10.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/3 ms 2950A>ping 172.16.20.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms 2950A>ping 172.16.30.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/2/7 ms 2950A>ping 172.16.20.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms 2950A>ping 172.16.30.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/3/11 ms 交换机2950B与路由器、交换机2950A、各PC机,均可联通 2950B#ping 172.16.10.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 ms 2950B#ping 172.16.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms 2950B#ping 172.16.30.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/3 ms 2950B#ping 172.16.10.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.10.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/3 ms 2950B#ping 172.16.20.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms 2950B#ping 172.16.30.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/4 ms 2950B#ping 172.16.20.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.20.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/2 ms 2950B#ping 172.16.30.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.30.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/9 ms C、在各个PC上用ping命令测试与路由器、交换机和其他主机的连通性,验证各个主机之间 的连通性。截图记录连通性测试结果。 PCA-20与路由器、各交换机、其他PC机,均可联通 C:\>ping 172.16.10.1 Pinging 172.16.10.1 with 32 bytes of data: Reply from 172.16.10.1: bytes=32 time<1ms TTL=255 Reply from 172.16.10.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.10.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.20.1 Pinging 172.16.20.1 with 32 bytes of data: Reply from 172.16.20.1: bytes=32 time=1ms TTL=255 Reply from 172.16.20.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.20.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\>ping 172.16.30.1 Pinging 172.16.30.1 with 32 bytes of data: Reply from 172.16.30.1: bytes=32 time<1ms TTL=255 Reply from 172.16.30.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.30.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.10.2 Pinging 172.16.10.2 with 32 bytes of data: Reply from 172.16.10.2: bytes=32 time<1ms TTL=254 Reply from 172.16.10.2: bytes=32 time<1ms TTL=254 Ping statistics for 172.16.10.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.10.3 Pinging 172.16.10.3 with 32 bytes of data: Reply from 172.16.10.3: bytes=32 time=2ms TTL=254 Reply from 172.16.10.3: bytes=32 time=14ms TTL=254 Ping statistics for 172.16.10.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 2ms, Maximum = 14ms, Average = 8ms Control-C ^C C:\>ping 172.16.30.2 Pinging 172.16.30.2 with 32 bytes of data: Reply from 172.16.30.2: bytes=32 time<1ms TTL=127 Reply from 172.16.30.2: bytes=32 time=1ms TTL=127 Ping statistics for 172.16.30.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\>ping 172.16.20.3 Pinging 172.16.20.3 with 32 bytes of data: Reply from 172.16.20.3: bytes=32 time<1ms TTL=128 Reply from 172.16.20.3: bytes=32 time<1ms TTL=128 Ping statistics for 172.16.20.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.30.3 Pinging 172.16.30.3 with 32 bytes of data: Reply from 172.16.30.3: bytes=32 time<1ms TTL=127 Reply from 172.16.30.3: bytes=32 time=1ms TTL=127 Ping statistics for 172.16.30.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\> PCA-30与路由器、各交换机、其他PC机,均可联通 C:\>ping 172.16.10.1 Pinging 172.16.10.1 with 32 bytes of data: Reply from 172.16.10.1: bytes=32 time<1ms TTL=255 Reply from 172.16.10.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.10.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.20.1 Pinging 172.16.20.1 with 32 bytes of data: Reply from 172.16.20.1: bytes=32 time<1ms TTL=255 Reply from 172.16.20.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.20.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.30.1 Pinging 172.16.30.1 with 32 bytes of data: Reply from 172.16.30.1: bytes=32 time<1ms TTL=255 Reply from 172.16.30.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.30.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.10.2 Pinging 172.16.10.2 with 32 bytes of data: Reply from 172.16.10.2: bytes=32 time<1ms TTL=254 Reply from 172.16.10.2: bytes=32 time=3ms TTL=254 Ping statistics for 172.16.10.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 3ms, Average = 1ms Control-C ^C C:\>ping 172.16.10.3 Pinging 172.16.10.3 with 32 bytes of data: Reply from 172.16.10.3: bytes=32 time<1ms TTL=254 Reply from 172.16.10.3: bytes=32 time=1ms TTL=254 Ping statistics for 172.16.10.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\>ping 172.16.20.2 Pinging 172.16.20.2 with 32 bytes of data: Reply from 172.16.20.2: bytes=32 time<1ms TTL=127 Reply from 172.16.20.2: bytes=32 time<1ms TTL=127 Ping statistics for 172.16.20.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: um = 0ms, Maximum = 0ms, Average = 0ms Minim Control-C ^C \>ping 172.16.20.3 C: Pinging 172.16.20.3 with 32 bytes of data: Reply from 172.16.20.3: bytes=32 time<1ms TTL=127 Reply from 172.16.20.3: bytes=32 time<1ms TTL=127 Ping statistics for 172.16.20.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C \>ping 172.16.30.3 C: Pinging 172.16.30.3 with 32 bytes of data: Reply from 172.16.30.3: bytes=32 time<1ms TTL=128 Reply from 172.16.30.3: bytes=32 time<1ms TTL=128 Ping statistics for 172.16.30.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\> PCB-20与路由器、各交换机、其他PC机,均可联通 C:\>ping 172.16.10.1 Pinging 172.16.10.1 with 32 bytes of data: Reply from 172.16.10.1: bytes=32 time<1ms TTL=255 Reply from 172.16.10.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.10.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.20.1 Pinging 172.16.20.1 with 32 bytes of data: Reply from 172.16.20.1: bytes=32 time=1ms TTL=255 Reply from 172.16.20.1: bytes=32 time=9ms TTL=255 Ping statistics for 172.16.20.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 9ms, Average = 5ms Control-C ^C C:\>ping 172.16.30.1 Pinging 172.16.30.1 with 32 bytes of data: Reply from 172.16.30.1: bytes=32 time=1ms TTL=255 Reply from 172.16.30.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.30.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\>ping 172.16.10.2 Pinging 172.16.10.2 with 32 bytes of data: Reply from 172.16.10.2: bytes=32 time<1ms TTL=254 Reply from 172.16.10.2: bytes=32 time<1ms TTL=254 Ping statistics for 172.16.10.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.10.3 Pinging 172.16.10.3 with 32 bytes of data: Reply from 172.16.10.3: bytes=32 time<1ms TTL=254 Reply from 172.16.10.3: bytes=32 time<1ms TTL=254 Ping statistics for 172.16.10.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.20.2 Pinging 172.16.20.2 with 32 bytes of data: Reply from 172.16.20.2: bytes=32 time<1ms TTL=128 Reply from 172.16.20.2: bytes=32 time<1ms TTL=128 Ping statistics for 172.16.20.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.30.2 Pinging 172.16.30.2 with 32 bytes of data: Reply from 172.16.30.2: bytes=32 time<1ms TTL=127 Reply from 172.16.30.2: bytes=32 time<1ms TTL=127 Ping statistics for 172.16.30.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.30.3 Pinging 172.16.30.3 with 32 bytes of data: Reply from 172.16.30.3: bytes=32 time=1ms TTL=127 Reply from 172.16.30.3: bytes=32 time<1ms TTL=127 Ping statistics for 172.16.30.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\> PCB-30与路由器、各交换机、其他PC机,均可联通 C:\>ping 172.16.10.1 Pinging 172.16.10.1 with 32 bytes of data: Reply from 172.16.10.1: bytes=32 time=2ms TTL=255 Reply from 172.16.10.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.10.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 2ms, Average = 1ms Control-C ^C C:\>ping 172.16.20.1 Pinging 172.16.20.1 with 32 bytes of data: Reply from 172.16.20.1: bytes=32 time<1ms TTL=255 Reply from 172.16.20.1: bytes=32 time=1ms TTL=255 Ping statistics for 172.16.20.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\>ping 172.16.30.1 Pinging 172.16.30.1 with 32 bytes of data: Reply from 172.16.30.1: bytes=32 time<1ms TTL=255 Reply from 172.16.30.1: bytes=32 time<1ms TTL=255 Ping statistics for 172.16.30.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.10.2 Pinging 172.16.10.2 with 32 bytes of data: Reply from 172.16.10.2: bytes=32 time<1ms TTL=254 Reply from 172.16.10.2: bytes=32 time<1ms TTL=254 Ping statistics for 172.16.10.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.10.3 Pinging 172.16.10.3 with 32 bytes of data: Reply from 172.16.10.3: bytes=32 time<1ms TTL=254 Reply from 172.16.10.3: bytes=32 time<1ms TTL=254 Ping statistics for 172.16.10.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\>ping 172.16.20.2 Pinging 172.16.20.2 with 32 bytes of data: Reply from 172.16.20.2: bytes=32 time<1ms TTL=127 Reply from 172.16.20.2: bytes=32 time=1ms TTL=127 Ping statistics for 172.16.20.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\>ping 172.16.30.2 Pinging 172.16.30.2 with 32 bytes of data: Reply from 172.16.30.2: bytes=32 time=1ms TTL=128 Reply from 172.16.30.2: bytes=32 time<1ms TTL=128 Ping statistics for 172.16.30.2: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms Control-C ^C C:\>ping 172.16.20.3 Pinging 172.16.20.3 with 32 bytes of data: Reply from 172.16.20.3: bytes=32 time<1ms TTL=127 Reply from 172.16.20.3: bytes=32 time<1ms TTL=127 Ping statistics for 172.16.20.3: Packets: Sent = 2, Received = 2, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Control-C ^C C:\> 2)在路由器和交换机上用show run命令查看结果,截图记录结果。 路由器: TrunkRouter#show run Building configuration... Current configuration : 681 bytes ! version 12.2 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname TrunkRouter ! ! ! ! ! ! ! ! ip cef no ipv6 cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address duplex auto speed auto ! interface FastEthernet0/0.1 encapsulation dot1Q 1 native ip address 172.16.10.1 255.255.255.0 ! interface FastEthernet0/0.2 encapsulation dot1Q 2 ip address 172.16.20.1 255.255.255.0 ! interface FastEthernet0/0.3 encapsulation dot1Q 3 ip address 172.16.30.1 255.255.255.0 ! ip classless ! ip flow-export version 9 ! ! ! ! ! ! ! line con 0 ! line aux 0 ! line vty 0 4 login ! ! ! end 交换机2950A: 2950A#show run Building configuration... Current configuration : 1193 bytes ! version 12.1 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname 2950A ! ! ! spanning-tree mode pvst ! interface FastEthernet0/1 switchport mode trunk ! interface FastEthernet0/2 switchport access vlan 2 switchport mode access ! interface FastEthernet0/3 switchport access vlan 3 switchport mode access ! interface FastEthernet0/4 switchport mode trunk ! interface FastEthernet0/5 switchport mode trunk ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! interface FastEthernet0/8 ! interface FastEthernet0/9 ! interface FastEthernet0/10 ! interface FastEthernet0/11 ! interface FastEthernet0/12 ! interface FastEthernet0/13 ! interface FastEthernet0/14 ! interface FastEthernet0/15 ! interface FastEthernet0/16 ! interface FastEthernet0/17 ! interface FastEthernet0/18 ! interface FastEthernet0/19 ! interface FastEthernet0/20 ! interface FastEthernet0/21 ! interface FastEthernet0/22 ! interface FastEthernet0/23 ! interface FastEthernet0/24 ! interface Vlan1 ip address 172.16.10.2 255.255.255.0 ! ip default-gateway 172.16.10.1 ! ! ! ! line con 0 ! line vty 0 4 login line vty 5 15 login ! ! ! end 交换机2950B: 2950B#show run Building configuration... Current configuration : 1170 bytes ! version 12.1 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname 2950B ! ! ! spanning-tree mode pvst ! interface FastEthernet0/1 ! interface FastEthernet0/2 switchport access vlan 2 switchport mode access ! interface FastEthernet0/3 switchport access vlan 3 switchport mode access ! interface FastEthernet0/4 switchport mode trunk ! interface FastEthernet0/5 switchport mode trunk ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! interface FastEthernet0/8 ! interface FastEthernet0/9 ! interface FastEthernet0/10 ! interface FastEthernet0/11 ! interface FastEthernet0/12 ! interface FastEthernet0/13 ! interface FastEthernet0/14 ! interface FastEthernet0/15 ! interface FastEthernet0/16 ! interface FastEthernet0/17 ! interface FastEthernet0/18 ! interface FastEthernet0/19 ! interface FastEthernet0/20 ! interface FastEthernet0/21 ! interface FastEthernet0/22 ! interface FastEthernet0/23 ! interface FastEthernet0/24 ! interface Vlan1 ip address 172.16.10.3 255.255.255.0 ! ip default-gateway 172.16.10.1 ! ! ! ! line con 0 ! line vty 0 4 login line vty 5 15 login ! ! ! end 五、实验报告要求 1、说明如何使用IP协议进行子网划分。 2、完整记录路由器、交换机和VLAN配置过程及配置参数。
本文档为【实验4 路由器与静态路由配置】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_729658
暂无简介~
格式:doc
大小:178KB
软件:Word
页数:0
分类:企业经营
上传时间:2017-10-20
浏览量:41