当前位置:首页 > wifi设置知识 > 正文内容

基本静态路由设置-路由器静态ip如何设置(策略)

秋天2024年01月03日 10:02:49wifi设置知识91
现代生活中,路由器是不可或缺的网络设备,无论是在家庭、办公室还是公共场所都需要它的帮助。但在使用过程中,我们常常会遇到网络信号不稳定、无法连接等问题。本文将为大家介绍相关的知识和使用技巧,以帮助您更好地使用路由器。

实验目的:路由全通

RouterA

RouterA#sho run

Building configuration...

Current configuration : 584 bytes

!

version 12.2

no service single-slot-reload-enable

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname RouterA

!

logging rate-limit console 10 except errors

!

ip subnet-zero

no ip finger

!

no ip dhcp-client network-discovery

!

!

!

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 192.168.1.1 255.255.255.0

clockrate 64000

!

ip kerberos source-interface any

ip classless

ip http server

!

!

!

line con 0

transport input none

line aux 0

line vty 0 4

!

End

RouterB

RouterB#sho run

Building configuration...

Current configuration : 393 bytes

!

version 12.2

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname RouterB

!

!

ip subnet-zero

!

!

!

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

ip address 192.168.2.2 255.255.255.0

!

interface Serial1

ip address 192.168.1.2 255.255.255.0

!

ip classless

ip http server

!

!

!

line con 0

line aux 0

line vty 0 4

!

End

RouterC

RouterC#show run

Building configuration...

Current configuration : 584 bytes

!

version 12.2

no service single-slot-reload-enable

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname RouterC

!

logging rate-limit console 10 except errors

!

ip subnet-zero

no ip finger

!

no ip dhcp-client network-discovery

!

!

!

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

ip address 192.168.2.3 255.255.255.0

clockrate 64000

!

interface Serial1

no ip address

shutdown

!

ip kerberos source-interface any

ip classless

ip http server

!

!

!

line con 0

transport input none

line aux 0

line vty 0 4

!

End

首先在RouterA上使用ping命令检测直连链路是否通畅

RouterA#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 100 percent (5/5), round-trip min/avg/max = 32/32/32 ms

再次使用ping命令检测能否将包从RouterA发送到达RouterC

RouterA#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

.....

Success rate is 0 percent (0/5)

Ping命令失败!使用debug ip packet命令来查看

RouterA#debug ip packet

IP packet debugging is on

RouterA#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

00:15:52: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

00:15:54: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

00:15:56: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

00:15:58: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

00:16:00: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

Success rate is 0 percent (0/5)

根据debug信息可以看出ping不成功是因为无法路由,使用show ip route来查看路由表

RouterA#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.1.0/24 is directly connected, Serial1

路由表中没有192.168.2.0/24网络的路由,需要手动添加静态路由

RouterA#conf t

Enter configuration commands, one per line. End with CNTL/Z.

RouterA(config)#ip route 192.168.2.0 255.255.255.0 S1

查看路由表

RouterA#sho ip rou

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.1.0/24 is directly connected, Serial1

S 192.168.2.0/24 is directly connected, Serial1

此时路由表发生变化,多了一条静态路由。

再次ping一下RouterC

RouterA#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

00:21:43: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

00:21:45: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

00:21:47: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

00:21:49: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

00:21:51: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

Success rate is 0 percent (0/5)

依然不通,但是信息表示数据包已经发送成功,考虑ping是一个双向过程,于是到RouterB上去看一下

RouterB#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/32/32 ms

RouterB#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 = 40/40/44 ms

RouterB可以ping通RouterA与C,说明RouterB没有问题。

去看一下RouterC的路由表

RouterC#sho ip rou

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.2.0/24 is directly connected, Serial0

发现路由器C没有去往192.168.1.0/24网络的路由信息,此时debug看RouterC ping RouterA的过程也证明了我们的推断

RouterC#debug ip pac

IP packet debugging is on

RouterC#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:

03:46:38: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

03:46:40: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

03:46:42: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

03:46:44: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

03:46:46: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

Success rate is 0 percent (0/5)

在RouterC上添加去往192.168.1.0/24网络的静态路由

RouterC#conf t

Enter configuration commands, one per line. End with CNTL/Z.

RouterC(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.2

退回特权模式,查看路由表变化

RouterC(config)#exit

RouterC#

03:48:52: %SYS-5-CONFIG_I: Configured from console by console

RouterC#sho ip rou

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

S 192.168.1.0/24 [1/0] via 192.168.2.2

C 192.168.2.0/24 is directly connected, Serial0

已经创建了一条去往192.168.1.0/24网络的路由,回到RouterA上测试ping一下

RouterA#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 76/85/112 ms

~通过本文的讲解,你已经可以更好地理解和掌握路由器和WIFI的设置方法和技巧了。希望你可以在日常生活中更好地利用网络。

扫描二维码推送至手机访问。

版权声明:本文由路由设置网发布,如需转载请注明出处。

本文链接:https://www.shoulian.org/luyou/post/134596.html

分享给朋友:

“基本静态路由设置-路由器静态ip如何设置(策略)” 的相关文章

手动拨号怎么设置路由器

手动拨号怎么设置路由器

今天给各位分享手动拨号怎么设置路由器的知识,其中也会对自动拨号怎么设置路由器进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站 本文内容目录一览: 1、怎么设置路由器手动拨号上网 2、路由器拨号上网怎么设置 路由器拨号上网设置操作步骤 3、拨号上网怎么设置无线路由器 4、路由器怎么...

宽带661怎么连接路由器

宽带661怎么连接路由器

针对宽带661怎么连接路由器这个问题,本文将综合不同朋友对这个路由器连接678的知识为大家一起来解答,希望能帮到大家 本文内容目录一览: 1、刚装好宽带怎么连接路由器? 2、长虹bwr661路由器怎么设置移动宽带 3、家庭宽带怎么连接有线路由器 刚装好宽带怎么连接路由器? 新装宽带连接路由...

怎么测家里路由器网速

怎么测家里路由器网速

针对怎么测家里路由器网速这个问题,本文将综合不同朋友对这个手机怎么测家里的路由器网速的知识为大家一起来解答,希望能帮到大家 本文内容目录一览: 1、如何利用手机测试WIFI的网速? 2、如何测路由器的网速? 3、如何测试家里宽带的网速 4、怎么测家里的wifi网速 如何利用手机测试WI...

路由器几个插口怎么插

路由器几个插口怎么插

本篇文章给大家谈谈路由器几个插口怎么插,以及无线路由器后面几个插口对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文内容目录一览: 1、路由器5个插口 怎么插 2、路由器后面的插孔怎么插? 3、无线路由器后面的几个孔怎么用 4、联通路由器怎么插线? 5、路由器插口连接图的正...

路由器虚拟专用怎么设置

路由器虚拟专用怎么设置

有很多朋友不知道路由器虚拟专用怎么设置要如何操作,今天为大家整理了很多路由器的虚拟服务器怎么设置相关的答案,组成一篇内容丰富的文章,希望能到您 本文内容目录一览: 1、路由器虚拟服务器 2、路由器怎么设置虚拟无线wifi 3、你好,路由器虚拟IP怎么弄?办公用,你会不会弄,会弄的话可以聊聊。...

路由器怎么连wifi网络

路由器怎么连wifi网络

本篇文章给大家谈谈路由器怎么连wifi网络,以及路由器怎么连接wifi网络对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文内容目录一览:以上就是路由器怎么连wifi网络的全部内容了,文章比较长感谢您的耐心阅读,希望能帮到您,...