Ask Your Question
0

How to configure DHCP to listen for requests on specific NIC?

asked 2013-03-02 00:56:20 -0500

uvsmtid gravatar image

updated 2013-03-02 01:19:52 -0500

There used to be /etc/sysconfig/dhcpd file which allowed to specify NIC name:

DHCPDARGS="eth0"

I'm using Fedora 18, and none of the packages even provides this file now:

yum whatprovides /etc/sysconfig/dhcpd

What is the currently recommended high-level alternative to configure this?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2013-03-02 01:11:35 -0500

uvsmtid gravatar image

updated 2013-12-16 08:19:47 -0500

I found a solution which I'm more than happy to accept: customize systemd unit file.

According to Fedora's wiki (cannot publish links, google "How do I customize a unit file"), custom unit file in /etc/systemd/system/ will take precedence over /usr/lib/systemd/system/dhcpd.service.

  • Copy the default unit file for dhcpd service to /etc/systemd/system/ as a template:
 cp /usr/lib/systemd/system/dhcpd.service /etc/systemd/system/
  • Modify custom unit file /etc/systemd/system/dhcpd.service to pass NIC name (i.e. p8p1) to DHCP daemon (according to dhcpd documentation in man 8 dhcpd):
 ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid     p8p1
  • Reload systemd to reflect changes in unit files:
 systemctl daemon-reload

As soon as dhcpd service is restarted, it will listen on specified NIC p8p1.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-02 00:56:20 -0500

Seen: 1,700 times

Last updated: Dec 16 '13