DHCP does not recognise mac address of interface

Hi Patrickl

I have two wired NICs and one Wifi interface in that machine, and my problem is about using one of them, please take a look at the error report and see if it makes sense.

I see in Ubuntu there is a way off declaring a NIC, I cannot find that information in Fedora, or it is explicitly wrong/outdated.

Excuse me. Your goal is to set up a DHCP server on one of the two interfaces?

Hi alciregi

Yes, thatā€™s correct, sorry to be vague, Iā€™m doing 3 things at once.

Where is the Fedora documentation about selecting a NIC?

This is from Ubuntu:

Select Interface card

nano -w /etc/default/isc-dhcp-server

INTERFACES=ā€œwlan0 eth0ā€

I would like to see something like that

Itā€™s mostly just a question of having the resources to keep all this up to date and make the necessary changes. Please feel free to file ticketsā€”at least that way, the community is aware of what needs to be done.

Edit: only an FAS is required to open tickets (and contribute anywhere in the Fedora community) which you already have now.

Hi FransiscoD

I guess I have been to lazy before, or too involved in the immediate problem. I am trying to change that now.

Tonight I will go through the systemd issue on Bugzilla.

1 Like

So.
subnet statement, specifying the subnet of the interface where you want to answer to clients (like the example in the @patrickl post), will bind the DHCP server on such interface. (You should provide the result of ip a command in order to be more precise).

If you donā€™t need and you donā€™t want that the DHCP server will bind also on the other interface, and at the same time you donā€™t want to see ā€œNo subnet declaration forā€ message (that is not an error, but an informational message), you need to specify on which interfaces DHCP should bind.

On Fedora, usually, daemon configuration files are placed under the /etc/sysconfig directory.
So the file could be /etc/sysconfig/dhcpd.
And if you read the content of such file, you will discover how things works.

# 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.

# If you still insist on adding some command line options,
# copy dhcpd.service from /lib/systemd/system to /etc/systemd/system and modify
# it there.
# https://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F

Hi alciregi

Yes, thanks, I know that. However, as you can see, explicitly stated at the top of that file are the words:

WARNING: This file is NOT used anymore.

And, it refers to making the subnet declaration in dhcpd.conf.

Where is the instruction about subnet declaration in dhcpd.conf? It is not in Fedora documentation.

Well, indeed, I pasted the content of such file in the previous post.
But if you continue to read, it will explain two more things:

  • dhcpd listens only on interfaces for which it finds subnet declaration in dhcpd.conf
  • Steps to follow if you still insist on adding some command line options

Yes, indeed, and I have been through all this, and eventually resorted to posting on here because there is no instruction to NIC specific subnet declaration in Fedora documentation with regard to dhcpd.conf

Please take a look for yourself:

https://docs.fedoraproject.org/en-US/Fedora/14/html/Deployment_Guide/s1-dhcp-configuring-server.html

I cannot see it! I used the only thing that made any sense to assigning to hardware and tried it, which is what you see in my dhcpd.conf posting.

It is in the dhcp.conf man page (man dhcp.conf).
There is an example in /usr/share/doc/dhcp-server/dhcpd.conf.example (as stated in the original /etc/dhcp/dhcpd.conf itself).
If dhcp.conf man page is too complex (I rarely read the entire man page!) you can find many examples in the web: the ISC DHCP server is the same for all distributions.

Again. Maybe this documentation was still valid for Fedora 14!

However ISC DHCP configuration file is more or less the same since many years.
The example 6.1 provided in such page seems still valid https://docs.fedoraproject.org/en-US/Fedora/14/html/Deployment_Guide/s1-dhcp-configuring-server.html#subnet at least as a starting point.

At the end of the day, I think that if you want to configure a service, you need to read the manual of the specific service. So, if you donā€™t find a suitable document reasonably updated related to such service deployed on Fedora, you should read the manual of the specific service. In this case ISC DHCP https://kb.isc.org/docs/aa-00333

This is valid for any service: if you need to configure Apache Web Server, once discovered where you will find the configuration files and so on and once understood how a service will be started and stopped in Fedora, you will find more updated and in-depth informations in the Apache documentation. IMHO

Hi alciregi

On the fedora 14 page, where does it state about assigning DHCP server to a particular hardware interface? That is the page I have been using, and I cannot see it.

I installed dhcp on this machine (one of my desktops) and, take a look at dhcpd.conf.example (which I already had done) shows this:

Fixed IP addresses can also be specified for hosts. These addresses
should not also be listed as being available for dynamic assignment.
Hosts for which fixed IP addresses have been specified can boot using
BOOTP or DHCP. Hosts for which no fixed address is specified can only
be booted with DHCP, unless there is an address range on the subnet
to which a BOOTP client is connected which has the dynamic-bootp flag
set.
host fantasia {
hardware ethernet 08:00:07:26:c0:a5;
fixed-address fantasia.example.com;

Which is what I was doing, and it didnā€™t work

Setting up DHCP is not universal, because, as I mentioned, Ubuntu explicitly defines the interfaces in /etc/default/isc-dhcp-server

If Fedora did, or explained how to define them in DHCPD.conf, then I wouldnā€™t be asking the questions, or being pointed to documentation that doesnā€™t have the answer.

Maybe you can save me typing and just explain to me the exact syntax? It would be highly appreciated!

as FransciscoD mentioned, each distro will implement such devices differently, and will store variables in different locations, therefore, the valid course of action is to read distro specific documentation.

The Fedora documentation does not describe how to allocate a hardware interface as a DHCP server, and the .example file outlines a syntax which looks, to my eyes, very similar to my original dhcpd.config but it doesnā€™t work, and I canā€™t find out why.

Nope, no explicit instruction within man dhcpd about assigning an interface that I can see.

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.

So, there is no need to specify on which interface DHCP should listen.

Letā€™s say your host has these IP addresses (please provide ip a command resultā€¦):
eth0 192.168.1.1 netmask 255.255.255.0
eth1 192.168.56.1 netmask 255.255.255.0
And you want to configure the DHCP server only on eth0, you need to define

subnet 192.168.1.0 netmask 255.255.255.0 {
   range 192.168.1.20 192.168.1.40;
   ...
}

DHCP server will be active only on the interface that is part of the subnet 192.168.1.0/255.255.255.0, hence eth0. And it will dynamically provide IPs (from 192.168.1.20 to 192.168.1.40) to the clients connected on the same subnet of eth0.
If you need to always assign the same address to a specific client identified by the xx:xx:xx:xx:xx:xx MAC address, you will add this declaration:

host fantasia {
  hardware ethernet xx:xx:xx:xx:xx:xx;
  fixed-address 192.168.1.200;
}

Said that, sorry, but it is still unclear to me what you are trying to achieve. Does your machine already have IP addresses? Do you want to configure you machine as a DHCP server on one interface to assign IPs to other hosts in the same subnetwork?
As far as I can see from the logs in one of your first posts, you have these interfaces: enp8s0f1, enp8s0f0, wls6. I donā€™t know the network mask, but it seems that they are all on the same subnet 192.168.0.x and you want to configure the DHCP for the 192.168.15.0/255.255.255.0 subnet, and this could not work. Moreover, here, what are you trying to do?

host server {
  hardware ethernet XX:XX:XX:XX:XX:XX;
  fixed-address 192.168.15.1;
}

If you think that this will assign the IP 192.168.15.1 to the machine where the DHCP server is running, you are wrong. You are wrong even if you think that this is the definition of the interface on which the DHCP will bind to.
As said, you should read the DHCP manual and not the Fedora one.

@valve Your dhcpd config uses 192.168.15.x but your interfaces seem to be on 192.168.0.x. I think dhcpd is right to fail. Why are you using 192.168.15.x for dhcp when your interfaces are on 192.168.0.x?

Hereā€™s sortof what seems to happen:

  1. dhcpd starts, enumerates interfaces, detects itā€™s ip addresses (and subnet ranges)
  2. dhcpd finds a subnet declaration in the dhcpd config
  3. dhcpd checks to which interface that subnet declaration belongs
  4. since your subnet declaration is 192.168.15.x and your interfaces are on 192.168.0.x dhcpd concludes that itā€™s not configured to listen on any interfaces

Solution: use a subnet declaration thatā€™s similar to the subnet that your preferred interface is on.

2 Likes

Did you find the file /etc/default/isc-dhcp-server?

This is Ubuntu/Debian specific.

Hi patrickl

Your observation is correct, but, thatā€™s only because I plugged that NIC back into my LAN for now.

The error report was the same when that NIC was plugged into an independent switch or left open and assigned a fixed ip