从其他网络进行 PXE 启动

从其他网络进行 PXE 启动

所以我遇到了问题。

我使用 Debian9 设置了一个路由器,它的任务是使网络中的客户端能够从 PXE 服务器启动(PXE 服务器位于另一个网络上)我听说过一些关于 IP-Helper RelayAgent 的事情

但是我没有找到针对我的问题的任何文档,我找到的所有文档都是针对同一网络中的 PXE 服务器的。

顺便说一下,PXE 服务器存在但它在网络 A 中,我只需要确保网络 B 上的客户端可以从该服务器启动。

我做了很多研究,但没有发现任何东西:(

@安德烈亚斯·罗格

所以我在互联网上查找...我将像那样配置我的 dhcp.conf...

allow booting;
allow bootp;

subnet 10.5.200.0 netmask 255.255.255.0 {
    option domain-name-servers 10.5.200.254;
    option broadcast-address 10.5.200.255;
    option subnet-mask 255.255.255.0;
    option routers 10.5.200.254;
    range 10.5.200.100 10.5.200.200;


#       group {
#               next-server the TFTP server address/pxe server;
#               filename "filename";
#
#
#               host ubuntu {
#                       hardware ethernet 08:00:07:26:c0:a5;
#                       fixed-address 10.5.200.10; }
            }
    }

我的relay.conf如下:

# Defaults for isc-dhcp-relay initscript
# sourced by /etc/init.d/isc-dhcp-relay
# installed at /etc/default/isc-dhcp-relay by the maintainer scripts

#
# This is a POSIX shell fragment
#

# What servers should the DHCP relay forward requests to?
SERVERS="10.5.200.254"

# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
INTERFACES="enp16s0"

# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""

网络/接口:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).



# The loopback network interface
auto lo
iface lo inet loopback
#test
#Member Network A
auto enp0s25
iface enp0s25 inet static
    address 40.4.200.252
    netmask 255.255.255.0
    gateway 40.4.200.254

#My NEW NETWORK B
auto enp16s0
iface enp16s0 inet static
    address 10.5.200.254
    netmask 255.255.255.0

答案1

PXE 需要两样东西:DHCP 和 TFTP。

由于 TFTP 只是可路由的 UDP 数据包,如果您在路由器上设置了 IP 转发并且防火墙规则正确,它就会起作用。

您缺少的是另一个网络中的 DHCP。设置起来非常简单:将该网络添加到您的 dhcp 服务器,并添加 PXE 所需的所有选项(正如您在第一个网络中所做的那样,您将知道如何执行此操作)。最后,您需要在路由器上安装和配置 dhcp 中继代理。这会将网络 B 上广播的 DHCP 请求转发到 DHCP 服务器。

答案2

您能否将子网 B 中的地址放入 debian 服务器,并使 tftp 服务器监听所有地址或接口。或者,如果您需要,可以使用网关或代理。

相关内容