收藏 分销(赏)

路由交换实验.doc

上传人:xrp****65 文档编号:7666854 上传时间:2025-01-11 格式:DOC 页数:19 大小:580.50KB
下载 相关 举报
路由交换实验.doc_第1页
第1页 / 共19页
路由交换实验.doc_第2页
第2页 / 共19页
点击查看更多>>
资源描述
(一)静态路由: 配置:我们要使1.1.1.0/24,2.2.2.0/24和3.3.3.0/24网络能够互相通信,按如下所述操作。 (1)步骤1:在各路由器上IP地址,保证直连链路的连通性 R1(config)#int loopback0 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config)#int s0/0 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown R2(config)#int loopback0 R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config)#int s0/1 R2(config-if)#ip address 192.168.12.2 255.255.255.0 R2(config-if)#no shutdown R2(config)#int s0/0 R2(config-if)#ip address 192.168.23.2 255.255.255.0 R2(config-if)#no shutdown R3(config)#int loopback0 R3(config-if)#ip address 3.3.3.3 255.255.255.0 R3(config)#int s0/1 R3(config-if)#ip address 192.168.23.3 255.255.255.0 R3(config-if)#no shutdown (2)步骤2:在R1上配置静态路由 R1(config)#ip route 2.2.2.0 255.255.255.0 192.168.12.2 R1(config)#ip route 3.3.3.0 255.255.255.0 192.168.12.2 //下一跳为IP地址形式,192.168.12.2是R2上的IP地址 (3)步骤3:在R2上配置静态路由 R2(config)#ip route 1.1.1.0 255.255.255.0 192.168.12.1 R2(config)#ip route 3.3.3.0 255.255.255.0 192.168.23.3 (4)步骤4:在R3上配置静态路由 R3(config)#ip route 1.1.1.0 255.255.255.0 192.168.23.2 R3(config)#ip route 2.2.2.0 255.255.255.0 192.168.23.2 查看: R1 R2 R3 上面: R1#show ip route R2#show ip route R3#show ip route 验证: R1#ping 2.2.2.2 source loopback 0 R1#ping 3.3.3.3 source loopback 0 R2#ping 1.1.1.1 source loopback 0 R2#ping 3.3.3.3 source loopback 0 R3#ping 1.1.1.1 source loopback 0 R3#ping 2.2.2.2 source loopback 0 实验2:默认路由 (1)步骤1:在各路由器上IP地址,保证直连链路的连通性 R1(config)#int loopback0 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config)#int s0/0 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown R2(config)#int loopback0 R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config)#int s0/1 R2(config-if)#ip address 192.168.12.2 255.255.255.0 R2(config-if)#no shutdown R2(config)#int s0/0 R2(config-if)#ip address 192.168.23.2 255.255.255.0 R2(config-if)#no shutdown R3(config)#int loopback0 R3(config-if)#ip address 3.3.3.3 255.255.255.0 R3(config)#int s0/1 R3(config-if)#ip address 192.168.23.3 255.255.255.0 R3(config-if)#no shutdown (2):静态路由: R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2 (下一跳为对端接口地址) R2(config)#ip route 1.1.1.0 255.255.255.0 192.168.12.1 R2(config)#ip route 3.3.3.0 255.255.255.0 192.168.23.3 R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.23.2 验证: R1# ping 3.3.3.3 source loo0 实验3: rip 基本底层配置: R1(config)#int loopback0 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config)#int s0/0 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown R2(config)#int loopback0 R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config)#int s0/1 R2(config-if)#ip address 192.168.12.2 255.255.255.0 R2(config-if)#no shutdown R2(config)#int s0/0 R2(config-if)#ip address 192.168.23.2 255.255.255.0 R2(config-if)#no shutdown R3(config)#int loopback 0 R3(config-if)#ip address 3.3.3.3 255.255.255.0 R3(config)#int s0/1 R3(config-if)#ip address 192.168.23.3 255.255.255.0 R3(config-if)#no shutdown R3(config)#int s0/0 R3(config-if)#ip address 192.168.34.3 255.255.255.0 R3(config-if)#no shutdown R4(config)#int loopback 0 R4(config-if)#ip address 4.4.4.4 255.255.255.0 R4(config)#int s0/1 R4(config-if)#ip address 192.168.34.4 255.255.255.0 R4(config-if)#no shutdown (1) 步骤1:配置路由器R1 R1(config)#router rip R1(config-router)#version 2 R1(config-router)#no auto-summary R1(config-router)#network 1.0.0.0 R1(config-router)#network 192.168.12.0 (2)步骤2:配置路由器R2 R2(config)#router rip R2(config-router)#version 2 R3(config-router)#no auto-summary R2(config-router)#network 2.0.0.0 R2(config-router)#network 192.168.12.0 R2(config-router)#network 192.168.23.0 (3)步骤3:配置路由器R3 R3(config)#router rip R3(config-router)#version 2 R3(config-router)#no auto-summary R3(config-router)#network 3.0.0.0 R3(config-router)#network 192.168.23.0 R3(config-router)#network 192.168.34.0 (4)步骤4:配置路由器R4 R4(config)#router rip R4(config-router)#version 2 R4(config-router)#no auto-summary R4(config-router)#network 192.168.34.0 R4(config-router)#network 4.0.0.0 验证: 查看:R1 上面 show ip route 有 R 4.4.4.0/24 [120/3] via 192.168.12.2, 00;00;22, Serial0/0 R 192.168.23.0/24 [120/1] via 192.168.12.2, 00;00;22, Serial0/0 R 192.168.34.0/24 [120/2] via 192.168.12.2, 00;00;22, Serial0/0 或 R1# ping 4.4.4.4 soure loo0 出现: !!!!! Ok了 实验4 单区域OSPF 基本底层配置: R1(config)#int loopback0 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config)#int s0/0 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown R2(config)#int loopback0 R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config)#int s0/1 R2(config-if)#ip address 192.168.12.2 255.255.255.0 R2(config-if)#no shutdown R2(config)#int s0/0 R2(config-if)#ip address 192.168.23.2 255.255.255.0 R2(config-if)#no shutdown R3(config)#int loopback 0 R3(config-if)#ip address 3.3.3.3 255.255.255.0 R3(config)#int s0/1 R3(config-if)#ip address 192.168.23.3 255.255.255.0 R3(config-if)#no shutdown R3(config)#int s0/0 R3(config-if)#ip address 192.168.34.3 255.255.255.0 R3(config-if)#no shutdown R4(config)#int loopback 0 R4(config-if)#ip address 4.4.4.4 255.255.255.0 R4(config)#int s0/1 R4(config-if)#ip address 192.168.34.4 255.255.255.0 R4(config-if)#no shutdown 2.起路由进程 ospf (1)步骤1:配置路由器R1 R1(config)#router ospf 1 R1(config-router)#router-id 1.1.1.1 R1(config-router)#network 1.1.1.0 255.255.255.0 area 0 R1(config-router)#network 192.168.12.0 255.255.255.0 area 0 (2)步骤2:配置路由器R2 R2(config)#router ospf 1 R2(config-router)#router-id 2.2.2.2 R2(config-router)#network 192.168.12.0 255.255.255.0 area 0 R2(config-router)#network 192.168.23.0 255.255.255.0 area 0 R2(config-router)#network 2.2.2.0 255.255.255.0 area 0 (3)步骤3:配置路由器R3 R3(config)#router ospf 1 R3(config-router)#router-id 3.3.3.3 R3(config-router)#network 192.168.23.0 255.255.255.0 area 0 R3(config-router)#network 192.168.34.0 255.255.255.0 area 0 R3(config-router)#network 3.3.3.0 255.255.255.0 area 0 (4)步骤4:配置路由器R4 R4(config)#router ospf 1 R4(config-router)#router-id 4.4.4.4 R4(config-router)#network 4.4.4.0 255.255.255.0 area 0 R4(config-router)#network 192.168.34.0 255.255.255.0 area 0 验证: 每台路由器上 R# show ip route 能看到4条环回口地址路由: C 192.168.12.0/24 is directly connected, Serial0/0/0 1.0.0.0/32 is subnetted, 1 subnets O 1.1.1.1 [110/65] via 192.168.12.1, 00;07;27, Serial0/0/0 2.0.0.0/24 is subnetted, 1 subnets C 2.2.2.0 is directly connected, Loopback0 3.0.0.0/32 is subnetted, 1 subnets O 3.3.3.3 [110/65] via 192.168.23.2, 00;07;27, Serial0/0/1 4.0.0.0/32 is subnetted, 1 subnets O 4.4.4.4 [110/129] via 192.168.23.2, 00;07;27, Serial0/0/1 C 192.168.23.0/24 is directly connected, Serial0/0/1 O 192.168.34.0/24 [110/128] via 192.168.23.2, 00;07;27, Serial0/0/1 或者 R1# ping 4.4.4.4 source loo0 !!!!!(出现感叹号) 实验5 广播多路访问链路上的OSPF 基本底层配置: R1(config)#int loopback0 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config)#int e0/0 R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown R2(config)#int loopback0 R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config)#int e0/0 R2(config-if)#ip address 192.168.1.2 255.255.255.0 R2(config-if)#no shutdown R3(config)#int loopback 0 R3(config-if)#ip address 3.3.3.3 255.255.255.0 R3(config)#int e0/0 R3(config-if)#ip address 192.168.1.3 255.255.255.0 R3(config-if)#no shutdown R4(config)#int loopback 0 R4(config-if)#ip address 4.4.4.4 255.255.255.0 R4(config)#int e0/0 R4(config-if)#ip address 192.168.1.4 255.255.255.0 R4(config-if)#no shutdown .实验步骤1:配置路由器R1 R1(config)#router ospf 1 R1(config-router)#router-id 1.1.1.1 R1(config-router)#network 1.1.1.0 255.255.255.0 area 0 R1(config-router)#network 192.168.1.0 255.255.255.0 area 0 (2)步骤2:配置路由器R2 R2(config)#router ospf 1 R2(config-router)#router-id 2.2.2.2 R2(config-router)#network 192.168.1.0 255.255.255.0 area 0 (3)步骤3:配置路由器R3 R3(config)#router ospf 1 R3(config-router)#router-id 3.3.3.3 R3(config-router)#network 192.168.1.0 255.255.255.0 area 0 (4)步骤4:配置路由器R4 R4(config)#router ospf 1 R4(config-router)#router-id 4.4.4.4 R4(config-router)#network 4.4.4.0 255.255.255.0 area 0 R4(config-router)#network 192.168.1.0 255.255.255.0 area 0 验证:查看 (1)show ip ospf neighbor R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/BDR 00;00;37 192.168.1.2 Ethernet0/0 3.3.3.3 1 FULL/DROTHER 00;00;37 192.168.1.3 Ethernet0/0 4.4.4.4 1 FULL/DROTHER 00;00;34 192.168.1.4 Ethernet0/0 ***切换DR : 接口下面:不参与DR BDR 选取: R1(config)#int e0/0 R1(config-if)#ip os priority 0 R3 选为 DR R3(config)#int e0/0 R3(config-if)#ip os priority 3 /(优先级调高) 配完后 四台路由器: R1/R2/R3/R4 同时 :R# clear ip ospf process R# 。。。。。。。。? (no) 敲 :y 实验6 area 0 区域验证 (1)步骤1:在各路由器上IP地址,保证直连链路的连通性 R1(config)#int loopback0 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config)#int s0/0 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown R2(config)#int loopback0 R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config)#int s0/1 R2(config-if)#ip address 192.168.12.2 255.255.255.0 R2(config-if)#no shutdown (1)步骤1:配置路由器R1 R1(config)#router ospf 1 R1(config-router)#router-id 1.1.1.1 R1(config-router)#network 192.168.12.0 255.255.255.0 area 0 R1(config-router)#network 1.1.1.0 255.255.255.0 area 0 R1(config-router)#area 0 authentication //区域0启用简单口令认证 R1(config)#interface s0/0 R1(config-if)#ip ospf authentication-key cisco //配置认证密码.cisco 两端必须一样 (2)步骤2:配置路由器R2 R2(config)#router ospf 1 R2(config-router)#router-id 2.2.2.2 R2(config-router)#network 2.2.2.0 255.255.255.0 area 0 R2(config-router)#network 192.168.12.0 255.255.255.0 area 0 R2(config-router)#area 0 authentication R2(config)#interface s0/1 R2(config-if)#ip ospf authentication-key cisco 验证: R1# show ip ospf nei 有邻居 R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/BDR 00;00;37 192.168.1.2 Ethernet0/0 实验7 dhcp 交换机/ 路由器 打开! R1(config)#int e0/0 R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown R1: R1(config)#ip dhcp pool ccie //定义地址池 R1(dhcp-config)#network 192.168.1.0 255.255.255.0 //DHCP服务器要分配的网络和掩码 R1(dhcp-config)#default-router 192.168.1.1 R1(dhcp-config)#lease infinite //定义租期 Pc1 Pc 2 配完点 添加 ———> 点ok 进入软件vpcs Show 查看 敲1 进入pc1 敲2 进入 pc2 1> Dhcp 显示ddora 获取 ip地址 2> Dhcp 显示ddora 获取ip 地址 实验8 划分VLAN 实验9 trunk 1.配置路由地址 R1(config-if)#int e0/0 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no sh R2(config-if)#int e0/0 R2(config-if)#ip address 192.168.12.2 255.255.255.0 R2(config-if)#no sh R4(config-if)#int e0/0 R4(config-if)#ip address 192.168.12.4 255.255.255.0 R4(config-if)#no sh R5(config-if)#int e0/0 R5(config-if)#ip address 192.168.12.5 255.255.255.0 R5(config-if)#no sh 2.划分vlan R0 R0(config)#vlan 2 R0(config-vlan)#exit R0(config)#int f1/0 R0(config-if)#swi mo acc R0(config-if)#swi acc vlan 2 R0(config)#vlan 3 R0(config-vlan)#exit R0(config)#int f1/1 R0(config-if)#swi mo acc R0(config-if)#swi acc vlan 3 R3 R3(config)#vlan 2 R3(config-vlan)#exit R3(config)#int f1/0 R3(config-if)#swi mo acc R3(config-if)#swi acc vlan 2 R3(config)#vlan 3 R3(config-vlan)#exit R3(config)#int f1/1 R3(config-if)#swi mo acc R3(config-if)#swi acc vlan 3 3.交换机间的trunk R0(config)#int f1/2 R0(config-if)#switchport trunk encapsulation dot1q R0(config-if)#switch mode trunk R3(config)#int f1/2 R3(config-if)#switchport trunk encapsulation dot1q R3(config-if)#switch mode trunk 验证: 先R0上 R0# show int trun R0#show int trun Port Mode Encapsulation Status Native vlan Fa1/2 on 802.1q trunking 1 显示 trunking 验证 R1# ping 192.168.12.4 !!!! R2# ping 192.168.12.5 !!!!! 实验10 vtp 3)配置S1为VTP server S1(config)#vtp mode server S1(config)#vtp domain VTP-TEST S1(config)#vtp password cisco (4)配置S2为VTP transparent S2(config)#vtp mode tran S2(config)#vtp domain VTP-TEST S2(config)#vtp password cisco (5)配置S3为VTP client S2(vlan)#vtp mode client S2(vlan)#vtp domain VTP-TEST S2(config)#vtp password cisco s0(config)#int f1/0 s0(config-if)#switchport trunk encapsulation dot1q s0(config-if)#switch mode trunk s1(config)#int f1/1 s1(config-if)#switchport trunk encapsulation dot1q s1(config-if)#switch mode trunk s1(config)#int f1/0 s1(config-if)#switchport trunk encapsulation dot1q s1(config-if)#switch mode trunk s2(config)#int f1/1 s2(config-if)#switchport trunk encapsulation dot1q s2(config-if)#switch mode trunk 验证: S1(config)# vlan 2 S1(config)# vlan 3 S1(config-vlan)# exit 查看s1# show vlan 出现添加的vlan S1# show vtp status Configuration Revision ; 2 //修订号为2,该数值非常重要 Maximum VLANs supported locally ; 1005 Number of existing VLANs ; 7 //VLAN数量 VTP Operating Mode ; Server //VTP模式 VTP Domain Name ; VTP-TEST //VTP域名 S3上同样show 也会有 实验4:EtherChannel配置 基本配置: S1(config)#interface port-channel 1 S1(config)#interface f1/0 S1(config-if)#channel-group 1 mode on S1(config)#interface f1/1 S1(config-if)#channel-group 1 mode on S1(config)#int port-channel 1 S1(config-if)#switchport mode trunk S2(config)#interface port-channel 1 S2(config)#interface f1/0 S2(config-if)#channel-group 1 mode on S2(config)#interface f1/1 S2(config-if)#channel-group 1 mode on S2(config)#int port-channel 1 S2(config-if)#switchport mode trunk ******S1(config)#port-channel load-balance dst-mac S2(config)#port-channel load-balance dst-mac***** //以上是配置EtherChannel的负载平衡方式,命令格式为”port-channel load-balance method”,负载平衡的方式有:dst-ip、dst-mac、src-dst-ip、src-dst-mac等 (2)查看EtherChannel信息 S1#show etherchannel summary Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------- 1 Po1(SU) - Fa0/13(Pd) Fa0/14(P)
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传
相似文档                                   自信AI助手自信AI助手

当前位置:首页 > 教育专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服