As the question title states, I want to classify my clients based on the interface their requests are coming from. Can this be done with normal matching?

Or should I restrict the DHCP server to only one interface and have dhcrelay listening on the others?

I'm really not sure if this is possible since I don't have much experience with dhcpd configuration so any advice is appreciated.


The DHCP server has multiple virtual interfaces (i.e eth0.1, eth0.2, etc) each on a different VLAN. The client's requests arrive as unicast (through a dhcp relay) to each of those interfaces depending on the VLAN they're coming from.

  • 1
    Please clarify, are you saying your DHCPD server has multiple interfaces or that your clients are coming from multiple subnets that are remote to the DHCPD server? Jul 4 '12 at 3:13
  • @SpacemanSpiff I've edited my question for clarification.
    – kirbuchi
    Jul 4 '12 at 3:21
  • Can you please draw a diagram of your environment? Jul 4 '12 at 14:24

When a router or other device relays a DHCP request, it sends along with it the subnet information of the interface that it received the request on. In other words, the point of relay is that your DHCP server does not need an interface on each VLAN to serve multiple subnets.

Are you trying to override that behavior and issue an IP address in a different subnet then is on the interface?

Maybe someone can clarify, but I believe if you have it listening on all those interfaces, it will issue an IP from the subnet which is configured on that interface.

  • What I currently do is assign IPs based on the subnet the request is coming from, for example: subnet netmask {range;} Since in some cases I'll have the same IPs on two different interfaces I want to find a way to differentiate based on the interface the request arrived to.
    – kirbuchi
    Jul 4 '12 at 3:37
  • And yes, I'm trying to issue an IP in a different subnet than is on hte interface.
    – kirbuchi
    Jul 4 '12 at 3:44
  • 2
    "Since in some cases I'll have the same IPs on two different interfaces" -- stop doing that and all will be well.
    – womble
    Jul 4 '12 at 5:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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