dhcp server with multiple interfaces

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

dhcp server with multiple interfaces

Louis Garcia
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.


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: dhcp server with multiple interfaces

Bob Harold

On Thu, Aug 15, 2019 at 11:28 PM Louis Garcia <[hidden email]> 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


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: dhcp server with multiple interfaces

Simon Hobson
Bob Harold <[hidden email]> wrote:

> Next, it might complain about 24.51.220.94/21 on enp1s0.  Try adding:
>
> subnet 24.51.220.94 netmask 255.255.248.0 {
> };

Or configure the daemon to only listen on the interfaces it serves. Given that enp1s0 is the internet facing interface, not listeing on it would be good security practice.

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: dhcp server with multiple interfaces

Louis Garcia
I have been using /etc/sysconfig/dhcpd to restrict dhcpd to certain interfaces not knowing this file was not used anymore. With /etc/sysconfig/dhcpd clear I get the desired behavior.

dhcpd[2175]: Internet Systems Consortium DHCP Server 4.3.6
dhcpd[2175]: Copyright 2004-2017 Internet Systems Consortium.
dhcpd[2175]: All rights reserved.
dhcpd[2175]: For info, please visit https://www.isc.org/software/dhcp/
dhcpd[2175]: ldap_gssapi_principal is not set,GSSAPI Authentication for LDAP will not be us>
dhcpd[2175]: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not spec>
dhcpd[2175]: Config file: /etc/dhcp/dhcpd.conf
dhcpd[2175]: Database file: /var/lib/dhcpd/dhcpd.leases
dhcpd[2175]: PID file: /var/run/dhcpd.pid
dhcpd[2175]: Source compiled to use binary-leases
dhcpd[2175]: Wrote 2 leases to leases file.
dhcpd[2175]: 
dhcpd[2175]: No subnet declaration for enp4s0 (no IPv4 addresses).
dhcpd[2175]: ** Ignoring requests on enp4s0.  If this is not what
dhcpd[2175]:    you want, please write a subnet declaration
dhcpd[2175]:    in your dhcpd.conf file for the network segment
dhcpd[2175]:    to which interface enp4s0 is attached. **
dhcpd[2175]: 
dhcpd[2175]: Listening on LPF/enp3s0/00:ec:ac:cd:65:14/<a href="http://192.168.1.0/24
dhcpd[2175">192.168.1.0/24
dhcpd[2175]: Sending on   LPF/enp3s0/00:ec:ac:cd:65:14/<a href="http://192.168.1.0/24
dhcpd[2175">192.168.1.0/24
dhcpd[2175]: Listening on LPF/enp2s0/00:ec:ac:cd:65:13/<a href="http://172.16.0.0/16
dhcpd[2175">172.16.0.0/16
dhcpd[2175]: Sending on   LPF/enp2s0/00:ec:ac:cd:65:13/<a href="http://172.16.0.0/16
dhcpd[2175">172.16.0.0/16
dhcpd[2175]: 
dhcpd[2175]: No subnet declaration for enp1s0 (24.51.220.122).
dhcpd[2175]: ** Ignoring requests on enp1s0.  If this is not what
dhcpd[2175]:    you want, please write a subnet declaration
dhcpd[2175]:    in your dhcpd.conf file for the network segment
dhcpd[2175]:    to which interface enp1s0 is attached. **


On Fri, Aug 16, 2019 at 3:28 PM Simon Hobson <[hidden email]> wrote:
Bob Harold <[hidden email]> wrote:

> Next, it might complain about 24.51.220.94/21 on enp1s0.  Try adding:
>
> subnet 24.51.220.94 netmask 255.255.248.0 {
> };

Or configure the daemon to only listen on the interfaces it serves. Given that enp1s0 is the internet facing interface, not listeing on it would be good security practice.

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users