为什么ping到互联网不起作用?

Internet路由 IP 192.168.5.1; 互联网IP

Box1 IP 192.168.1.240; 192.168.5.240,192.168.200.240

Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.5.1 0.0.0.0 UG 3 0 0 enp7s0f1 127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp7s0f0 192.168.5.0 0.0.0.0 255.255.255.0 U 3 0 0 enp7s0f1 192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 enp7s0f0 

/ proc / sys / net / ipv4 / ip_forward = 1
防火墙停止并清除规则

Box2 IP 192.168.200.15; 192.168.1.15

 Kernel IP Routentabelle Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.200.240 0.0.0.0 UG 0 0 0 enp3s0 127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0 192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0 

(仅用于信息:192.168.1.1是另一个路由器)

平Box1:罚款

PING 192.168.200.240(192.168.200.240)56(84)字节的数据。 来自192.168.200.240的64个字节:icmp_seq = 1 ttl = 64时间= 0.067ms — 192.168.200.240 ping statistics —发送了1个数据包,收到了1个数据包,丢包率为0%,时间为0ms rtt min / avg / max / mdev = 0.067 / 0.067 / 0.067 / 0.000ms

PING 192.168.200.15(192.168.200.15)56(84)字节的数据。 来自192.168.200.15的64字节:icmp_seq = 1 ttl = 64时间= 0.098ms — 192.168.200.15 ping统计信息—发送1个数据包,接收1个数据包,丢包0个,时间0ms rtt min / avg / max / mdev = 0.098 / 0.098 / 0.098 / 0.000ms

PING 192.168.1.240(192.168.1.240)56(84)字节的数据。 来自192.168.1.240的64个字节:icmp_seq = 1 ttl = 64时间= 0.063ms — 192.168.1.240 ping statistics —发送了1个数据包,接收到了1个数据包,发生了0%的数据包丢失,时间为0ms rtt min / avg / max / mdev = 0.063 / 0.063 / 0.063 / 0.000ms

PING 192.168.1.1(192.168.1.1)56(84)字节的数据。 来自192.168.1.1的64字节:icmp_seq = 1 ttl = 64时间= 0.329ms — 192.168.1.1 ping statistics —发送了1个数据包,接收到了1个数据包,丢包率为0%,时间为0ms rtt min / avg / max / mdev = 0.329 / 0.329 / 0.329 / 0.000ms

PING 192.168.5.240(192.168.5.240)56(84)字节的数据。 来自192.168.5.240的64个字节:icmp_seq = 1 ttl = 64时间= 0.044ms — 192.168.5.240 ping statistics —发送1个数据包,接收1个数据包,丢包0个,时间0ms rtt min / avg / max / mdev = 0.044 / 0.044 / 0.044 / 0.000ms

PING 192.168.5.1(192.168.5.1)56(84)字节的数据。 来自192.168.5.1的64个字节:icmp_seq = 1 ttl = 64时间= 0.719 ms — 192.168.5.1 ping statistics —发送了1个数据包,收到了1个数据包,丢包率为0%,时间为0ms rtt min / avg / max / mdev = 0.719 / 0.719 / 0.719 / 0.000ms

PING www.heise.de(193.99.144.85)56(84)字节的数据。 来自www.heise.de(193.99.144.85)的64个字节:icmp_seq = 1 ttl = 248时间= 17.0ms — www.heise.de ping统计数据—发送1个数据包,接收1个,数据包丢失0%,时间0ms rtt min / avg / max / mdev = 17.068 / 17.068 / 17.068 / 0.000 ms

平Box2:不工作,因为我想

PING 192.168.200.15(192.168.200.15)56(84)字节的数据。 来自192.168.200.15的64字节:icmp_seq = 1 ttl = 64时间= 0.041ms — 192.168.200.15 ping statistics —发送了1个数据包,接收到了1个数据包,丢包率为0%,时间为0ms rtt min / avg / max / mdev = 0.041 / 0.041 / 0.041 / 0.000ms

PING 192.168.200.240(192.168.200.240)56(84)字节的数据。 来自192.168.200.240的64个字节:icmp_seq = 1 ttl = 64时间= 0.245ms — 192.168.200.240 ping统计信息—发送1个数据包,接收1个数据包,丢包0%,时间0ms rtt min / avg / max / mdev = 0.245 / 0.245 / 0.245 / 0.000ms

PING 192.168.1.240(192.168.1.240)56(84)字节的数据。 来自192.168.1.240的64个字节:icmp_seq = 1 ttl = 64时间= 0.285ms — 192.168.1.240 ping statistics —发送了1个包,接收到了1个,包丢失为0%,时间为0ms rtt min / avg / max / mdev = 0.285 / 0.285 / 0.285 / 0.000ms

PING 192.168.1.1(192.168.1.1)56(84)字节的数据。 来自192.168.1.1的64字节:icmp_seq = 1 ttl = 64时间= 0.529ms — 192.168.1.1 ping statistics —发送了1个数据包,收到了1个数据包,丢包率为0%,时间为0ms rtt min / avg / max / mdev = 0.529 / 0.529 / 0.529 / 0.000ms

PING 192.168.5.240(192.168.5.240)56(84)字节的数据。 来自192.168.5.240的64个字节:icmp_seq = 1 ttl = 64时间= 0.171ms — 192.168.5.240 ping统计信息—发送1个数据包,接收1个数据包,丢包0个,时间0ms rtt min / avg / max / mdev = 0.171 / 0.171 / 0.171 / 0.000ms

PING 192.168.5.1(192.168.5.1)56(84)字节的数据。 — 192.168.5.1 ping统计— 1个数据包传输,0个接收,100%丢包,时间0ms

PING www.heise.de(193.99.144.85)56(84)字节的数据。 — www.heise.de ping统计— 1个数据包传输,0个接收,100%丢包,时间0ms

问题:为什么我不能从192.168.200.15(Box2)ping IP 192.168.5.1和193.99.144.85? 任何想法/解决scheme,以使其工作?

您的路由器192.168.5.1不知道networking192.168.200.0/24在哪里。 这就是为什么你需要在路由器上network 192.168.200.0/24 via 192.168.5.240添加静态路由network 192.168.200.0/24 via 192.168.5.240 。 还要检查路由器上的NAT规则,并在那里添加networking192.168.200.0/24