Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP Multicast doesn't work on MacOS #476

Open
ihilt opened this issue Oct 27, 2023 · 4 comments
Open

UDP Multicast doesn't work on MacOS #476

ihilt opened this issue Oct 27, 2023 · 4 comments

Comments

@ihilt
Copy link
Contributor

ihilt commented Oct 27, 2023

In particular, these commands:

sudo ifconfig lo multicast
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev lo

fail since lo does not exist.

Changing lo to lo0 made further progress but route does not appear to have a netmask specifier. The following was accepted:

sudo route -nv add -net 224.0.0.0 -interface lo0

However the LCM self test continued to fail.

@SuryaB1
Copy link

SuryaB1 commented Apr 7, 2024

I am encountering the same issue.

@drmoose
Copy link
Contributor

drmoose commented Jan 4, 2025

If you don't specify a netmask, route will assume you want 255.255.255.255. Modern macos's route implementation seems to expect a CIDR subnet instead of a netmask, and the equivalent of 240.0.0.0 is /4, so try:

sudo route -nv add -net 224.0.0.0/4 -interface lo0

You can verify it's working with netstat -rn, which should have an entry in its ipv4 table like this:

Internet:
Destination        Gateway            Flags               Netif Expire
...snip...
224                lo0                USc                   lo0      

@danielcjacobs
Copy link
Contributor

Can confirm that sudo route -nv add -net 224.0.0.0/4 -interface lo0 worked.

Seems by default, my mac already had an entry for 224.0.0/4 in its routing table, but it was being directed through en0 instead of lo0. As a result I got the following error when running the above command:

$ sudo route -nv add -net 224.0.0.0/4 -interface lo0
u: inet 224.0.0.0; u: link lo0; u: inet 240.0.0.0; RTM_ADD: Add Route: len 136, pid: 0, seq 1, errno 0, flags:<UP,STATIC>
locks:  inits: 
sockaddrs: <DST,GATEWAY,NETMASK>
 224.0.0.0 lo0 240.0.0.0
route: writing to routing socket: File exists
add net 224.0.0.0: gateway lo0: File exists

I just had to remove the en0 entry from my routing table and then it worked:

sudo route -nv delete 224.0.0/4
sudo route -nv add -net 224.0.0.0/4 -interface lo0

@danielcjacobs
Copy link
Contributor

Seems closely related to #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants