Multiple DHCP options per Client

Hello,

I want to achieve the following:

I want to give several DHCP clients another Gateway and DNS Server.

At the moment I am using config tag in the dhcp config file:

config tag 'cninet'
        option dhcp_option '3,192.168.0.4'
        option dhcp_option '6,192.168.0.4'

config host
        option name 'Client1'
        option mac 'XX:XX:XX:XX:XX'
        option ip '192.168.0.155'
        option tag 'cninet'

But I don't get the result I want. With this configuration, only the DNS server is published to the client. Router (Gateway) stays at 192.168.0.1.
If I delete option dhcp_option '6,192.168.0.4' and only keep the Router (3) option, I get 192.168.0.4 advertised to the client as gateway, but the DNS Server stays at 192.168.0.1. I tried many different formats, but I always either have the correct DNS server, or the correct gateway. Never both at the same time.

Isn't it possible? Or am I doing something wrong?

Thanks a lot.

1 Like

Thanks @frollic

I just needed to add "list" in front of the option. Now it's working.

config tag 'cninet'
        list option dhcp_option '3,192.168.0.4'
        list option dhcp_option '6,192.168.0.4'

config host
        option name 'Client1'
        option mac 'XX:XX:XX:XX:XX'
        option ip '192.168.0.155'
        option tag 'cninet'

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.