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

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

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

实验目的:路由全通

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、怎么才能让自己家里的WiFi信号增强? 无线路由器要怎么设置才能让网速...

我家路由器怎么变成开放

我家路由器怎么变成开放

本篇文章给大家谈谈我家路由器怎么变成开放,以及我家路由器怎么变成开放模式了对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文内容目录一览: 1、也不知道为什么我家的无线网突然变成了开放性wifi,没有密码,并且还没有网络,这怎么解决? 2、家里WiFi不知道怎么搞的变成开放状态怎么改回...

千兆光纤路由器怎么设置

千兆光纤路由器怎么设置

本篇文章给大家谈谈千兆光纤路由器怎么设置,以及千兆无线路由器怎么设置对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文内容目录一览: 1、光纤路由器怎么设置 2、千兆路由器怎么设置 3、双频千兆路由器怎么设置 光纤路由器怎么设置 光纤路由器设置方法 一、光纤网线、...

光纤要路由器怎么设置

光纤要路由器怎么设置

有很多朋友不知道光纤要路由器怎么设置要如何操作,今天为大家整理了很多光纤路由器怎么设置无线网络相关的答案,组成一篇内容丰富的文章,希望能到您 本文内容目录一览: 1、用光纤怎么设置路由器 2、光纤怎么设置路由器 3、光纤宽带,怎样设置无线路由器? 4、光纤网怎么设置路由器 用光纤怎么设...

日本激活路由器方法有哪些

日本激活路由器方法有哪些

今天和朋友们分享日本激活路由器方法有哪些相关的知识,相信大家通过本文介绍也能对日本激活路由器方法有哪些品牌有自已的收获和理解。自己轻松搞问题。本文内容目录一览: 1、日本路由器怎么设置 2、日本的wifi路由器的设置 3、求助 怎么设置日本买的无线路由器 4、日本的buffalo 路由器...

天威路由器怎么调大型

天威路由器怎么调大型

今天给各位分享天威路由器怎么调大型的知识,其中也会对天威路由器怎么设置进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站 本文内容目录一览: 1、我家用天威网络 无线路由怎么设置 2、大型路由器设置要怎么做 3、路由器怎么调整信号放大 4、深圳天威宽带如何设置无线路由? 5、天...