i have a OpenWRT router with two ethernet port (one LAN and one WAN). I have configured the DHCP server to have a static lease for a MAC prefix (using wildcard for part of the MAC) and port routing to redirect HTTP traffic to said lease. The goal is to have the ability to plug any device with the correct MAC prefix and be able to access it through the WAN port using the Openwrt router hostname. My issue here is that the leasetime for dnsmasq being 2 minutes minimum, whenever i unplug a device and plug new in the LAN port, it takes 2m before dnsmasq can have the lease free to give the lease to the new device.
I tried two things to get this working without having to wait for two minutes:
set the lease file to /dev/null. This does not work since the lease are cached and the file is only used between the service restarts
trigger a dnsmasq restart (with lease file to /dev/ull) whenever the LAN port is unplugged, but i cannot get any hotplug event for my interface.
How can i get this working ? The sedonc option of restarting dnsmasq seems viable, but the interface being on a bridge i d'on't know how to get hotplug events.
The IP for the mac doesn’t really matter.
You can set static leases for the mac (of interest) fixed to a specific hostname (many mac can be booked with the same hostname as long as they aren't connected at the same time) and forget about the IP.
i figured how to have the static lease configured for the given hostname (instead of IP) but the port redirection has to be configured with a IP and not a hostname. Any idea no how to configure the port redirection from wan to lan to the given host ?