首页 > 其他分享 >计网:实验二 路由器动态路由的配置方法

计网:实验二 路由器动态路由的配置方法

时间:2023-06-02 18:57:43浏览次数:29  
标签:down OSPF 192.168 计网 Switch Router config 路由 路由器

 一、实验目的: 

1.理解动态路由的工作原理;

2. 学习并掌握动态路由协议RIP的配置;

3.学习并掌握动态路由协议OSPF的配置;

4.进一步学习路由器的配置命令。

二、实验原理:

RIP:Routing Information Protocol,路由信息协议,是应用较早、使用较普遍的IGP内部网关协议,适用于小型同类网络,是典型的距离矢量协议。

RIP协议跳数作为衡量路径开销的,RIP协议里规定最大跳数为15。

RIP协议有两个版本RIPv1和RIPv2。

RIPv1属于有类路由协议,不支持VLSM(变长子网掩码),RIPv1是以广播的形式进行路由信息的更新的;更新周期为30秒。

RIPv2属于无类路由协议,支持VLSM(变长子网掩码),RIPv2是以组播的形式进行路由信息的更新的,组播地址是224.0.0.9。RIPv2还支持基于端口的认证,提高网络的安全性。

OSPF协议用链路状态来评估路由,可用于规模很大的网络。

OSPF可通过区域划分网络,对于规模较小的网络一般只设置一个区域0,对于规模较大的网络,可划分多个区域,其中区域0是必不可少的,它用于连接其它各区域。

OSPF协议采用组播方式进行OSPF包交换,组播地址为224.0.0.5(全部OSPF路由器)和224.0.06(指定路由器)。

OSPF协议的管理距离是110,低于RIP协议的120,所以如果设备同时运行OSPF协议和RIP协议,则OSPF协议产生的路由优先级高。

三、实验设备:

计算机、二层交换机、路由器

四、实验拓扑图

 

五、实验过程:

  1 1)三层交换机的基本配置
  2 
  3 Switch(config)#vlan 10
  4 Switch(config-vlan)
  5 Switch(config-vlan)#
  6 Switch(config-vlan)#end
  7 Switch#configure terminal
  8 Enter configuration commands, one per line. End with CNTL/Z.
  9 Switch(config)#interface FastEthernet0/1
 10 Switch(config-if)#
 11 %SYS-5-CONFIG_I: Configured from console by console
 12  
 13 Switch(config-if)#exit
 14 Switch(config)#iterface FastEthernet0/1
 15 
 16 Switch(config-if)#
 17 Switch(config-if)#
 18 Switch(config-if)#switchport access vlan 10
 19 Switch(config-if)#exit
 20 Switch(config)#vlan 50
 21 Switch#configure terminal
 22 Enter configuration commands, one per line. End with CNTL/Z.
 23 Switch(config)#interface FastEthernet0/1
 24 Switch(config-if)#
 25 %SYS-5-CONFIG_I: Configured from console by console
 26  
 27 Switch(config-if)#exit
 28 Switch(config)#interface FastEthernet0/2
 29 Switch(config-if)#switchport access vlan 50
 30 Switch(config-if)#exit
 31 Switch(config)#interface vlan 10
 32 Switch(config-if)#
 33 %LINK-5-CHANGED: Interface Vlan10, changed state to up
 34  
 35 Switch(config-if)#ip address 192.168.81.2 255.255.255.0
 36 Switch(config-if)#exit
 37 Switch(config)#interface vlan 50
 38 Switch(config-if)#
 39 %LINK-5-CHANGED: Interface Vlan50, changed state to up
 40  
 41 %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan50, changed state to up
 42  
 43 Switch(config-if)#ip address 192.168.85.1  255.255.255.0
 44 Switch(config-if)#no shutdown
 45 
 46  
 47 
 48 验证测试:
 49 
 50 
 51 Switch#show ip interface
 52 FastEthernet0/1 is down, line protocol is down
 53 Internet protocol processing disabled
 54 FastEthernet0/2 is up, line protocol is up
 55 Internet protocol processing disabled
 56 FastEthernet0/3 is down, line protocol is down
 57 Internet protocol processing disabled
 58 FastEthernet0/4 is down, line protocol is dow
 59 Internet protocol processing disabled
 60 FastEthernet0/5 is down, line protocol is down
 61 Internet protocol processing disabled
 62 FastEthernet0/6 is down, line protocol is down
 63 Internet protocol processing disabled
 64 FastEthernet0/7 is down, line protocol is down
 65 Internet protocol processing disabled
 66 FastEthernet0/8 is down, line protocol is dow
 67 Internet protocol processing disabled
 68 FastEthernet0/9 is down, line protocol is down
 69 Internet protocol processing disabled
 70 FastEthernet0/10 is down, line protocol is down
 71 Internet protocol processing disabled
 72 FastEthernet0/11 is down, line protocol is down
 73 Internet protocol processing disabled
 74 --More--
 75 2) 路由器基本配置
 76 
 77 在路由器A上配置端口IP
 78 
 79 Router>enable
 80 Router#
 81 Router#configure terminal
 82 Enter configuration commands, one per line. End with CNTL/Z.
 83 Router(config)#interface FastEthernet0/0
 84 Router(config-if)#ip address 192.168.81.1 255.255.255.0
 85 Router(config-if)#no shutdown
 86  
 87 Router(config-if)#
 88 %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
 89  
 90 %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
 91  
 92 Router(config-if)#interface serial 0/3/0
 93 Router(config-if)#ip address 172.16.2.1 255.255.255.0
 94 Router(config-if)#Clock rate 64000
 95 Router(config-if)#no shutdown
 96  
 97 在路由器B上配置端口IP
 98 Router(config)#interface Serial0/3/0
 99 Router(config-if)#ip address 192.168.82.2 255.255.255.0
100 Router(config-if)#
101 Router(config-if)#exit
102 Router(config)#interface FastEthernet0/0
103 Router(config-if)#ip address 192.168.83.1 255.255.255.0
104 Router(config-if)#ip address 192.168.83.1 255.255.255.0
105 Router(config-if)#
106 Router(config-if)#exit
107 
108 验证测试:验证路由器接口的配置和状态
109 
110 Router#show ip interface brief
111 Interface IP-Address OK? Method Status Protoco
112 FastEthernet0/0 192.168.81.1 YES manual up up
113 FastEthernet0/1 unassigned YES unset administratively down down
114 Serial0/3/0 172.16.2.1 YES manual up up
115 Serial0/3/1 unassigned YES unset administratively down down
116 Vlan1 unassigned YES unset administratively down down
117  
118  
119 Router#show ip interface brief
120 Interface IP-Address OK? Method Status Protocol
121 FastEthernet0/0 192.168.83.1 YES manual up up
122 FastEthernet0/1 unassigned YES manual administratively down down
123 Serial0/3/0 192.168.82.2 YES manual up up
124 Serial0/3/1 unassigned YES manual administratively down down
125 
126 Vlan1 unassigned YES unset administratively down down
127 
128 
129 2、配置RIPv2路由协议
130 
131 1)三层交换机配置RIP协议
132 
133 Switch>enable
134 Switch#config
135 Configuring from terminal, memory, or network [terminal]?
136 Enter configuration commands, one per line. End with CNTL/Z.
137 Switch(config)#router rip
138 IP routing not enabled
139 Switch(config)#ip routing
140 Switch(config)#router rip
141 Switch(config-router)#network 192.168.81.0
142 Switch(config-router)#network 172.16.5.0
143 Switch(config-router)#version 2
144 Switch(config-router)#
145  
146 
147 2)RA配置RIP v2协议
148 Router(config)#router rip
149 Router(config-router)#network 192.168.81.0
150 Router(config-router)#network 192.168.82.0
151 Router(config-router)#version 2
152 Router(config-router)#no auto-summary
153 Router(config-router)#
154 
155 3)RB配置RIP v2协议
156 Router(config)#router rip
157 Router(config-router)#network 192.168.82.0
158 Router(config-router)#network 192.168.83.0
159 Router(config-router)#version 2
160 Router(config-router)#no auto-summary
161 
162 3、验证三台路由设备的路由表,查看是否自动学习了其他网段的路由信息。
163 
164 Switch#show ip route
165 Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
166 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
167 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
168 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
169 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
170 * - candidate default, U - per-user static route, o - ODR
171 P - periodic downloaded static route
172 Gateway of last resort is not set
173 
174  172.16.0.0/24 is subnetted, 4 subnets
175 C 192.168.81.0 is directly connected, Vlan10
176 R 192.168.82.0 [120/1] via 192.168.81.1, 00:00:21, Vlan10
177 R 192.168.83.0 [120/2] via 192.168.81.1, 00:00:21, Vlan10
178 C 172.16.5.0 is directly connected, Vlan50
179 
180  
181 Router#show ip route
182 Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
183 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
184 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
185 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
186 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
187 * - candidate default, U - per-user static route, o - ODR
188 P - periodic downloaded static route
189  
190 Gateway of last resort is not set
191 
192 172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
193 C 192.168.81.0/24 is directly connected, FastEthernet0/0
194 L 192.168.81.1/32 is directly connected, FastEthernet0/0
195 C 192.168.82.0/24 is directly connected, Serial0/3/0
196 L 172.16.2.1/32 is directly connected, Serial0/3/0
197 R 192.168.83.0/24 [120/1] via 192.168.82.2, 00:00:15, Serial0/3/0
198 R 172.16.5.0/24 [120/1] via 192.168.81.2, 00:00:03, FastEthernet0/0
199  
200  
201 Router#show ip route
202 Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
203 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
204 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
205 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
206 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
207 * - candidate default, U - per-user static route, o - ODR
208 P - periodic downloaded static route
209 Gateway of last resort is not set
210 172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
211 R 192.168.81.0/24 [120/1] via 172.16.2.1, 00:00:27, Serial0/3/0
212 C 192.168.82.0/24 is directly connected, Serial0/3/0
213 L 192.168.82.2/32 is directly connected, Serial0/3/0
214 C 192.168.83.0/24 is directly connected, FastEthernet0/0
215 L 192.168.83.1/32 is directly connected, FastEthernet0/0
216 R 172.16.5.0/24 [120/2] via 172.16.2.1, 00:00:27, Serial0/3/0
217 
218 4、配置OSPF路由协议
219 三层交换机
220 Switch#config
221 Configuring from terminal, memory, or network [terminal]?
222 Enter configuration commands, one per line. End with CNTL/Z.
223 Switch(config)#router ospf 1
224 Switch(config-router)#network 172.16.5.0 0.0.0.255 area 0
225 Switch(config-router)#network 192.168.81.0 0.0.0.0 area 0
226 
227 路由器RA
228 Router#config
229 Configuring from terminal, memory, or network [terminal]?
230 Enter configuration commands, one per line. End with CNTL/Z.
231 Router(config)#router ospf 1
232 Router(config-router)#network 192.168.81.0 0.0.0.255 area 0
233 Router(config-router)#network 192.168.82.0 0.0.0.255 area 0
234 Router(config-router)#end
235 
236 路由器RB
237 Router#config
238 Configuring from terminal, memory, or network [terminal]?
239 Enter configuration commands, one per line. End with CNTL/Z.
240 Router(config)#router ospf 1
241 Router(config-router)#network 192.168.82.0 0.0.0.255 area 0
242 Router(config-router)#netwo
243 01:06:57: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.2.1 on Serial0/3/0 from LOADING to FULL, Loading Done
244 % Incomplete command.
245 Router(config-router)#network 192.168.83.0 0.0.0.255 area 0
246 Router(config-router)#end

 

标签:down,OSPF,192.168,计网,Switch,Router,config,路由,路由器
From: https://www.cnblogs.com/fan-wang/p/17452693.html

相关文章

  • 【解决方法】锐捷路由器配置IP地址,如RSR路由器
    环境:工具:锐捷EVE,VMwareWorkstationPro远程工具:SecureCRT系统版本:Windows10问题描述:描述:在进入锐捷路由器接口配置IP地址时,没有添加ip地址的命令。提示:若按照教程还是无法完成操作,可以进入右侧的企鹅,找我看看。解决方法-视频与文字教程:视频教程:文字教程:1.......
  • 连网技术与网络管理2023-05-27 静态路由
    UsageofrouterRoutersarenetworkdevicesthatoperateatthenetworklayer(Layer3)oftheOSImodel.Theyareusedtoconnectmultiplenetworkstogetherandfacilitatetheexchangeofdatabetweenthesenetworks.Routersperformthefollowingimporta......
  • Wi-Fi 6E路由器LAN接口浪涌静电保护,如何选用ESD静电防护二极管?
    如今,Wi-Fi技术可谓无处不在,Wi-Fi协议也在不断地发展和更新,最新一代的Wi-Fi6E是Wi-Fi6的增强版本,其中字母E代表Extended。除了Wi-Fi6原先支持的2.4GHz及5GHz的频段外,Wi-Fi6E新增了6GHz的频段,拥有更高的并发、更低的时延和更大的带宽。Wi-Fi的核心是路由器,为此随着Wi-Fi版本的更......
  • 计网:实验一 vlan的创建与划分
    一、实验目的: 1.了解vlan的工作原理;2.学习基于端口划分vlan的方法;3.了解跨交换机的相同vlan之间的通信;4.进一步学习交换机端口的配置命令。二、实验原理:VLAN(VirtualLocalAreaNetwork)即虚拟局域网,是一种通过将局域网内的设备逻辑地而不是物理地划分成一个个网段从而实现虚拟......
  • vue-route路由meta对象参数说明
    /***路由meta对象参数说明*meta:{*title:菜单栏及tagsView栏、菜单搜索名称(国际化)*isLink:是否超链接菜单,开启外链条件,`1、isLink:true2、链接地址不为空`*isHide:是否隐藏此路由*activeMenu菜单高亮(详......
  • nmap -A 启用操作系统和版本检测,脚本扫描和路由跟踪功能
    nmap-Axx.xx.IP.xxStartingNmap7.91(https://nmap.org)at2021-08-1810:13CSTNmapscanreportfor39.108.15.161Hostisup(0.075slatency).Notshown:989filteredportsPORTSTATESERVICEVERSION22/tcpopensshOpenSSH......
  • 考古笔记8:默认路由
    前面的06篇如果R1之外有很多不同的网段或者是连接的internet;那么我们再SW上设置默认路由就会条目很多或者根本无法做完;这时就需要配置默认路由了。拓扑本节实验拓扑:我们还是用上一章的拓扑;首先将R1和SW1设定静态路由先删除。配置SW1:SW1#conftSW1(config)#noiproute1.1.1.0255......
  • vue3.0路由的两种方式
    import{createRouter,createWebHashHistory}from'vue-router'constroutes=[{path:'/',name:'index',component:()=>import('./pages/index.vue')//异步加载}]constrouter=createRouter(......
  • WPF事件(事件&路由事件)
    本篇文章学习于:刘铁猛老师《深入浅出WPF》WPF的树型结构路由(Route)一词的大意是这样:起点与终点间有若干个中转站,从起点出发后经过每个甲转站时要做出选择,最终以正确(比如最短或者最快)的路径到达终点。WPF把这种直接消息模型升级为可传递的消息模型——前面我们已经知道WPF......
  • 考古笔记7:静态路由与联网(完整实验过程+爬坑记录)
    先上结论汇总配置过程:(无坑结论)爬坑历程拓扑配置R1:SW:PC侧验证问题1重启下交换机sw1;未解决,尝试端口重启;未解决尝试给SW1的vlan10和vlan20分配物理端口尝试f0/14连接一个host主机试试;连接的host不需要配置IP地址;重启SW1(似乎host开不开机都无所谓)删除f0/14和f0/15的Host;重启SW1解答看......