无法从另一个子网 ping/访问 netcomm nf4v 路由器

无法从另一个子网 ping/访问 netcomm nf4v 路由器

我的网络拓扑:

                            苹果
                        192.168.1.4
                             |
互联网 - 网通 192.168.1.1-192.168.1.253 Linux 192.168.2.1-192.168.2.2 Windows
  • netcom 是互联网的 NAT 网关
  • netcom 有一条通过 192.168.1.253 到 192.168.2.0/24 的静态路由
  • mac 具有通过 192.168.1.253 到 192.168.2.0/24 的静态路由
  • mac 的默认网关为 192.168.1.1
  • linux 的默认网关是 192.168.1.1
  • linux 有端口转发并且禁用防火墙
  • windows 的默认网关是 192.168.2.1
  • mac 可以 ping windows、linux 和 netcom
  • linux 可以 ping windows、mac、netcom
  • windows 可以 ping mac 和 linux,但不能 ping netcom
  • netcom 可以 ping mac 和 linux,但不能 ping windows

最后,我在尝试从 Windows ping netcom(反之亦然)时运行了 tcpdump,它显示数据包正在通过正确的接口,知道可能是什么问题吗?

从网通 ping 到 Windows 显示以下日志:

网通 ping 通:

> ping 192.168.2.2
应用程序:echo 1 > /var/ping_dns_status
PING 192.168.2.2 (192.168.2.2): 56 个数据字节

--- 192.168.2.2 ping 统计 ---
已发送 4 个数据包,已接收 0 个数据包,数据包丢失率为 100%

Linux中的tcpdump:

00:03:12.441283 在 18:f1:45:75:2c:24 以太网类型 IPv4 (0x0800) 中,长度 100:192.168.1.1 > 192.168.2.2:ICMP 回显请求,ID 5784,序列号 0,长度 64
00:03:12.441341 输出 00:0c:29:0b:03:c3 以太类型 IPv4 (0x0800),长度 100:192.168.1.1 > 192.168.2.2:ICMP 回显请求,ID 5784,序列号 0,长度 64
00:03:12.441829 在 00:0c:29:e9:17:84 以太网类型 IPv4 (0x0800),长度 100:192.168.2.2 > 192.168.1.1:ICMP 回显答复,id 5784,序号 0,长度 64
00:03:12.441850 输出 00:0c:29:0b:03:b9 以太网类型 IPv4 (0x0800),长度 100:192.168.2.2 > 192.168.1.1:ICMP 回显答复,ID 5784,序号 0,长度 64

Windows 上的 wireshark:

192.168.1.1 192.168.2.2 ICMP 98 Echo(ping)请求 id=0x1698,seq=0/0,ttl=63(2548 回复)
192.168.2.2 192.168.1.1 ICMP 98 Echo (ping) 回复 id=0x1698, seq=0/0, ttl=128 (请求 2547)

答案1

在 Linux 机器上,数据包转发默认是禁用的。尝试运行命令:

iptables -A 转发 -i eth1 -j 接受

iptables -A 转发 -o eth1 -j 接受

(并在 eth1 以外的另一个网络接口上执行相同的两个命令)

sysctl -w net.ipv4.ip_forward=1

并添加到 /etc/sysctl.conf

net.ipv4.ip_forward = 0

相关内容