[jboss-jira] [JBoss JIRA] (JGRP-1808) Mac OS: no multicast route for 127.0.0.1
Bela Ban (JIRA)
issues at jboss.org
Fri Jul 11 10:06:25 EDT 2014
[ https://issues.jboss.org/browse/JGRP-1808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984249#comment-12984249 ]
Bela Ban edited comment on JGRP-1808 at 7/11/14 10:05 AM:
----------------------------------------------------------
When binding to 127.0.0.1 ({{lo0}}), a multicast route via {{en0}} cannot be used on Mac OS (this works on Linux).
So the solution is to use mcast addresses between {{224.0.0.1}} - {{231.255.255.254}} for local apps (bound to {{lo0}} and {{232.0.0.1}} - {{239.255.255.254}} for non-local apps (bound to {{en0}}). To do this, 2 multicast routes have to be added:
{noformat}
# Adds a route for 'local' multicasts when bound to 127.0.0.1
sudo route add -net 224.0.0.0/5 127.0.0.1
# Adds a route for 'non-local' multicasts (change 192.168.1.3 to your host's IP address)
sudo route add -net 232.0.0.0/5 192.168.1.3
{noformat}
All nodes bound to 127.0.0.1 should use a multicast address in the range {224.0.0.1}} - {{231.255.255.254}}, and all nodes bound to {{192.168.1.3}} should use a multicast address in the range {{232.0.0.1}} - {{239.255.255.254}}, e.g. {{<UDP mcast_addr="235.5.5.5".../>}}
was (Author: belaban):
When binding to 127.0.0.1 ({{lo0}}), a multicast route via {{en0}} cannot be used on Mac OS (this works on Linux).
So the solution is to use mcast addresses between {{224.0.0.1}} - {{231.255.255.254}} for local apps (bound to {{lo0}} and {{232.0.0.1}} - {{239.255.255.254}} for non-local apps (bound to {{en0}}). To do this, 2 multicast routes have to be added:
{noformat}
# Adds a route for 'local' multicasts when bound to 127.0.0.1
sudo route add -net 224.0.0.0/5 127.0.0.1
# Adds a route for 'non-local' multicasts (change 192.168.1.3 to your host's IP address)
sudo route add -net 232.0.0.0/5 192.168.1.3
{noformat}
> Mac OS: no multicast route for 127.0.0.1
> ----------------------------------------
>
> Key: JGRP-1808
> URL: https://issues.jboss.org/browse/JGRP-1808
> Project: JGroups
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Reporter: Bela Ban
> Assignee: Bela Ban
> Priority: Minor
> Fix For: 3.5
>
>
> On Mac OS (Mavericks), there is no multicast route in the routing table. So the default route is used (say 192.168.1.1). However, this doesn't work for nodes bound to 127.0.0.1 (don't know why).
> So for loopback, an mcast route has to be added, e.g.
> {noformat}
> sudo route add -net 224.0.0.0/4 127.0.0.1
> {noformat}
> This adds a default route to all class D (multicast) addresses via loopback. However, this doesn't work if the node is bound to 192.168.1.x !
> TODO:
> * See if we can get a default multicast route through 192.168.1.1 and make nodes bound to 127.0.0.1 use it
> * If this doesn't work, define multiple mcast routes for different mcast addresses, e.g.
> {noformat}
> sudo route add -net 224.0.0.0/4 127.0.0.1
> sudo route add -net 230.0.0.0/8 192.168.1.0
> {noformat}
> This adds loopback as default mcast route, but uses en0 if a multicast address starts with 230.x.x.x.
> UPDATE: the issue with the above commands is that the first command adds a multicast route for {{224.x.x.x}} - {{239.x.x.x}} using the first 4 bits as netmask. This *overrides* the second route.
> SOLUTION: Use the first *8 bits as netmask*: {{sudo route add -net 224.0.0.0/8 127.0.0.1}}. This creates a multicast route for {{224.0.0.1}} - {{224.255.255.255}}, which doesn't overlap with the second route.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
More information about the jboss-jira
mailing list