5

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.

Clarification:

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.

Ward - Reinstate Monica
  • 12,788
  • 28
  • 44
  • 59
kirbuchi
  • 161
  • 3

1 Answers1

5

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.

SpacemanSpiff
  • 8,733
  • 1
  • 23
  • 35
  • What I currently do is assign IPs based on the subnet the request is coming from, for example: `subnet 10.154.214.0 netmask 255.255.255.224 {range 10.154.214.2 10.154.214.30;}` 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 04 '12 at 03:37
  • And yes, I'm trying to issue an IP in a different subnet than is on hte interface. – kirbuchi Jul 04 '12 at 03: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 04 '12 at 05:35