dhcp server with multiple interfaces

Bob Harold rharolde at umich.edu
Fri Aug 16 19:08:28 UTC 2019


On Thu, Aug 15, 2019 at 11:28 PM Louis Garcia <louisgtwo at gmail.com> wrote:

> I am trying to configure dhcp-server with two interfaces enp2s0 and enp3s0
> serving two network segments. 172.16.0.1/16 192.168.1.1/24 both
> interfaces are
> static an up. dhcpd keeps ignoring enp3s0. I'm running fedora 30 with
> dhcp-4.3.6
>
> #ip a
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
> default qlen 1000
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>     inet 127.0.0.1/8 scope host lo
>        valid_lft forever preferred_lft forever
>     inet6 ::1/128 scope host
>        valid_lft forever preferred_lft forever
> 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
> UP
> group default qlen 1000
>     link/ether 00:ec:ac:cd:65:12 brd ff:ff:ff:ff:ff:ff
>     inet 24.51.220.94/21 brd 24.51.223.255 scope global dynamic
> noprefixroute
> enp1s0
>        valid_lft 64440sec preferred_lft 64440sec
>     inet6 fe80::2ec:acff:fecd:6512/64 scope link
>        valid_lft forever preferred_lft forever
> 3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
> UP
> group default qlen 1000
>     link/ether 00:ec:ac:cd:65:13 brd ff:ff:ff:ff:ff:ff
>     inet 172.16.0.1/16 brd 172.16.255.255 scope global noprefixroute
> enp2s0
>        valid_lft forever preferred_lft forever
>     inet6 fe80::2ec:acff:fecd:6513/64 scope link
>        valid_lft forever preferred_lft forever# DHCP Server Configuration
> file.
> 4: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
> UP
> group default qlen 1000
>     link/ether 00:ec:ac:cd:65:14 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.1.1/24 brd 192.168.1.255 scope global noprefixroute
> enp3s0
>        valid_lft forever preferred_lft forever
>     inet6 fe80::2ec:acff:fecd:6514/64 scope link
>        valid_lft forever preferred_lft forever
>
> #cat /etc/dhcp/dhcpd.conf
> # DHCP Server Configuration file.
>
> authoritative;
> default-lease-time 600;
> max-lease-time 7200;
> subnet 172.16.0.0 netmask 255.255.0.0 {
>         option subnet-mask 255.255.0.0;
>         option routers 172.16.0.1;
>         range 172.16.0.50 172.16.0.100;
> }
> subnet 192.168.1.0 netmask 255.255.255.0 {
>         option subnet-mask 255.255.255.0;
>         option routers 192.168.1.1;
>         range 192.168.1.10 192.168.1.20;
> }
>
> #journal -xe
> Aug 15 21:58:43 spider.montclaire.lan systemd[1]: Starting DHCPv4 Server
> Daemon...
> -- Subject: A start job for unit dhcpd.service has begun execution
> -- Defined-By: systemd
> -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- A start job for unit dhcpd.service has begun execution.
> --
> -- The job identifier is 11405.
> Aug 15 21:58:43 dcpd[8117]: Internet Systems Consortium DHCP Server 4.3.6
> Aug 15 21:58:43 dhcpd[8117]: Copyright 2004-2017 Internet Systems
> Consortium.
> Aug 15 21:58:43 dhcpd[8117]: All rights reserved.
> Aug 15 21:58:43 dhcpd[8117]: For info, please visit
> https://www.isc.org/software/dhcp/
> Aug 15 21:58:43 dhcpd[8117]: ldap_gssapi_principal is not set,GSSAPI
> Authentication for LDAP will not be used
> Aug 15 21:58:43 dhcpd[8117]: Not searching LDAP since ldap-server,
> ldap-port and ldap-base-dn were not specified in the config file
> Aug 15 21:58:43 dhcpd[8117]: Config file: /etc/dhcp/dhcpd.conf
> Aug 15 21:58:43 dhcpd[8117]: Database file: /var/lib/dhcpd/dhcpd.leases
> Aug 15 21:58:43 dhcpd[8117]: PID file: /var/run/dhcpd.pid
> Aug 15 21:58:43 dhcpd[8117]: Source compiled to use binary-leases
> Aug 15 21:58:43 dhcpd[8117]: Wrote 0 leases to leases file.
> Aug 15 21:58:43 dhcpd[8117]:
> Aug 15 21:58:43 dhcpd[8117]: No subnet declaration for enp3s0; (no IPv4
> addresses).
> Aug 15 21:58:43 dhcpd[8117]: ** Ignoring requests on enp3s0;.  If this is
> not what
> Aug 15 21:58:43 dhcpd[8117]:    you want, please write a subnet declaration
> Aug 15 21:58:43 dhcpd[8117]:    in your dhcpd.conf file for the network
> segment
> Aug 15 21:58:43 dhcpd[8117]:    to which interface enp3s0; is attached. **
> Aug 15 21:58:43 dhcpd[8117]:
> Aug 15 21:58:43 dhcpd[8117]: Listening on LPF/enp2s0/00:ec:ac:cd:65:13/
> 172.16.0.0/16
> Aug 15 21:58:43 dhcpd[8117]: Sending on  LPF/enp2s0/00:ec:ac:cd:65:13/
> 172.16.0.0/16
> Aug 15 21:58:43 dhcpd[8117]: Sending on  Socket/fallback/fallback-net
> Aug 15 21:58:43 dhcpd[8117]: Server starting service.
> Aug 15 21:58:43 dhcpd[8117]: Discarding packet with bogus hlen.
> Aug 15 21:58:43 systemd[1]: Started DHCPv4 Server Daemon.
>

This is a mistake I have made before ... more that once ...
The end of each 'subnet' needs to have a semicolon:
subnet { ...
};

It misses the second one because of that.

Next, it might complain about 24.51.220.94/21 on enp1s0.  Try adding:

subnet 24.51.220.94 netmask 255.255.248.0 {
};

-- 
Bob Harold
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20190816/a952e249/attachment.html>


More information about the dhcp-users mailing list