Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've setup a DHCP server on my Debian server (Proxmox) so that I can provision IPs to my KVM guests on the server automatically. For some reason the DHCP server (isc-dhcp-server) isn't responding to requests for an IP. The DHCP server is set to listen to a bridge interface I've created called vmbr1 and I know requests are getting through to the host from the KVM guest as I've tested it through dhcpdump -i vmbr1.

I've obviously made a mistake somewhere, can anyone spot it? I've included my configuration files below.

dhcp.conf file:

ddns-update-style none;
deny declines;
deny bootp;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.0.0 netmask 255.255.255.224 {
     interface vmbr1;
     option routers 192.168.0.5;
     option broadcast-address 192.168.0.31;
     option ntp-servers 192.168.0.101;
     option domain-name-servers 192.168.0.101;
     option netbios-name-servers 192.168.0.101;
     option netbios-node-type 2;
     default-lease-time 86400;
     max-lease-time 86400;
     #vmbr1ipv4
      host 104 {hardware ethernet 1A:27:59:82:39:8E;fixed-address 95.141.36.124;}
}

isc-dhcp-server file:

# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPD_CONF=/etc/dhcp/dhcpd.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPD_PID=/var/run/dhcpd.pid

# Additional options to start dhcpd with.
#       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="vmbr1"

interfaces file on host:

# network interface settings
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
        address  95.141.36.188
        netmask  255.255.255.0
        gateway  95.141.36.1
        broadcast  95.141.36.255
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        network 95.141.36.0
        bridge_maxwait 0

auto vmbr1
iface vmbr1 inet static
        address  192.168.0.5
        netmask  255.255.255.224
        bridge_ports none
        bridge_stp off
        bridge_fd 0

Example request from KVM guest to host server through vmbr1 using dhcpdump -i vmbr1:

  TIME: 2014-05-28 21:40:14.232
    IP: 0.0.0.0 (1a:27:59:82:39:8e) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 599fa654
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 1a:27:59:82:39:8e:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 (  8) Parameter Request List      1 (Subnet mask)
                         28 (Broadcast address)
                          2 (Time offset)
                          3 (Routers)
                         15 (Domainname)
                          6 (DNS server)
                         12 (Host name)
                         42 (NTP servers)

OPTION:  60 (  3) Vendor class identifier   d-i
---------------------------------------------------------------------------

Output from dhcpd

Internet Systems Consortium DHCP Server 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
WARNING: Host declarations are global.  They are not limited to the scope you declared them in.
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
Listening on LPF/vmbr1/fa:98:02:e0:1c:28/192.168.0.0/27
Sending on   LPF/vmbr1/fa:98:02:e0:1c:28/192.168.0.0/27
Sending on   Socket/fallback/fallback-net
There's already a DHCP server running.

Hopefully I've included enough information to help aid in a resolution. Many thanks!

share|improve this question
    
What "other server" is running?? There's already a DHCP server running. –  eyoung100 May 31 at 4:08
    
@ECarterYoung That's the actual DHCP server I've setup and have a problem with I think. The 'dhcpd' command would usually start the server, the server was already running as I had started it already so I just used the command to show the output information. –  Joel Kennedy May 31 at 14:54
    
Have you tried running udhcpc ? –  SHW Jun 2 at 10:54

3 Answers 3

subnet 192.168.0.0 netmask 255.255.255.224 {
....
      host 104 {hardware ethernet 1A:27:59:82:39:8E;fixed-address 95.141.36.124;}
}

THe IP address (95.141.36.124) you want to associate to that MAC address is out of the range you defined (192.168.0.1 to 192.168.0.30)

If I set a similar config (fixed address out of range) at home, then the requests from the associated MAC address are ignored.

Try removing completly the entry, your host 104 should then got a dynmaic address from the 192.168.0.0/27 range

share|improve this answer

Have you tried turning off the firewall/iptables? The majority of network service issues I run into are due to incorrect firewall configuration. As a quick sanity check, I'd try "service iptables stop" and see if things work. If they do you can start it again and try playing with some specific rules to configure it properly. If you have firewalld running you should probably try "service firewalld stop" as well (or systemctl stop firewalld.service if you have systemd).

share|improve this answer
    
I've just tried disabling iptables but no luck I'm afraid. There's no other firewall enabled on the system. –  Joel Kennedy May 29 at 0:47
    
hi guys sorry for interrupt, I need a help on dhcp server. Could you check this one unix.stackexchange.com/questions/140387/… –  rajcoumar Jul 3 at 7:45

I've tried before to run my DHCP server inside of an OpenVZ instance (which is the open sourced version of ProxMox) and was never able to get it working either. I ended up moving that service to the OpenVZ host, instead of one of the guests. This page from the OpenVZ project might be helpful for you in figuring out what's going on with your DHCP server.

These are the steps that are shown to setup your bridge interface + guest VM, I'd confirm that you have your settings in a similar setup:

$ vzctl create 144 --ostemplate centos-4-i386-minimal
$ vzctl start 144
$ vzyum 144 install dhcp
$ vzctl set 144 --netif_add eth0 --save
$ brctl show

$ brctl addif vzbr0 veth144.0
$ ifconfig vzbr0
$ cat /proc/sys/net/ipv4/conf/vzbr0/forwarding 
$ cat /proc/sys/net/ipv4/conf/vzbr0/proxy_arp 
$ echo 1 > /proc/sys/net/ipv4/conf/vzbr0/forwarding 
$ echo 1 > /proc/sys/net/ipv4/conf/vzbr0/proxy_arp

Additionally you might want to try debugging the interactions of your DHCP server by running tcpdump. These are some incantations that may prove useful in determining what's going on.

Examples

$ tcpdump -n -i br0 broadcast

-or-

$ tcpdump -A -p -n -i br0

-or-

$ tcpdump -i br0 host <ip of client> -l

References

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.