如何将 DHCP 池或子网与类的声明关联

如何将 DHCP 池或子网与类的声明关联

我有以下 ISC DHCP 服务器 4.1.1 的工作配置,它向已注册的客户端分发固定地址。其中一些客户端配置为 PXE 引导(例如固定资产投资星火控制管理)。

# General declarations
authoritative;
option domain-name            "department.example.edu";
option domain-name-servers    8.8.8.8, 8.8.4.4;
default-lease-time            86400;

class "fai" {
    match hardware;
    next-server fai.department.example.edu;
    filename "fai/pxelinux.0";
}

class "sccm" {
    match hardware;
    next-server sccm.department.example.edu;
    filename "sccm/pxelinux.0";
}

# Public network (one of many).
# Ethernet outlets are in public areas.  By policy we require users to
# register their MAC addresses, and clients obtain fixed addresses.
subnet 10.20.0.0 netmask 255.255.0.0 {
    option subnet-mask        255.255.0.0;
    option broadcast-address  10.20.255.255;
    option routers            10.20.0.1;
}

# Three of many hosts registered for fixed address assignments in the public network
host host1.department.example.edu {
    hardware ethernet ca:fe:ba:be:00:01; fixed-address 10.20.1.1;
}

host linux2.department.example.edu {
    hardware ethernet ca:fe:ba:be:00:02; fixed-address 10.20.1.2;
}
subclass "fai" 1:ca:fe:ba:be:00:02;

host windows3.department.example.edu {
    hardware ethernet ca:fe:ba:be:00:03; fixed-address 10.20.1.3;
}
subclass "sccm" 1:ca:fe:ba:be:00:03;

现在,我想添加对另一个子网的支持,我们将从池中向任何 DHCP 客户端分发动态地址(因为该 VLAN 上的所有以太网插座都位于安全位置的 IT 工作台上)。问题是,有什么好方法可以使现有的 SCCM 声明成为 IT 工作台的默认声明?

# New IT workbench subnet.  I'd like the "sccm" settings to be the default
# for this subnet.
#
# The VLAN only has outlets in a secure location, so MAC address registration
# is not necessary.
subnet 192.168.1.0 netmask 255.255.255.0 {
    option subnet-mask        255.255.255.0;
    option broadcast-address  192.168.1.255;
    option routers            192.168.1.1;
    pool {
        range 192.168.1.2 192.168.1.254;
        # Point A: what declarations to put here, if anything?
    }
    # Point B: what declarations to put here, if anything?
}
# Point C: what declarations to put here, if anything?

从概念上讲,我可以在 B 点写

    next-server sccm.department.example.edu;
    filename "sccm/pxelinux.0";

但那会重复我自己。如果可能的话,我想将子网与现有"sccm"类关联起来。我可以写什么来产生以下效果

    subclass "sccm" "anything-in-192.168.1.0/24";

(我不使用类来进行 SCCM 声明。如果组或其他机制可行,那也很好。

相关内容