If want to push a static route to a single DHCP client, you can tag that client based on its MAC address.
And configure particular DHCP options to be advertised for this tag.
The DHCP option that you can use for this is below one:
pi@ph5b:~ $ pihole-FTL -- --help dhcp
Known DHCP options:
[..]
121 classless-static-route
My client laptop WiFi NIC has got below MAC:
dehakkelaar@laptop:~$ ip -br link
[..]
wlp16s0 UP 00:1f:3c:XX:XX:XX <BROADCAST,MULTICAST,UP,LOWER_UP>
IP's:
dehakkelaar@laptop:~$ ip -br -4 address show wlp16s0
wlp16s0 UP 10.0.0.112/24
And below routes:
dehakkelaar@laptop:~$ ip -4 route
default via 10.0.0.1 dev wlp16s0 proto dhcp metric 600
10.0.0.0/24 dev wlp16s0 proto kernel scope link src 10.0.0.112 metric 600
For the tagging and configuring routes, I can create below new config file on the Pi-hole host.
In below example I am advertising a route to the 192.168.1.0/24 network via router 10.0.0.254.
Notice I also have to push the default route/gateway 0.0.0.0/0,10.0.0.1 !
Also notice the MAC is in capital letters!
pi@ph5b:~ $ sudo nano /etc/dnsmasq.d/99-my-settings.conf
# Special route for laptop
dhcp-host=00:1F:3C:XX:XX:XX,set:specialroute
dhcp-option=tag:specialroute,option:classless-static-route,0.0.0.0/0,10.0.0.1,192.168.1.0/24,10.0.0.254
Check syntax:
pi@ph5b:~ $ pihole-FTL --test
dnsmasq: syntax check OK.
And below to apply:
pi@ph5b:~ $ sudo service pihole-FTL reload
pi@ph5b:~ $
Now if I go back to the laptop client and renew its DHCP lease, I can see the extra route:
dehakkelaar@laptop:~$ ip -4 route
default via 10.0.0.1 dev wlp16s0 proto dhcp metric 600
10.0.0.0/24 dev wlp16s0 proto kernel scope link src 10.0.0.112 metric 600
192.168.1.0/24 via 10.0.0.254 dev wlp16s0 proto dhcp metric 600
You can push all sorts of DHCP options to these tagged clients this way.
But not all DHCP options are always honored/applied!
EDIT: Ow you can checkout below for reference:
https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html