I'm attempting to enable multicast forwarding on Linux. I've read every
document I could get my hands on from google, but have had no success.
I've also tried groups.google.com with no success.
Currently I'm using Redhat 7.3 as the router. The Linux box sits between
2 lans, each lan having at least 20 machines. It forwards regular IP
traffic fine (ping,telnet,etc . . .) simply by using:
echo 1 > /proc/sys/net/ipv4/ip_forward
However, it never forwards multicast traffic. There are at least 20
machines continously sending multicast packets on the network.
I added the following to the routing table:
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth1
However, the Linux box still does not forward multicast packets.
I do not need it to be a true "multicast router", in the sense it
detects which machines are subscribed to which multicast groups. I just
need it to simply forward the multicast packet it receives on one
interface onto another interface.
After sniffing the packets with ethereal, I can see plainly that the UDP
multicast packets arrive on eth0, but are never forwarded.
The setup is a bit strange in that both lans do multicast broadcasts. So
basically the router will have to forward packets arriving on one
interface to the other interface, and vice-versa.
Does anyone have any experience with this kind of setup? Do I need to do
anything special just to get it to forward the multicast packets?
Thanks for any pointers.
Cheers,
Warren
These are not routable addresses (for local subnet use only) --
224.0.1.0 thru 224.0.1.255 and upward are the address ranges that are
routable. You may need to doublecheck:
http://www.iana.org/assignments/multicast-addresses
> However, the Linux box still does not forward multicast packets.
>
> I do not need it to be a true "multicast router", in the sense it
> detects which machines are subscribed to which multicast groups. I just
> need it to simply forward the multicast packet it receives on one
> interface onto another interface.
It's been a while since I've played with multicasting on a LAN, but
IIRC your Linux box needs to act as a multicast router -- multicast
"mangles" the MAC address. Since you are, in fact, trying to _route_
the packets, ie., pass packets from one interface to another, you will
need a multicast router.
> After sniffing the packets with ethereal, I can see plainly that the UDP
> multicast packets arrive on eth0, but are never forwarded.
>
> The setup is a bit strange in that both lans do multicast broadcasts. So
> basically the router will have to forward packets arriving on one
> interface to the other interface, and vice-versa.
This _is_ routing. Multicast routing, however, is not the same as
"regular" IP routing.
> Does anyone have any experience with this kind of setup? Do I need to do
> anything special just to get it to forward the multicast packets?
>
> Thanks for any pointers.
>
> Cheers,
>
> Warren
Basically, multicasting begins with an application requesting
multicast group membership. It is this request that tells a
muliticast router to enable forwarding on the interface that the
request arrived on -- no request, no routing. The request must be
processed by a multicasting router.
This same multicasting router notes all advertisements by multicast
groups. It is only the request for group membership from a _client_
that activates multicast forwarding -- otherwise it would have to
forward what would essentially be broadcast packets. Blocking
broadcast propogation is exactly what routers are meant to do.
There are other ramifications re: multicasting, but these are
necessary to its operation. The MAC address mangling is what is
getting you, and there is no way around it, afaik. This ethernet
multicast frame format is part of the protocol. It is not the same as
a regular ethernet frame MAC address.
hth,
prg
email above disabled
You need to run a multicast router to maintain the kernel route tables.
If you can get by with static routes where you define what
multicast address(es) from what source address(es) should be
forwarded to what interface, you can use smcroute:
http://www.cschill.de/smcroute/. The pim based dynamic
routers seem to be old and beta quality at best.
---
Les Mikesell
l...@futuresource.com
Thanks to all for the tips. I've downloaded pimd and got it it running.
I tried to compile mrouted, version 3.81 (I think). That horribly fails
to compile on Redhat 7.2 and Redhat Enterprise Linux 3.0, at least with
the default Makefile, so I gave up on it. pimd actually compiled so I'm
trying it for now.
From what I understand, here are the steps to get multicast forwarding
working:
- Ensure the kernel has the following enabled by looking in the .config
CONFIG_IP_MULTICAST
CONFIG_IP_PIMSM_V2
CONFIG_IP_MROUTE
the NETLINK-related options
- If not, enable it, recompile the kernel and reboot
- echo 1 >/proc/sys/net/ipv4/ip_forwarding to turn on IP forwarding
- assuming devices are eth0 and eth1, add multicast to the routing table
route add -net 224.0.0.0/4 dev eth0
route add -net 224.0.0.0/4 dev eth1
- start the pimd daemon
- Ensure that all clients are using the Linux box as the default gateway
(or manually add routes 224.0.0.0/4 to the routing table to force
multicast through the gateway)
Still doesn't forward the multicast traffic, but I suspect that a switch
or something else in between is messing around with the multicast
traffic (possibly).
Cheers,
Warren
While helping someone with an arp question I ran into this:
net.ipv4.conf.all.mc_forwarding = 0
which I obtained from
/sbin/sysctl -a
Your output would be diffenent from mine with the kernel config
changes, but I was wondering if you need to explicitly set
net.ipv4.conf.all.mc_forwarding = 1
or at least check that it is enabled on relevant interfaces.
Just thought I would pass this on -- haven't the time to look into it
further just now.
regards prg
email above disabled
> From what I understand, here are the steps to get multicast forwarding
> working:
>
> - Ensure the kernel has the following enabled by looking in the .config
> CONFIG_IP_MULTICAST
> CONFIG_IP_PIMSM_V2
> CONFIG_IP_MROUTE
> the NETLINK-related options
> - If not, enable it, recompile the kernel and reboot
> - echo 1 >/proc/sys/net/ipv4/ip_forwarding to turn on IP forwarding
> - assuming devices are eth0 and eth1, add multicast to the routing table
> route add -net 224.0.0.0/4 dev eth0
> route add -net 224.0.0.0/4 dev eth1
> - start the pimd daemon
> - Ensure that all clients are using the Linux box as the default gateway
> (or manually add routes 224.0.0.0/4 to the routing table to force
> multicast through the gateway)
>
> Still doesn't forward the multicast traffic, but I suspect that a switch
> or something else in between is messing around with the multicast
> traffic (possibly).
I'm not sure I'd trust pimd unless you have found one with some
recent support. Try using smcroute to see how that works. It
won't be enough if you need dynamic subscriptions or the senders
move around but you should be able to test with a known source
and make sure the kernel is forwarding.
---
Les Mikesell
lesmi...@comcast.net
I thought the same thing, so I tried to enable it. However, it returns
an error when trying to set it, and other postings on google say that
error means it is a 'read-only' sysctl variable.
However, once I started pimd, I noticed that it is set to '1'
automatically whenever pimd is running. So presumably pimd has the
authority to change that sysctl variable.
Thanks for the tip however.
Regards,
Warren