PC 无法 ping 路由器 2 跳(家庭实验室)

网络工程 思科 路由 路由器 思科-ios
2021-07-19 00:21:23

为了给出一些上下文,这是我的设置:

  ----(10.0.0.1 - S0/0/0) R1 (S0/1/0 - 10.0.1.1)----
  |                                                |
  |                                                |
  |                                                |
  (10.0.0.2 - S0/0/0)                              (10.0.1.2 - S0/0/0)
  R3                                               R2
  (172.16.0.1 - FE0/0)                             
  |                                                
  |                                                
  |
  S1
  |
  |
  (172.16.0.2)
  PC1

如果我尝试从 PC1 ping 到 R3,它可以正常 ping 172.16.0.1 和 10.0.0.2;但是如果我尝试从 PC1 ping 10.0.0.1,它不起作用。

这里有一些配置:

R3接口:

interface FastEthernet0/0
 ip address 172.16.0.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/0/0
 ip address 10.0.0.2 255.255.255.0
!
ip forward-protocol nd
no ip http server
no ip http secure-server

R3路线:

Codes: L - local, C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is 10.0.0.1 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 10.0.0.1
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.0.0.0/24 is directly connected, Serial0/0/0
L        10.0.0.2/32 is directly connected, Serial0/0/0
      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.0.0/24 is directly connected, FastEthernet0/0
L        172.16.0.1/32 is directly connected, FastEthernet0/0

R1接口:

interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/0/0
 ip address 10.0.0.1 255.255.255.0
!
interface Serial0/1/0
 ip address 10.0.1.1 255.255.255.0
!

R1路由:

Codes: L - local, C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C        10.0.0.0/24 is directly connected, Serial0/0/0
L        10.0.0.1/32 is directly connected, Serial0/0/0
C        10.0.1.0/24 is directly connected, Serial0/1/0
L        10.0.1.1/32 is directly connected, Serial0/1/0
2个回答

请注意,R1 没有到 PC1 的路由。路由器通过三种方式学习路由:

  1. 直连网络
  2. 静态配置的路由
  3. 通过路由协议

由于 R1 未连接到172.16.0.0/24网络,您有两种选择:在 R1 中创建静态路由,或在 R3 和 R1 之间运行路由协议以将路由从 R3 通告到 R1。

R1 中静态配置的路由类似于:

ip route 172.16.0.0 255.255.255.0 10.0.0.2

从R1的路由表可以看出R1没有到172.16.0.0网络的路由。换句话说,R1 不知道将数据包转发到哪里才能到达 PC1。您需要将路由添加到 R1 的表中,可以使用静态路由,也可以配置路由协议。