Community discussions

MikroTik App
 
mahmudFatehi
just joined
Topic Author
Posts: 23
Joined: Mon Jul 01, 2024 6:06 pm

send udp packet with destination 255.255.255.255 to other subnet In router

Tue Jul 02, 2024 10:25 am

Hi guys,
I have a network like this
Image
I want to send udp packets with destination 255.255.255.255 from pc 2 to pc 1 that are not in the same subnet. so the mikrotik router doesn't forward packets to pc 2. if I bridge interface 1,2 it works. but a bridge is not a good solution. How can I route packets with destination 255.255.255.255 from pc 1 to pc 2 that are not in the same subnet and we don't want to use the bridge interface.
Thanks so much.
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1865
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

Re: send udp packet with destination 255.255.255.255 to other subnet In router

Tue Jul 02, 2024 10:37 am

255.255.255.255 (limited broadcast) is by default designed to work only on the local subnet (broadcast domain) otherwise you need to setup specific forwarding rules. As an alternative, you can use directed broadcast (e.g 192.168.1.255) or multicast. Is there a specific reason you can't have eth1 and eth2 on the same subnet?

EDIT:
255.255.255.255 (limited/local broadcast) is normally only needed for services like DHCP. May I ask what is your specific use case for using 255.255.255.255?
 
rplant
Long time Member
Long time Member
Posts: 603
Joined: Fri Sep 29, 2017 11:42 am

Re: send udp packet with destination 255.255.255.255 to other subnet In router

Wed Jul 03, 2024 5:28 am

I have in the past done the following

/ip arp
add address=192.168.44.252 interface=bridge-local mac-address=\
FF:FF:FF:FF:FF:FF

I was using it for Wake on Lan.
To any device on the 192.168.44.0/24 network

** Edit: on review, this is an answer to a different question :( **
Last edited by rplant on Wed Jul 03, 2024 7:17 am, edited 2 times in total.
 
User avatar
tangent
Forum Guru
Forum Guru
Posts: 1691
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: send udp packet with destination 255.255.255.255 to other subnet In router

Wed Jul 03, 2024 6:44 am

I was using it for Wake on Lan.

I have two different WoL clients here, and both support setting a directed broadcast address. At that point, your routing rules should transport the WoL packet across the boundary without any extra help. If it's being blocked, that's likely a firewall configuration lacuna.
 
mahmudFatehi
just joined
Topic Author
Posts: 23
Joined: Mon Jul 01, 2024 6:06 pm

Re: send udp packet with destination 255.255.255.255 to other subnet In router

Wed Jul 03, 2024 9:50 am

255.255.255.255 (limited broadcast) is by default designed to work only on the local subnet (broadcast domain) otherwise you need to setup specific forwarding rules. As an alternative, you can use directed broadcast (e.g 192.168.1.255) or multicast. Is there a specific reason you can't have eth1 and eth2 on the same subnet?

EDIT:
255.255.255.255 (limited/local broadcast) is normally only needed for services like DHCP. May I ask what is your specific use case for using 255.255.255.255?
Thanks for your attention.
A zlan device that converts serial to Network is connected to a router that has a protocol to configure it. This device is not like a router that has a key to reset it. Its configuration protocol is based on UDP with destination port  1092 and destination IP 255.255.255.255. When zlan is in the local subnet of a pc it can be configured .I don't want to configure it from a node with multi hob distance to my zlan. but i want to configure zlan from pc 2 without a bridge interface. Actually it is needed to configure  with 255.255.255.255 destination ip when we buy a zlan it can be configured for the first time without need to manually configure it. I mean no matter what is my ip address or zlan ip address it can be configured.
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1865
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

Re: send udp packet with destination 255.255.255.255 to other subnet In router

Wed Jul 03, 2024 6:17 pm

I'v used a zlan Modbus gateway a long time ago but I remember we configured it locally for TCP before deploying it. But if I get it right you want to be able to perform the initial configuration with the device already in place on the other subnet, right?

If you are absolutely sure you don't want to use bridge filters (ie bridge ip firewall) you might want to try out something like the following dst-nat forwarding rule:
/ip firewall nat add action=dst-nat chain=dstnat in-interface=ether1 dst-address-type=broadcast dst-port=1092 protocol=udp to-addresses=192.168.2.255

Do you know if the device will reply using unicast with the source address or another broadcast? If it uses broadcast, you'll probably need a matching forwarding rule on the other side as well:
/ip firewall nat add action=dst-nat chain=dstnat in-interface=ether2 dst-address-type=broadcast dst-port=1092 protocol=udp to-addresses=192.168.1.255