[Dnsmasq-discuss] How to make DHCP clients to add a network into their routing table?

Simon Kelley simon at thekelleys.org.uk
Mon Oct 24 16:09:51 BST 2011


On 24/10/11 15:57, Max Tsepkov wrote:
> Hello.
>
> I have a dhcp enabled network 192.168.1.0/30
> Where 192.168.1.1 is DHCP server and 192.168.1.2 is DHCP client.
> dnsmasq pushes default route just fine.
>
> But, I have another network 192.168.0.0/27 which is accessible from
> the same NIC.
> Is there a way to instruct the dhcp client to add this network to its
> routing table?
> For now, I do so manually, this makes desired effect:
>
>     # route add -net 192.168.0.0 netmask 255.255.255.224 dev eth0
>
> Thanks in advance.
>

There's a DHCP option, for this. 121, which is specified in RFC rfc3442

dnsmasq supports the encoding (check the example config file and the man 
page for details)

Something like

dhcp-option=121,192.168.0.0/27,192.168.0.0

should work. BUT, the DHCP client has to know about and support this 
option, it is responsible for actually setting up the route.

HTH

Simon.




More information about the Dnsmasq-discuss mailing list