我目前正在设置一台有两个接口的机器。其中一个接口连接到互联网,另一个接口连接到通过 DHCP 管理本地网络的交换机。
DHCP 服务器正确出租 IP 地址,但计算机本身无法 ping 通本地网络之外的计算机。既不通过 DNS 名称也不通过 IP 地址。
我已经在 systemctl 文件中启用了 IPv4 转发,所以我不确定还可能缺少什么。我不太熟悉在 Linux 上设置这类东西,所以我想知道是否可以获得一些帮助。看来我还缺少一些东西。下面是我的 dhcpd.conf 文件。
注意:此服务器也将是 TFTP 服务器,这就是为什么我在此文件中包含所有额外内容的原因
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option arch code 93 = unsigned integer 16;
use-host-decl-names on;
ddns-update-style interim;
ignore client-updates;
# option definitions common to all supported networks...
option domain-name "xxxx.xxxx.xxxx.com";
option domain-name-servers ###.###.12.30,###.###.12.8;
# Specify subnet of ether device you do NOT want service.
# For systems with two or more ethernet devices.
# subnet 136.165.0.0 netmask 255.255.0.0 {}
subnet 192.168.1.0 netmask 255.255.255.0{
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.1.10 192.168.1.100;
option broadcast-address 192.168.1.255;
default-lease-time 21600;
max-lease-time 43200;
option routers 192.168.1.1;
next-server 192.168.1.3;
include "/etc/dhcp/worker-reservations.conf";
class "Legacy" {
match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00000";
filename "undionly.kkpxe";
}
class "UEFI-32-2" {
match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00002";
filename "i386-efi/ipxe.efi";
}
class "UEFI-32-1" {
match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00006";
filename "i386-efi/ipxe.efi";
}
class "UEFI-64-1" {
match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007";
filename "ipxe.efi";
}
class "UEFI-64-2" {
match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00008";
filename "ipxe.efi";
}
class "UEFI-64-3" {
match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00009";
filename "ipxe.efi";
}
class "SURFACE-PRO-4" {
match if substring(option vendor-class-identifier, 0, 32) = "PXEClient:Arch:00007:UNDI:003016";
filename "ipxe7156.efi";
}
class "Apple-Intel-Netboot" {
match if substring(option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386";
option dhcp-parameter-request-list 1,3,17,43,60;
if (option dhcp-message-type = 8) {
option vendor-class-identifier "AAPLBSDPC";
if (substring(option vendor-encapsulated-options, 0, 3) = 01:01:01) {
# BSDP List
option vendor-encapsulated-options 01:01:01:04:02:80:00:07:04:81:00:05:2a:09:0D:81:00:05:2a:08:69:50:58:45:2d:46:4f:47;
filename "ipxe.efi";
}
}
}
}