我的拓扑是:
我已登录到 R1。我可以 ping R2 上的 10.0.0.2 和 R2 上的 198.51.100.1,但无法 ping sw3(198.51.100.2)的管理 IP。我究竟做错了什么?
R1#sh ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.0.0.1 - 0cc1.8f5a.c102 ARPA GigabitEthernet0/2
Internet 10.0.0.2 11 0cc1.8fc5.c701 ARPA GigabitEthernet0/2
Internet 10.0.0.5 - 0cc1.8f5a.c101 ARPA GigabitEthernet0/1
Internet 10.0.0.6 11 0cc1.8f0b.af00 ARPA GigabitEthernet0/1
Internet 192.0.2.1 - 0cc1.8f5a.c100 ARPA GigabitEthernet0/0
Internet 192.0.2.2 11 0cc1.8fe9.8001 ARPA GigabitEthernet0/0
R1#sh ip route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.0.0.0/30 is directly connected, GigabitEthernet0/2
L 10.0.0.1/32 is directly connected, GigabitEthernet0/2
C 10.0.0.4/30 is directly connected, GigabitEthernet0/1
L 10.0.0.5/32 is directly connected, GigabitEthernet0/1
192.0.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.0.2.0/24 is directly connected, GigabitEthernet0/0
L 192.0.2.1/32 is directly connected, GigabitEthernet0/0
S 198.51.100.0/24 [1/0] via 10.0.0.2
R1#ping 198.51.100.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 198.51.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 6/13/16 ms
R1#ping 198.51.100.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 198.51.100.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
更新:我可以ping通通过sw2连接的主机,但不能ping通sw2本身
好吧,我尝试通过 sw2 添加虚拟 PC 并为其分配 IP 地址 198.51.100.5/24,网关为 198.51.100.1。结果我可以从 R1 ping 它,反之亦然,但是 R1 仍然无法 ping sw2 的管理 IP。我们不能从子网外ping交换机的管理IP吗?
R1#ping 198.51.100.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 198.51.100.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/21/37 ms
R1#ping 198.51.100.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 198.51.100.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
以下是每个设备的运行配置:
R1:
R1#sh run | s net0/2
interface GigabitEthernet0/2
description Connected to R2
ip address 10.0.0.1 255.255.255.252
duplex auto
speed auto
media-type rj45
R1#sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 192.0.2.1 YES manual up up
GigabitEthernet0/1 10.0.0.5 YES manual up up
GigabitEthernet0/2 10.0.0.1 YES manual up up
GigabitEthernet0/3 unassigned YES unset administratively down down
R2:
R2#ping 198.51.100.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 198.51.100.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/16/23 ms
R2#sh run | s net0/0
interface GigabitEthernet0/0
description Connected to sw2
ip address 198.51.100.1 255.255.255.0
duplex auto
speed auto
media-type rj45
R2#sh run | s net0/1
interface GigabitEthernet0/1
description Connected to R1
ip address 10.0.0.2 255.255.255.252
duplex auto
speed auto
media-type rj45
R2#sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 198.51.100.1 YES manual up up
GigabitEthernet0/1 10.0.0.2 YES manual up up
GigabitEthernet0/2 unassigned YES unset administratively down down
GigabitEthernet0/3 unassigned YES unset administratively down down
R2#sh ip route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/30 is directly connected, GigabitEthernet0/1
L 10.0.0.2/32 is directly connected, GigabitEthernet0/1
198.51.100.0/24 is variably subnetted, 2 subnets, 2 masks
C 198.51.100.0/24 is directly connected, GigabitEthernet0/0
L 198.51.100.1/32 is directly connected, GigabitEthernet0/0
sw2:
sw2#sh run | s net0/0
interface GigabitEthernet0/0
description Connected to R2
media-type rj45
negotiation auto
sw2#sh run | s vlan
vlan internal allocation policy ascending
sw2#sh run | s Vlan
interface Vlan1
ip address 198.51.100.2 255.255.255.0
sw2#sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset up up
GigabitEthernet0/1 unassigned YES unset administratively down down
GigabitEthernet0/2 unassigned YES unset administratively down down
GigabitEthernet0/3 unassigned YES unset administratively down down
Vlan1 198.51.100.2 YES manual up up
