11

Could somebody explain what exactly this command means in relation to transmitting and receiving multicast traffic

route add -net 224.0.0.0 netmask 240.0.0.0 eth0
smicjk
  • 113
  • 1
  • 1
  • 5

2 Answers2

12

It was probably intended to mean "send all multicast through eth0", however 224.0.0.0 is not the correct netmask for multicast. The correct netmask for multicast would have been 240.0.0.0. This command specifies all addresses between 224.0.0.0 and 255.255.255.255, however the multicast range is really only 224.0.0.0 through 239.255.255.255. The rest of the range specified here is the "Class E" addresses, which are "reserved for future/experimental use". Its unlikely that these addresses are being used, so there is probably no difference.

stew
  • 9,263
  • 1
  • 28
  • 43
  • 4
    Note the OP corrected the netmask – Bryan Feb 08 '16 at 12:22
  • This note is important, because I can't see the old version of the question. Maybe clarify in the answer that `"however such and such ip-range/mask" is not the correct netmask for...` – DrBeco Apr 11 '22 at 21:32
7

The "224.0.0.0" is a reserved range of IPv4 addresses having special multicast meaning (IPv4 Multicast).

The command in itself just means that the multicast routing should go through the "eth0" interface.

Ouki
  • 1,367
  • 1
  • 11
  • 16
  • Thanks, does that mean both incoming and outgoing traffic is directed through eth0? – smicjk Feb 13 '12 at 13:29
  • Only outgoing traffic would be affected by this routing. The incoming traffic will still come through your "external" interface as known by your ISP/provider. – Ouki Feb 13 '12 at 13:46
  • Thanks Ouki, I am on a Lan. My machine has two ethernet cards. IMy application both transmits and receives multicast data. Would this route command only allow the transmission of multicast on eth0? Would that also mean that I should receive multicast on both eth0 and eth1? – smicjk Feb 13 '12 at 15:35
  • Yes you will transmit only through eth0, and yes you might receive through both (depending on your Lan router configuration and how your machine hostname resolve from elsewhere on this Lan). – Ouki Feb 13 '12 at 15:47