web-dev-qa-db-ja.com

CentOS 7 DHCPサーバーが起動しない(指定されたポートでは有効になりません)

私はCent0S 7 miniPCを使用しており、ワイヤレスおよび有線のネットワークポートを備えています。ワイヤレスポート(wlp3s0)は、192.168.10.Xアドレッシングを持つDHCPクライアントとして接続され、DNS解決があります。

有線ポート(enp2s0)を、192.168.100.Xアドレス指定のプライベートサブネット用のDHCPサーバーとしてセットアップしようとしています。 miniPCはネットワークスイッチに接続され、テスト用に他のクライアントデバイスが接続されます。

RedHat here からティーまでの指示に従いました。

ぼくの /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.

ここで何が問題になっているのですか?

ありがとう。

2
Sean McVeigh

2番目のインターフェース(enp2s0)にはIPアドレスがありません。定義済みのネットワークからのアドレスを使用して彼をセットアップします-ip addr add 192.168.100.1/24 dev enp2s0その後、dhcpサービスを再度実行します。そのインターフェースのIPアドレスは静的である必要があります。

1
HubertS

/ 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
Ipor Sircer