DHCP and multiple VLANs

Glenn Satchell Glenn.Satchell at uniq.com.au
Mon Oct 13 11:40:32 UTC 2008


>Date: Mon, 13 Oct 2008 13:17:23 +0200
>From: <santi at usansolo.net>
>To: dhcp-users at isc.org
>Subject: DHCP and multiple VLANs
>
>Dear Srs,
>
>I'm trying to setup a dhcpd3 server in a network with near about 20 vlans,
>using v3.0.1-2 in a Debian Sarge box.
>
>I setup all vlans in Linux using vconfig, and using tcpdump I can see all
>DHCPDISCOVER requests without problems from all VLANs, network config is
>working OK (all vlan interfaces has eth0 as raw device).
>
>There are near about 20 vlans and I'm *not giving IP address to those vlan
>interfaces*, example:
>
>(..)
>auto vlan101
>iface vlan101 inet static
>        address 0.0.0.0
>        netmask 0.0.0.0
>        vlan_raw_device eth0
>
>auto vlan102
>iface vlan102 inet static
>        address 0.0.0.0
>        netmask 0.0.0.0
>        vlan_raw_device eth0
>(..)
>
>I start dhcpd3 listening on all interfaces, and I can't see DHCP request in
>the logs.. but I can see requests without problems using tcpdump :-/
>
>If I setup a IP for each vlanXXX interface dhcpd3 works OK; but, there's no
>way to prevent giving one IP to each vlan interface in the Linux box?
>
>I have tried giving a dummy IP (127.0.0.2/255.0.0.0) for the vlan
>interfaces.. but I get:
>
>Oct 13 13:13:13 pxe dhcpd: DHCPDISCOVER from 00:19:b9:XX:XX:XX via
>vlan3539: network 127.0/8: no free leases
>
>What's the best method to deal with DHCP and multiple VLAN, perhaps I must
>assing a IP foreach vlanXXX? Thanks!
>
>Regards,
>
>--
>Santi Saez
>http://woop.es
>

There's two possible solutions here.

The first one you have worked out - have multiple vlans visible on the
dhcp server. dhcp requires an IP address on each subnet so that it can
match up the subnet definition in dhcpd.conf to an interface where
requests are coming in.

The second way to do this is to have only a single vlan configured on
the dhcpd server. Then use the router or switch as the dhcp-relay to
forward requests from each vlan to the dhcp server. In a Cisco router
or switch this is ip-helper.

In both cases dhcpd.conf would be very similar, it's just the way the
requests get to dhcpd that differs.

regards,
-glenn



More information about the dhcp-users mailing list