计算机网络实训总结报告1 构建小型家庭办公网络新建拨号连接:开始、所有程序、附件、通讯、新建连接向导…新建拨号连接:开始、所有程序、附件、通讯、新建连接向导…双绞线制作直通双绞线线序(1~8号线):白橙橙白绿蓝白蓝绿白棕棕交叉双绞线线序(1~8号线):白绿绿白橙蓝白蓝橙白棕棕IP配置本地连接、属性、常规、Internet 协议(TCP/IP)连通性测试:开始、运行、cmd命令、确定、操作系统命令行窗口C:\Documents ang setting \Administrator>ping 192.168.1.10 回车查看应答信息双网卡代理服务接入ADSL操作系统命令行窗口C:\Documents ang setting \Administrator> ipconfig/all查询IP 地址、子网掩码、默认网关、DNS服务地址构建中小型企业内部网络MAC地址:交换机有学习该地址的功能MAC地址是指任何网络结点的物理地址,全球唯一。
MAC地址PC查询:ipconfig/allMAC地址交换机中查询:show mac-address-table 或show interface帧结构:帧目的地址、帧源地址、帧类型、帧数据、帧校验如果交换机中该表已满,这时新地址的数据帧发过来的处理:在各MAC地址都没有过期的情况下实行广播,有过期地址时,替换过期地址,OSI模型(由高到低):应用、表示、会话、传输、网络、数据链路、物理层交换机工作在数据链路层,路由器工作在网络层交换机带内管理开始、程序、附件、通讯、超级终端、新建连接(代表性名称)、链接到(COM 口)、COM属性(还原为默认值)、进入超级终端初始界面2 Telnet 配置——带内管理A.进入全局配置模式Switch>enableSwitch#configSwitch(Config)#B.在群居配置模式下,为交换机设置授权Telnet用户Switch(Config)# telnet-user dcun(新建连接名称)password 0(代表明码,密码时为7)digital(用户设置的密码)Switch(Config)# interface vlan 1Switch(Config-Interface-Vlan1)# ip address 192.168.1.100 255.255.255.0验证PC的连通性:Switch # ping 192.168.1.100应答信息中“!!!!!”表示联通“…..”表示失败PC登陆交换机配置:PC中单击“开始”、运行,对话框”telnet 192.168.1.100”Login:dcunPassword:*******Switch>交换机的Web管理——带内管理全局模式下,为交换机设置授权的HTTP用户Switch(Config)# web-user admin password 0 digital在PC端使用HTTP登陆交换机进行Web管理地址栏:http://192.168.1.100回车,输入用户名(admin)与口令(digital)进入管理界面交换机配置文件管理——带内管理使用Tftpd 32.Exe 文件在交换机中启动配置文件的保存过程Switch # copy startup-config tftp://192.168.1.10/startup 1交换机更改后的配置文件传回交换机Switch # copy tftp://192.168.1.10/startup 1/ startup-config配置文件回传的查看Switch # show startup-config交换机的配置模式与配置帮助命令Switch >Switch > enableSwitch # configSwitch(config)# enable password level adminCurrent password:New password:*****Confirm new password:*****Switch (Config)# exitSwitch # writeSwitch #验证方法:Switch # show running-config使用interface 命令进入接口配置模式Switch(Config)# interface enthernet 0/0/1Switch(Config-Enthernet 0/0/1)#Switch(Config)# interface vlan 1Switch(Config-If-Vlan 1)#使用no 命令配置enable口令清除Switch(Config)# no enable password level adminInput Password:***Switch(Config)#配置文件的初始化处理Switch # set defaultSwitch # writeSwitch # reload实施生成树协议以避免产生网络环路生成树协议:网络链路的冗余备份、抑制广播风暴首先关闭默认开启的生成树协议:Switch(Config)# no spanning-treeSwitchA(Config)# spanning-tree mode stp(实验室:SwitchA(Config)# spanning-tree)SwitchB(Config)# spanning-tree mode stp交换机生成树的查询SwitchA # show spanning-tree反馈信息中关注点:Root Id:32768.00:03:0f:00:5d:5032768(32768=4096*8)为交换机的优先级,可改变00:03:0f:00:5d:50 为交换机的MAC地址全局命令模式配置命令”spanning-tree mst * priority”改变根交换机链路聚合提升骨干链路带宽连接PC与终端,配置交换机初始环境Switch(Config)# no spnning-tree //关闭生成树协议静态配置交换机,实现交换机之间两个端口的静态链路聚合Switch A(Config)# port-group 1Switch A(Config)#interface enthernet 0/0/1-2 //创建链路聚合组Switch A(Config-Port-Range)# port-group 1 mode onSwitch A(Config-Port-Range)# exit连接两台交换机之间的另一条链路,验证链路聚合结果清空静态配置的链路聚合,网络拓扑回复初始环境Switch A(Config)# no port-group 1使用动态方式配置链路聚合的端口,连接两端口,PC验证Switch A(Config)# interface enthernet 0/0/1-2Switch A(Config-Port-Range)# port-group 1 mode active 在交换机中验证拦路聚合结果Switch A # show port-group brief实验结论:链路聚合可以有效地解决链路带宽和冗余链路备份即使两台交换机之间存在环路也不会产生广播风暴跨交换机的vlan连通连接PC和交换机,使用直通双绞线连通两台交换机的24端口配置交换机的单机vlan,并加以验证Switch(Config)# vlan 10Switch(Config- Vlan 10)# switchport interface enthernet 0/0/1-5Switch(Config- Vlan 10)# exitSwitch(Config)# vlan20Switch(Config- Vlan20)# switchport interface enthernet 0/0/6-10Switch(Config- Vlan 20)# exit配置交换机之间的连通端口,并且通过PC验证是否已经生效Switch(Config)# interface enthernet 0/0/24Switch(Config-Enthernet0/0/24)# switchport mode trunkSwitch(Config-Enthernet0/0/24)# switchport trunk allowed vlan allSwitch(Config-Enthernet0/0/24)# exit更改两交换机连接端口的一端,并验证PC之间连接效果Switch 1(Config-Enthernet0/0/24)# switchport trunk native vlan10讲两交换机之间的连接线缆一端更换为直接连接PC,验证连通效果使用三层交换机实现vlan之间互访将三层交换机与PC连通,并配置相应vlan,验证vlan之间的连通性Switch 3(Config)# vlan 10Switch 3(Config- Vlan 10)# switchport interface enthernet 0/0/1Switch 3(Config- Vlan 10)# exitSwitch 3(Config)# vlan20Switch 3(Config- Vlan20)# switchport interface enthernet 0/0/2Switch 3(Config- Vlan 20)# exit配置三层交换机各vlan之间的三层属性,在PC中默认网关为vlan的三层IP 地址,再次测试PC之间的连通性Switch 3(Config)# interface vlan 10Switch 3(Config-If-Vlan 10)# ip address 192.168.1.1 255.255.255.0Switch 3(Config-If-Vlan 10)# no shutdownSwitch 3(Config-If-Vlan 10)# exitSwitch 3(Config)# interface vlan 20Switch 3(Config-If-Vlan 20)# ip address 192.168.2.1 255.255.255.0Switch 3(Config-If-Vlan 20)# no shutdownSwitch 3(Config-If-Vlan 20)# exitPC中验证ping命令验证与另一台PC的连通性C:\Documents ang setting \Administrator>ping 192.168.1.10将两台交换机使用双绞线分别同三层交换机的剩余端口中的两个端口连接划分二层交换机的vlanSwitch 1(Config)# vlan 10Switch 1(Config- Vlan 10)# switchport interface enthernet 0/0/1-5Switch 1(Config- Vlan 10)# exitSwitch 2(Config)# vlan20Switch 2(Config- Vlan20)# switchport interface enthernet 0/0/6-10Switch 2(Config- Vlan 20)# exit配置3层交换机,是它们之间的vlan 具有统一性Switch 1(Config)# switchport enthernet 0/0/24Switch 1(Config-Enthernet0/0/24)# switchport mode trunkSwitch 1(Config-Enthernet0/0/24)# switchport mode trunk allowed vlan allSwitch 1(Config-Enthernet0/0/24)# exitSwitch 2(Config)# switchport enthernet 0/0/24Switch 2(Config-Enthernet0/0/24)# switchport mode trunkSwitch 2(Config-Enthernet0/0/24)# switchport mode trunk allowed vlan allSwitch 2(Config-Enthernet0/0/24)# exitSwitch 3(Config)# switchport enthernet 0/0/3-4Switch 3(Config-Enthernet0/0/24)# switchport mode trunkSwitch 3(Config-Enthernet0/0/24)# switchport mode trunk allowed vlan allSwitch 3(Config-Enthernet0/0/24)# exit将PC接入到不同的vlan中,验证连通如何将三层交换机的vlan 10和vlan 20 的端口删除,画网络物理拓扑Switch 3(Config)# vlan 10Switch 3(Config- Vlan 10)# no switchport interface enthernet 0/0/1Switch 3(Config- Vlan 10)# exitSwitch 3(Config)# vlan20Switch 3(Config- Vlan 20)# no switchport interface enthernet 0/0/2Switch 3(Config- Vlan 20)# exit删除三层交换机的某个vlan接口IP地址,测试连通性的改变Switch 3(Config)# no interface vlan 10Switch 3(Config)# no interface vlan 20在PC端测试连通性实训结论:利用三层交换机可以实现vlan之间的通讯若三层交换机不承担具体终端任务,可以不添加具体vlan端口,但是必须创建相应vlan,才可以配置vlan三层IP地址为终端网关三层交换机的trunk端口可以接受来自不同vlan的数据,并进行vlan重新封装打包Trunk端口与IP地址的可能关系:一对多,多对一端口镜像端口镜像的要求:源与目的端口的速率匹配(源>=目的端口)端口镜像时,源与目的端口必须在同一个vlan内配置交换机恢复出产设置,并连接3台PC与交换机配置交换机的端口镜像,使PC1可以接收PC2与PC3之间的数据Switch(Config)# monitor session 1 source interface enthernet 0/0/2-3 both//both 镜像将把端口2与3的接收和发送的数据都给镜像端口1Switch(Config)# monitor session 1 destination interface enthernet 0/0/1Switch(Config)#启动PC1中的抓包工具,开启PC2与PC3之间的通信过程分析PC1 抓取的数据,确定是否已经抓捕PC2与PC3之间的数据取消交换机的端口镜像配置,重复以上两步,查看结果如何Switch(Config)# no monitor session 1 source interface enthernet 0/0/2-3Switch(Config)# no monitor session 1 destination interface enthernet 0/0/1实训结论:端口镜像可以实现从多个端口到某一个端口的镜像也可多对源和目的之间的镜像熟悉路由器的基本配置方法使用配置线缆连接路由器(Console端口)和管理PC(COM端口)配置PC超级终端,打开路由器命令行管理界面连接路由器电源线并启动路由器,查看各端口指示灯状态配置路由器局域网端口地址与PC地址,使用交叉双绞线连接Router # show running-config //判断以太网端口对应的配置名称Router_config # interface f0/0// interface f0/0 <——>interface fastenthernet 0/0Router_config_ f0/0 # ip address 192.168.1.100 255.255.255.0退回特权模式使用show命令查看配置结果Router # show interface f0/0在PC端使用Telnet方式登陆路由器命令界面Router_config # username dcnu password dcnuRouter_config # aaa authentication login login_fortelnet localRouter_config # line vty 0 4Router_config_line # login authentication login_fortelnet由PC登陆路由器C:\>telnet 192.168.1.100配置PC的TFTP服务器,在路由器中使用copy命令将配置文件在PC中备份Router # writeRouter # copy flash :startup_config tftp改变PC中的备份的配置文件,使用路由器的copy命令实现配置文件的回传重新启动路由器,查看更改执行情况实训结论:路由器的管理IP可以在物理接口上进行,交换机在vlan接口路由器的telnet方式管理默认是不授权的路由器的很多版本不支持Tab修补全命令的功能熟悉路由器的配置模式和配置帮助命令配置线缆连接路由器与PC1 COM口,交叉线连接路由器快速以太网口与PC2在控制台命令行配置带内管理,使另一台PC实现带内管理并登陆配置路由器提示名称并使用write命令保存:Router_config # hostname DCNU-Router使用命令配置路由器的管理账户:Router # configRouter_config # username user 1 password digitalchina //增加用户Router_config # aaa authentication for_login login localRouter_config # line console 0Router_config _line # login authentication for_login//line console 0 命令是进入当前控制台端口模式启动命令接下来是在控制台// 试图登录路由器系统时,进行for_login 的登录验证验证配置的管理用户的登陆情况Router_config # enable password digitalchina level 15退回到普通模式,再次进入特权模式通过路由器实现vlan之间的互通连接交换机和PC,并确认连通性配置交换机的vlan并划分端口,确认连通性Switch # ConfigSwitch(Config)# vlan 10Switch(Config- Vlan 10)# switchport interface enthernet 0/0/1Switch(Config- Vlan 10)# exitSwitch(Config)# vlan20Switch(Config- Vlan20)# switchport interface enthernet 0/0/2Switch(Config- Vlan 20)# exit连接交换机和路由器,通过端口物理状态确认物理连通性配置交换机的级联端口为trunk端口,并配置起相应的native vlan值Switch(Config)# switchport enthernet 0/0/24Switch(Config-Enthernet0/0/24)# switchport mode trunkSwitch(Config-Enthernet0/0/24)# switchport mode trunk native vlan 10Switch(Config-Enthernet0/0/24)# switchport mode trunk allowed vlan allSwitch(Config-Enthernet0/0/24)# exit两台PC网卡与交换机使用双绞线连接路由器控制线缆将其中一台PC的COM口与路由器console连接配置超级终端、路由器的网络端口IP与两台PC的网卡IP地址双绞线与交换机与路由器局域网端口连接,验证连通性Router A # ping 192.168.1.10 //ping PC地址将PC的默认网关配置为同组路由器的局域网口地址使用路由器串口背对背线缆连接两台路由器的串行接口配置V35MT一端的串行端口Router- A-config # interface serial0/2Router- A-config _s0/2 # ip address 192.168.3.1 255.255.255.0Router- A-config _s0/2 # encapsulation HDLCRouter- A-config _s0/2 # no shutdown配置V35FC一端的串行接口Router- A-config # interface serial0/2Router- A-config _s 0/2 # ip address 192.168.3.2 255.255.255.0Router- A-config _s0/2 # encapsulation HDLCRouter- A-config # interface serial0/2Router- A-config _s0/2 # ip address 192.168.3.1 255.255.255.0Router- A-config _s0/2 # encapsulation HDLCRouter- A-config _s0/2 # physical-layer speed 64000//配置dce时钟频率Router- A-config _s0/2 # no shutdown使用show命令来验证串口的连通性,ping命令来验证Router- A # show interface serial 0/2Router- A_config # ip route 0.0.0.0 0.0.0.0 192.168.3.2 // ….192.168.3.1Router- A_config # exitRouter- B_config # ip route 0.0.0.0 0.0.0.0 192.168.3.2 // ….192.168.3.1Router- B_config # exit从各自的内网1和内网2 的PC验证网络的整体连通性实训结论:路由器在网络中实施要在单条链路连通后逐步完成整体连通性企业内网与外网的连通至少需要经过不同的两个网段任何节点的默认网关地址一定是与自己地址在相同的网络➢广域网连接方概述——专线网络PPP封装连接路由器广域网串行接口与V35线缆,并记录路由器所连接的线缆类型路由器加电,通过PC超级终端进入路由,查看逻辑配置名称,进入全局模式路遇同步串口配置模式,由V35线缆类型在PC类型连线一侧配物理时钟// DCE设备,配置时钟信号Router-A _config # interface s0/2Router-A _config_s0/2 #physical-layer speed 64000配置两台路由器的串口封装类型为PPP,查看端口// 一下两个路由器上的serial 0/2接口都要做RouterA _config_s0/2 # encapsulation pppRouterB_config_s0/2 # encapsulation ppp配置两台路由器的串口PPP封装PAP方式的验证//在全局模式下配置验证方法列表RouterA _config # aaa encapsulation ppp test localRouterA _config # username RouterB password digitalcianBRouterB _config # aaa encapsulation ppp test localRouterB _config # username RouterA password digitalcianA//在串口模式下引用一下验证方法列表对PPP封装PAP验证RouterA _config # interface serial 0/2RouterA _config_s0/2 # ppp authentication pap testRouterA _config_s0/2 # ppp pap sent-username RouterA digitalchinaARouterB _config # interface serial 0/2RouterB _config_s0/2 # ppp authentication pap testRouterB _config_s0/2 # ppp pap sent-username RouterA digitalchinaB如果端口长时间未变UP状态,则将端口重新启动,观察状态变化查看两台路由器对应端口状态RouterB # show interface serial 0/2使用no命令在串口模式下取消PPP封装PAP验证// 对PPP封装进行CHAP验证RouterA _config_s0/2 # no ppp authentication papRouterB _config_s0/2 # no ppp authentication pap//RouterA _config_s# ppp authentication chap test//RouterA _config_s0/2 # ppp chap hostname RouterA//RouterB _config_s# ppp authentication chap test//RouterB _config_s0/2 # ppp chap hostname RouterB// 全局模式下配置新的验证方法// RouterA _config # aaa authentication ppp test local// RouterA _config # username RouterB password digitalchina// RouterB _config # aaa authentication ppp test local// RouterB _config # username RouterA password digitalchina为路由器串行配置IP地址,验证连通性RouterA _config_s0/2 # ip address 192.168.1.1 255.255.255.0RouterB _config_s0/2 # ip address 192.168.1.2 255.255.255.。