两台路由器直连不能互相ping通

网络工程 路由器 网络 数据包追踪器
2021-07-12 10:01:30

只是为了练习目的,我在 Cisco 数据包跟踪器上创建了一个像这样的网络。

在此处输入图片说明

但我无法从任何其他设备 ping 路由器 3。

以下是每个设备上的配置。

路由器 3:

!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R3
!
!
ip cef
no ipv6 cef
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/0
 ip address 192.168.3.3 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.2.3 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 1
 network 192.168.2.0
 network 192.168.3.0
 auto-summary
!
ip classless
!
ip flow-export version 9
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
end

路由器 1:

!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
!
ip cef
no ipv6 cef
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.2
 encapsulation dot1Q 2
 ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.4
 encapsulation dot1Q 4
 ip address 192.168.3.1 255.255.255.0
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan2
 mac-address 0060.3e65.9e01
 no ip address
!
router eigrp 1
 network 192.168.1.0
 network 192.168.3.0
 auto-summary
!
ip classless
!
ip flow-export version 9
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
end

路由器 5:

!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R5
!
!
ip cef
no ipv6 cef
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/1.2
 encapsulation dot1Q 2
 ip address 192.168.1.5 255.255.255.0
!
interface FastEthernet0/1.3
 encapsulation dot1Q 3
 ip address 192.168.2.5 255.255.255.0
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 1
 network 192.168.1.0
 network 192.168.2.0
 auto-summary
!
ip classless
!
ip flow-export version 9
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
end

SW1:

!
version 12.2(37)SE1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW1
!
!
ip routing
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/3
interface FastEthernet0/4
interface FastEthernet0/5
interface FastEthernet0/6
interface FastEthernet0/7
interface FastEthernet0/8
interface FastEthernet0/9
interface FastEthernet0/10
interface FastEthernet0/11
interface FastEthernet0/12
interface FastEthernet0/13
interface FastEthernet0/14
interface FastEthernet0/15
interface FastEthernet0/16
interface FastEthernet0/17
interface FastEthernet0/18
interface FastEthernet0/19
interface FastEthernet0/20
interface FastEthernet0/21
interface FastEthernet0/22
interface FastEthernet0/23
interface FastEthernet0/24
interface GigabitEthernet0/1
interface GigabitEthernet0/2
!
interface Vlan1
 ip address 192.168.0.254 255.255.255.0
!
interface Vlan2
 mac-address 0060.2f8a.1301
 ip address 192.168.1.254 255.255.255.0
!
router eigrp 1
 network 192.168.0.0
 network 192.168.1.0
 auto-summary
!
ip classless
!
ip flow-export version 9
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
end

以下是其他信息。

在路由器 1 上:-

R1#sh cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
R3           Fas 0/1          153            R       C2800       Fas 0/0

R1#sh ip int br
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/0        unassigned      YES unset  up                    up 
FastEthernet0/0.2      192.168.1.1     YES manual up                    up 
FastEthernet0/0.4      192.168.3.1     YES manual up                    up 
FastEthernet0/1        unassigned      YES manual up                    up 
Vlan1

R1#sh 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

D    192.168.0.0/24 [90/25628160] via 192.168.1.254, 00:08:21, FastEthernet0/0.2
C    192.168.1.0/24 is directly connected, FastEthernet0/0.2
D    192.168.2.0/24 [90/30720] via 192.168.1.5, 00:07:28, FastEthernet0/0.2
C    192.168.3.0/24 is directly connected, FastEthernet0/0.4

路由器 3:-

R3#sh cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
R5           Fas 0/1          150            R       C2800       Fas 0/0
R1           Fas 0/0          130            R       C2800       Fas 0/1
R3#

R3#sh ip int br
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/0        192.168.3.3     YES manual up                    up 
FastEthernet0/1        192.168.2.3     YES manual up                    up 
Vlan1                  unassigned      YES unset  administratively down down
R3#

R3#sh ip rout
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, FastEthernet0/1
C    192.168.3.0/24 is directly connected, FastEthernet0/0

路由器 5:-

R5#sh cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
R3           Fas 0/0          152            R       C2800       Fas 0/1
R5#

R5#sh ip int br
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/0        unassigned      YES manual up                    up 
FastEthernet0/1        unassigned      YES unset  up                    up 
FastEthernet0/1.2      192.168.1.5     YES manual up                    up 
FastEthernet0/1.3      192.168.2.5     YES manual up                    up 
Vlan1                  unassigned      YES unset  administratively down down
R5#

R5#sh 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

D    192.168.0.0/24 [90/25628160] via 192.168.1.254, 00:08:33, FastEthernet0/1.2
C    192.168.1.0/24 is directly connected, FastEthernet0/1.2
C    192.168.2.0/24 is directly connected, FastEthernet0/1.3
D    192.168.3.0/24 [90/30720] via 192.168.1.1, 00:08:34, FastEthernet0/1.2

SW1:

SW1#sh cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
R5           Fas 0/2          177            R       C2800       Fas 0/1
R5           Fas 0/2          177            R       C2800       Fas 0/1.2
R5           Fas 0/2          177            R       C2800       Fas 0/1.3
R1           Fas 0/1          157            R       C2800       Fas 0/0
R1           Fas 0/1          157            R       C2800       Fas 0/0.2
R1           Fas 0/1          157            R       C2800       Fas 0/0.4
SW1#

SW1#sh ip int br
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/1        unassigned      YES unset  up                    up 
FastEthernet0/2        unassigned      YES unset  up                    up 
FastEthernet0/3        unassigned      YES unset  down                  down 
FastEthernet0/4        unassigned      YES unset  down                  down 
FastEthernet0/5        unassigned      YES unset  down                  down 
FastEthernet0/6        unassigned      YES unset  down                  down 
FastEthernet0/7        unassigned      YES unset  down                  down 
FastEthernet0/8        unassigned      YES unset  down                  down 
FastEthernet0/9        unassigned      YES unset  down                  down 
FastEthernet0/10       unassigned      YES unset  down                  down 
FastEthernet0/11       unassigned      YES unset  down                  down 
FastEthernet0/12       unassigned      YES unset  down                  down 
FastEthernet0/13       unassigned      YES unset  down                  down 
FastEthernet0/14       unassigned      YES unset  down                  down 
FastEthernet0/15       unassigned      YES unset  down                  down 
FastEthernet0/16       unassigned      YES unset  down                  down 
FastEthernet0/17       unassigned      YES unset  down                  down 
FastEthernet0/18       unassigned      YES unset  down                  down 
FastEthernet0/19       unassigned      YES unset  down                  down 
FastEthernet0/20       unassigned      YES unset  down                  down 
FastEthernet0/21       unassigned      YES unset  down                  down 
FastEthernet0/22       unassigned      YES unset  down                  down 
FastEthernet0/23       unassigned      YES unset  down                  down 
FastEthernet0/24       unassigned      YES unset  up                    up 
GigabitEthernet0/1     unassigned      YES unset  down                  down 
GigabitEthernet0/2     unassigned      YES unset  down                  down 
Vlan1                  192.168.0.254   YES manual up                    up 
Vlan2                  192.168.1.254   YES manual up                    up
SW1#

SW1#sh 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.0.0/24 is directly connected, Vlan1
C    192.168.1.0/24 is directly connected, Vlan2
D    192.168.2.0/24 [90/25628160] via 192.168.1.5, 00:09:46, Vlan2
D    192.168.3.0/24 [90/25628160] via 192.168.1.1, 00:10:40, Vlan2

请帮忙。

2个回答

问题是 R1/R5 和 R3 之间的 L3 连接没有正确配置。

您没有在 R1/R5 上使用 IP 地址配置连接到 R3 的接口。

#Router 1
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
!


#Router 5
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!

您只为 L3 SW1 的连接配置了 F0/0 子接口(在 R1 上)和 F0/1 子接口(在 R5 上),这是错误的。

#Router 1
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.2
 encapsulation dot1Q 2
 ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.4
 encapsulation dot1Q 4
 ip address 192.168.3.1 255.255.255.0
!



#Router 5
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/1.2
 encapsulation dot1Q 2
 ip address 192.168.1.5 255.255.255.0
!
interface FastEthernet0/1.3
 encapsulation dot1Q 3
 ip address 192.168.2.5 255.255.255.0
!

在这种情况下,您不需要在 R1/R5 和 L3 SW1 之间使用 dot1q Trunking 连接。

再次修复您的配置并确保您可以在打开 EIGRP(或任何路由协议)之前到达连接的另一端。

您应该删除 EIGRP 配置下的“自动汇总”。

您必须删除自动摘要。这是一个很好的解释