Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 21267

General • How to forward unicast UDP packet to broadcast

$
0
0
I have an external IP address on the router + NAT to my home-local net. I want the wake-on-lan unicast UDP packet from the Internet to my router be forwarded to the local home network as a broadcast UDP-packet.

So, I cretaed the nex trule:
Code:
[admin@MikroTik] /interface/bridge/filter> /ip firewall nat printFlags: X - disabled, I - invalid; D - dynamic ... 2    ;;; wake-on-lan      chain=dstnat action=dst-nat to-addresses=192.168.1.255 to-ports=9 protocol=udp in-interface-list=WAN       dst-port=9 log=no log-prefix="" ...
But it doesn't work. The sniffer/torch doesn't see the corresponding broadcast going to the packete interface. If I change the address to unicast address of the my home-local machine (192.168.1.10 for example) then the packets go through normally. But I want the wol packet to be broadcast.

I figured out how to bypass this. I created a permanent entry in the arp table 192.168.1.15->FF:FF:FF:FF:FF:FF and specify 192.168.1.15 in the firewall rule.
This works with any IP addresses of my network except 192.168.1.255.

But i think adding virtual broadcast host is bad way. How to do it right?

Statistics: Posted by chabapok — Fri Dec 27, 2024 7:03 pm



Viewing all articles
Browse latest Browse all 21267

Trending Articles