I’m trying to make the DHCP Listen feature work to speed up presence detection on our iPhones.
I have read the binding documentation at Network - Bindings | openHAB and some threads in the community, including DHCP Listen is Broken. Can You Make it Go? - #2 by Udo_Hartmann and DHCP listen port forwarding issue.
I’m running openHAB 3.3M1 on a Pi4B running openhabian.
As expected, the dhcp_property of the Things is “No access right for port 67. Bound to port 6767 instead. Port forwarding necessary!” and the uses_ios_wakeup is “yes”.
I tried to enter the commands recommended in the binding documention:
sysctl -w net.ipv4.ip_forward=1
iptables -A INPUT -p udp --dport 6767 -j ACCEPT
iptables -t nat -A PREROUTING -p udp --dport 67 -j REDIRECT --to-ports 6767
the sysctl worked (once I prepended sudo). But the 1st iptables command does not work:
openhabian@openhab:~ $ iptables -A INPUT -p udp --dport 6767 -j ACCEPT
iptables v1.8.2 (nf_tables): unknown option "--dport"
Try `iptables -h' or 'iptables --help' for more information.
Also, I’m not sure whether the next section of recommended commands applies to me. The documentation says:
If a DHCP server is operating on port 67, duplicate the received traffic and forward it to port 6767:
iptables -A PREROUTING -t mangle -p udp ! -s 127.0.0.1 --dport 67 -j TEE --gateway 127.0.0.1
iptables -A OUTPUT -t nat -p udp -s 127.0.0.1/32 --dport 67 -j DNAT --to 127.0.0.1:6767
The Pi is connected to my router’s DHCP server. But I’m not sure if that means that a server is operating on port 67. I tried the netstat -a command I read about in one of the threads and it didn’t show anything for 67, but I’m not sure if that is relevant.
Thanks in advance for any suggestions on how to make this work.