gpt4 book ai didi

dhcp - 我如何在 dhcpd.conf 中指定接口(interface)?

转载 作者:行者123 更新时间:2023-12-05 02:07:41 27 4
gpt4 key购买 nike

我有一个看起来像这样的 dhcpd.conf。如何监听 enp2s0 接口(interface)?

#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page

subnet 192.168.10.0 netmask 255.255.255.0 {
authoritative;
range 192.168.10.10 192.168.10.100;
}

最佳答案

在 Red Hat 8 和衍生版本上,除了正确配置接口(interface)和 dhcpd.conf 之外,您现在无需执行任何操作:

[root@foo ~]# cat /etc/sysconfig/dhcpd 
# WARNING: This file is NOT used anymore.

# If you are here to restrict what interfaces should dhcpd listen on,
# be aware that dhcpd listens *only* on interfaces for which it finds subnet
# declaration in dhcpd.conf. It means that explicitly enumerating interfaces
# also on command line should not be required in most cases.
...

如果你检查 /var/log/messages,你会看到:

...
No subnet declaration for eno1 (no IPv4 addresses).
** Ignoring requests on eno1. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eno1 is attached. **
...

所以这应该是 Just Work (TM),但是因为担心在错误的接口(interface)上运行 DHCP 服务器而获得分数。 ;)

关于dhcp - 我如何在 dhcpd.conf 中指定接口(interface)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61516419/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com