![通过桥接以太网连接到虚拟机,主机的防火墙是否会通过路由传递到虚拟机的 IP 地址?](https://linux22.com/image/778844/%E9%80%9A%E8%BF%87%E6%A1%A5%E6%8E%A5%E4%BB%A5%E5%A4%AA%E7%BD%91%E8%BF%9E%E6%8E%A5%E5%88%B0%E8%99%9A%E6%8B%9F%E6%9C%BA%EF%BC%8C%E4%B8%BB%E6%9C%BA%E7%9A%84%E9%98%B2%E7%81%AB%E5%A2%99%E6%98%AF%E5%90%A6%E4%BC%9A%E9%80%9A%E8%BF%87%E8%B7%AF%E7%94%B1%E4%BC%A0%E9%80%92%E5%88%B0%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%20IP%20%E5%9C%B0%E5%9D%80%EF%BC%9F.png)
好的,下面介绍一些背景知识:我有一台运行 pxe 服务器的 Linux 虚拟机,该服务器的设置是我从过去为启动无头系统而设置的物理 Linux 服务器复制过来的。它可以正常工作,并且仍然可以启动无头设备。我现在正尝试在我的 Win 10 笔记本电脑上使用虚拟 Fedora 执行 pxe 启动操作。但是,我在将 tftp 读取 pxelinux.0 请求传递到我的虚拟机时遇到了麻烦。情况如下:
- Dhcpd 服务器已启动,并为客户端 Linux 系统提供 IP 地址
- 然后客户端继续请求 tftp 服务器 ip 192.9.200.10 上的文件“pxelinux.0”
- windows 主机上的 wireshark 显示 pxelinux.0 dst ip 192.9.200.10 的 tftp 读取请求
- 桥接连接上的虚拟机 wireshark 从未看到 tftp 读取请求。
- 客户端连接超时并启动到本地硬盘
**我的问题**:如果您有一个桥接以太网连接,并且客户端 Linux 可以看到虚拟机 IP,那么发往虚拟机 IP 的数据包是否会完全穿过 Windows 或穿过 Windows 防火墙?
我还确保虚拟 Linux 上的 tftp.socket 和服务已启动并监听端口 69
systemctl status tftp
○ tftp.service - Tftp Server
Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor pre>
Active: inactive (dead)
TriggeredBy: ● tftp.socket
Docs: man:in.tftpd
lines 1-5/5 (END)
systemctl status tftp.socket
● tftp.socket - Tftp Server Activation Socket
Loaded: loaded (/usr/lib/systemd/system/tftp.socket; enabled; vendor prese>
Active: active (listening) since Tue 2022-07-19 12:50:17 CDT; 23min ago
Triggers: ● tftp.service
Listen: [::]:69 (Datagram)
Tasks: 0 (limit: 11004)
Memory: 4.0K
CPU: 252us
CGroup: /system.slice/tftp.socket
Jul 19 12:50:17 fedora systemd[1]: Listening on Tftp Server Activation Socket.
lines 1-11/11 (END)
ss -lu
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
UNCONN 0 0 0.0.0.0:48494 0.0.0.0:*
UNCONN 0 0 127.0.0.53%lo:domain 0.0.0.0:*
UNCONN 0 0 127.0.0.1:323 0.0.0.0:*
UNCONN 0 0 0.0.0.0:mdns 0.0.0.0:*
UNCONN 0 0 0.0.0.0:hostmon 0.0.0.0:*
UNCONN 0 0 *:tftp *:*
UNCONN 0 0 *:tftp *:*
UNCONN 0 0 [::1]:323 [::]:*
UNCONN 0 0 [::]:36714 [::]:*
UNCONN 0 0 [::]:mdns [::]:*
UNCONN 0 0 [::]:hostmon [::]:*
我已经在虚拟机上运行了以下命令来设置防火墙
firewall-cmd --add-service=tftp --permanent
firewall-cmd --add-service=dhcp --permanent
firewall-cmd --add-service=nfs --permanent
在 Windows 端,当我在以太网端口上运行 wireshark 时,我可以看到 tftp 读取请求,但它的目的地是虚拟机 ip 地址,这是正确的 tftpboot 服务器 ip。