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

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

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

实验目的:路由全通

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、斐讯K2刷了华硕路由器固件后,如何限制每个连接用户的上行和下行速率? 2、路由器怎么设置无线的限速? 3、怎么在路由器里设置限速啊?...

电信猫路由器怎么用

电信猫路由器怎么用

今天给各位分享电信猫路由器怎么用的知识,其中也会对电信猫如何设置路由器进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站 本文内容目录一览: 1、电信光纤猫接无线路由器怎么设置? 2、电信猫如何设置路由器 3、无线路由器与电信光猫怎么连接,然后wifi那些怎么设置 电信光纤猫接无线路...

水星路由器怎么配置网络

水星路由器怎么配置网络

针对水星路由器怎么配置网络这个问题,本文将综合不同朋友对这个水星路由器怎么上网设置的知识为大家一起来解答,希望能帮到大家 本文内容目录一览: 1、水星路由器设置教程 2、水星路由器无线网设置 3、水星无线路由器怎么设置? 4、水星Mercury路由器怎么设置才可以用 水星路由器设置教程...

pt怎么屏蔽路由器网址

pt怎么屏蔽路由器网址

今天和朋友们分享pt怎么屏蔽路由器网址相关的知识,相信大家通过本文介绍也能对tplink路由器怎么屏蔽网址有自已的收获和理解。自己轻松搞问题。本文内容目录一览: 1、怎么让TP-LINK屏蔽某个网站? 2、怎么样设置路由器屏蔽某些网址,屏蔽域名 3、请教各位知友:路由器怎样屏蔽特定网站?...

怎么查路由器的名称

怎么查路由器的名称

今天和朋友们分享怎么查路由器的名称相关的知识,相信大家通过本文介绍也能对怎样查看路由器用户名称有自已的收获和理解。自己轻松搞问题。本文内容目录一览: 1、无线路由器的名称忘记了,要怎么查找 2、怎么查自己路由器牌子 3、怎么看自己家的wifi网路名称 4、怎么查看路由器用户名 5、无...

路由器是怎么坏的

路由器是怎么坏的

针对路由器是怎么坏的这个问题,本文将综合不同朋友对这个路由器为什么坏了的知识为大家一起来解答,希望能帮到大家 本文内容目录一览: 1、路由器一般坏是什么原因呢?路由器坏掉是什么状态? 2、路由器一般是怎么坏的 3、路由器,一般在什么情况下会坏掉 4、无线路由器老是坏是什么原因 路由器一...