Multiple class options

Simon Hobson dhcp1 at
Fri Mar 14 14:18:19 UTC 2014

Nisha Chandy <nchandy at> wrote:

> I am looking for a way to match multiple options in a class and I get an error in syntax. Appreciate any help of doing this.
> The two options that I need to use are agent.circuit-id or agent.subscriber-id. thanks
> class "Vlan5" {
> ((match if option agent.circuit-id = "Vlan5") or (match if option agent.subscriber-id = "Vlan5"));
> }   

It's "match <boolean expression>", so you probably want :

match if ((option agent.circuit-id = "Vlan5") or (option agent.subscriber-id = "Vlan5"));
match if (option agent.circuit-id = "Vlan5") or (option agent.subscriber-id = "Vlan5");

Also be aware that if an option is not present, I think any expression using it becomes "unknown" and hence you may need some "if exists" bits in there. Possibly "pick first option" might be useful, as in :
match if pick first option (option agent.circuit-id,option agent.subscriber-id) = "Vlan5";

You'll need to check the correct names and syntax - man dhcp-eval

More information about the dhcp-users mailing list