Forwarding multicast packets in Linux, for different subnets.

Discussion in 'Linux Networking' started by smshahriar, Apr 26, 2005.

  1. smshahriar

    smshahriar Guest

    Here is my setup:


    Linux Box with two NICS
    PC1 router NIC(eth0)---NIC(eth1) router
    PC2
    192.168.1.100 192.168.1.1 192.168.1.111 192.168.4.114 192.168.4.1
    192.168.4.100


    Linux Box:
    ---------
    /proc/sys/net/ipv4/ip_forward


    PC1
    ----
    ping 192.168.4.1 - works
    ping 224.0.0.1 - only get reply from 192.168.1.1 and 192.168.1.111


    PC2
    ----
    ping 192.168.4.1 - works
    ping 224.0.0.1 - only get reply from 192.168.4.1 and 192.168.1.114


    The Linux box does not seem to forward multicast packets. Can someone
    shed any light on this?

    Thanks,
     
    smshahriar, Apr 26, 2005
    #1
    1. Advertisements

  2. smshahriar

    prg Guest

    No way to match IPs with boxes/nics with this ASCII art :(
    Multicast is not routed like other packets...

    Newer distros/kernels enable multicast, afaik...

    Drivers for nics enable multicast, afaik...

    To "route/forward" multicast packets requires a multicast routing
    daemon listening for requests to join a multicast group. No evidence
    that you're running such a multicast routing protocol daemon.

    Look through this dated/abstract howto for some background:
    http://www.tldp.org/HOWTO/Multicast-HOWTO.html

    Look for which routing daemon(s) comes with your distro (if any) and
    read up on it. Decide which kind of routing you need,
    install/configure the daemon, test it, then return with specific
    questions -- I can bet my private parts that you will have some;)

    Would help to know just what application(s) you have in mind for
    running multicast. Just on the lan? MBone?

    and good luck,
    prg
     
    prg, Apr 26, 2005
    #2
    1. Advertisements

  3. smshahriar

    smshahriar Guest

    Thank you very much prg. Really appreciate you help.

    I am running Kernel version 2.4.19 and have enabled multicast
    routing and also I have enabled PIMv1 and PIMv2.

    I run all applications on LAN.

    Do you have any recommended routing dameon? I just need
    multicast pings to work ;)

    Thanks,
     
    smshahriar, Apr 26, 2005
    #3
  4. Check out the following:

    mrouted: http://jukie.net/~bart/multicast/Linux-Mrouted-MiniHOWTO.html
    zebra: http://www.zebra.org/

    General encyclopedic resource on Internet:

    http://www.cs.columbia.edu/~hgs/internet/

    -MT

    On Tue, 26 Apr 2005 wrote:

    | Date: 26 Apr 2005 15:33:06 -0700
    | From:
    | Newsgroups: comp.os.linux.networking
    | Subject: Re: Forwarding multicast packets in Linux, for different subnets.
    |
    | Thank you very much prg. Really appreciate you help.
    |
    | I am running Kernel version 2.4.19 and have enabled multicast
    | routing and also I have enabled PIMv1 and PIMv2.
    |
    | I run all applications on LAN.
    |
    | Do you have any recommended routing dameon? I just need
    | multicast pings to work ;)
    |
    | Thanks,
    |
    |
     
    Michael E. Thomadakis, Apr 27, 2005
    #4
  5. oh I fiddled with this for ages and only solved it last week for the purpose
    of getting the multicasting of my DVB-T card working perfectly. After a
    while I gave up on 'mrouted' as I did not need to have dynamic multicast
    routing, I only plan on routing a single source (or rather few known sources)
    and stumbled on my travels into 'smcroute'[1].

    I think I worked out what my problem with 'mrouted' was, the details in
    'ip_mr_vif' were wrong and the interface I wanted to route out on was not in
    the 'available' list. Below I have show a 'working' setup:

    ---------
    [email protected]:~$ cat /proc/net/ip_mr_vif
    Interface BytesIn PktsIn BytesOut PktsOut Flags Local Remote
    0 eth2 0 0 0 0 00000 5433860E 00000000
    1 eth0 0 0 0 0 00000 0A8000FE 00000000
    2 eth2 -1109020840 113793114 0 0 00000 5433860E 00000000
    3 eth0 0 0 0 0 00000 0A8000FE 00000000
    4 eth4 0 0 -1109020840 113793114 00000 0A800AFE 00000000
    [email protected]:~$ cat /proc/net/ip_mr_cache
    Group Origin Iif Pkts Bytes Wrong Oifs
    E0000102 0A8000C0 2 113795120 -1106011840 0 4:1
    ---------

    First time I noticed, heh, spot the 32 bit signed variables :)

    Now to fix this I found bringing down all the interfaces and back up fixed
    things. Then using smcroute I typed:

    # /usr/local/sbin/smcroute -d
    # /usr/local/sbin/smcroute -a eth2 10.128.0.192 224.0.1.2 eth4

    The first line runs the daemon, the second line says "add a multicast source
    from the interface 'eth2' where the source's unicast address is 10.128.0.192
    and multicast address of the stream is 224.0.1.2 and then support routing
    this out on 'eth4'". According to the manpage you simply append further
    interfaces to the end of the line to route across more than one interface; I
    only needed it over eth4.

    Then to check:
    -----
    guacamole:/home/alex# ip mroute show
    (10.128.0.192, 224.0.1.2) Iif: eth2 Oifs: eth4
    -----

    Iifs == inputs, Oifs == outputs. Then you should be cooking :)

    I would go back to 'mrouted' now that I know about the interfaces were not
    showing up in 'ip_mr_vif' originally (I had initially the same problem with
    smcroute), but it is overkill for my needs.

    None of this is well documented, I plan on making a howto at somestage, I
    worked it out through the good old method of "if you hit it hard enough it
    will go a long way". To make my life more difficult, eth4 is to a wifi point
    and the gateway acts as an IPSec wifi access point. My firewall rules were
    playing havoc and it takes a while to get used to writing 'multicast'
    compatible firewall rules :) Even if the linux kernel supported it, you
    cannot IPSec multicast packets, I could not IPSec my multicast traffic as the
    CPU on my router is only a 50Mhz Sun Lunchbox RISC processor, the beauty will
    only shift 200kB/s ESP traffic or 450kB/s AH; not enough for DVB-T :)

    Good luck.

    Cheers

    Alex

    [1] http://www.cschill.de/smcroute/
     
    Alexander Clouter, Apr 28, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.