AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 796776
Accepted
Sean McVeigh
Sean McVeigh
Asked: 2016-08-15 12:12:02 +0800 CST2016-08-15 12:12:02 +0800 CST 2016-08-15 12:12:02 +0800 CST

CentOS 7 DHCP 服务器无法启动(不会在指定端口上启用)

  • 772

我有一台带有无线和有线网络端口的 Cent0S 7 miniPC。无线端口 (wlp3s0) 作为 DHCP 客户端连接,地址为 192.168.10.X,并具有 DNS 解析。

我正在尝试将有线端口(enp2s0)设置为具有 192.168.100.X 寻址的私有子网的 DHCP 服务器。miniPC 将连接到网络交换机,该交换机将连接其他客户端设备进行测试。

我按照从 RedHat 到 T 恤的指示。

我/etc/systemd/system/dhcpd.service的如下:

[Unit]
Description=DHCPv4 Server Daemon
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
Wants=network-online.target
After=network-online.target
After=time-sync.target

[Service]
Type=notify
ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid enp2s0

[Install]
WantedBy=multi-user.target

我/etc/dhcp/dhcpd.conf的如下:

default-lease-time 600;
max-lease-time 7200;
authoritative;

subnet 192.168.100.0 netmask 255.255.255.0 {
    option routers                  192.168.100.1;
    option subnet-mask              255.255.255.0;
    option broadcast-address        192.168.100.255;
    range 192.168.100.10 192.168.100.100;
}

当我去配置和启动服务时:

sudo systemctl --system daemon-reload
sudo systemctl restart dhcpd.service

我得到这个/var/log/messages:

localhost systemd: Starting DHCPv4 Server Daemon...
localhost dhcpd: Internet Systems Consortium DHCP Server 4.2.5
localhost dhcpd: Copyright 2004-2013 Internet Systems Consortium.
localhost dhcpd: All rights reserved.
localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
localhost dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
localhost dhcpd: Wrote 0 leases to leases file.
localhost dhcpd: 
localhost dhcpd: No subnet declaration for enp2s0 (no IPv4 addresses).
localhost dhcpd: ** Ignoring requests on enp2s0.  If this is not what
localhost dhcpd:   you want, please write a subnet declaration
localhost dhcpd:   in your dhcpd.conf file for the network segment
localhost dhcpd:   to which interface enp2s0 is attached. **
localhost dhcpd: 
localhost dhcpd: 
localhost dhcpd: Not configured to listen on any interfaces!
localhost dhcpd: 
localhost dhcpd: This version of ISC DHCP is based on the release available
localhost dhcpd: on ftp.isc.org.  Features have been added and other changes
localhost dhcpd: have been made to the base software release in order to make
localhost dhcpd: it work better with this distribution.
localhost dhcpd: 
localhost dhcpd: Please report for this software via the CentOS Bugs Database:
localhost dhcpd:    http://bugs.centos.org/
localhost dhcpd: 
localhost dhcpd: exiting.
localhost systemd: dhcpd.service: main process exited, code=exited, status=1/FAILURE
localhost systemd: Failed to start DHCPv4 Server Daemon.
localhost systemd: Unit dhcpd.service entered failed state.
localhost systemd: dhcpd.service failed.

知道这里出了什么问题吗?

谢谢。

dhcp centos7 dhcpd
  • 2 2 个回答
  • 39030 Views

2 个回答

  • Voted
  1. Best Answer
    HubertS
    2016-08-15T12:35:59+08:002016-08-15T12:35:59+08:00

    您的第二个接口 (enp2s0) 没有 IP 地址。使用已定义网络中的地址设置他 -ip addr add 192.168.100.1/24 dev enp2s0然后再次运行 dhcp 服务。该接口的 IP 地址必须是静态的。

    • 1
  2. Ipor Sircer
    2016-08-15T12:44:25+08:002016-08-15T12:44:25+08:00

    在 /etc/sysconfig/network-scripts/ifcfg-enp2s0 中使用静态 IP 地址 192.168.100.1 配置 enp2s0 接口。

    https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Using_the_Command_Line_Interface.html

    • 1

相关问题

  • DHCP 无法更新 DNS,没有 Active Directory

  • 在 SBS 2008 上禁用 DHCP?

  • 如何在 Ubuntu 中设置搜索域(和其他 resolv.conf 参数)?

  • DHCP/网络问题

  • 在一个 LAN 中使用两台 DHCP 服务器

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve