[solved] dhcpd configuration with virtual bridges

Issues related to configuring your network
Post Reply
MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

[solved] dhcpd configuration with virtual bridges

Post by MartinR » 2019/05/15 08:36:40

So that my virtual machines can see and be seen I have configured the system to use a virtual bridge rather than NATting them. There are two NICs, enp4s0 (which is on another net and can be ignored) and enp3s0. The bridge (br3) is tied to this latter interface:

Code: Select all

# ip addr
...
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br3 state UP group default qlen 1000
    link/ether 40:16:7e:a7:b7:84 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::4216:7eff:fea7:b784/64 scope link 
       valid_lft forever preferred_lft forever
...
4: br3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 40:16:7e:a7:b7:84 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 brd 192.168.1.255 scope global br3
       valid_lft forever preferred_lft forever
    inet6 fe80::4216:7eff:fea7:b784/64 scope link 
       valid_lft forever preferred_lft forever
...
When dhcpd starts up it complains about enp3s0:

Code: Select all

 dhcpd: No subnet declaration for enp3s0 (no IPv4 addresses).
 dhcpd: ** Ignoring requests on enp3s0.  If this is not what
 dhcpd:   you want, please write a subnet declaration
 dhcpd:   in your dhcpd.conf file for the network segment
 dhcpd:   to which interface enp3s0 is attached. **
Normally one can make a dummy declaration for a network just to remove the error (and its consequent appearance in /var/log/messages and logwatch), however the subnet declaration requires an IP address and netmask to identify the interface. Is there any way to tell dhcpd just to ignore enp3s0?
Last edited by MartinR on 2019/05/15 17:22:50, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: dhcpd configuration with virtual bridges

Post by TrevorH » 2019/05/15 14:36:57

Code: Select all

$ cat /etc/sysconfig/dhcpd
# 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

# example:
# $ cp /usr/lib/systemd/system/dhcpd.service /etc/systemd/system/
# $ vi /etc/systemd/system/dhcpd.service
# $ ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid <your_interface_name(s)>
# $ systemctl --system daemon-reload
# $ systemctl restart dhcpd.service
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: dhcpd configuration with virtual bridges

Post by MartinR » 2019/05/15 17:22:35

Thanks Trevor, just the prompt I needed. The startup is clean now.

Post Reply