Configure network interface with multicast address in linux

In this post going to see how to configure network interface with multicast address in linux.
Multicast will send information to a group of destination simultaneously.
Most probably class D( – IP Address used in multicasting

Enable/ Disable Multicast:
Enabling Multicast:

#ifconfig eth0 multicast

once enabled check using #ifconfig eth0 command and you can find a line like below from the output of this command.


Disbaling muticast:

# ifconfig eth0 -multicast
follow the same command to check the status
# ifconfig eth0
UP BROADCAST MTU:1500  Metric:1

We could see there is no word mentioned in this output like “MULTICAST”
Check whether multicast enabled in Kernel or not.

#grep -i multi /boot/config-<Kernel version>
* CONFIG_IP_MULTICAST=y  #if “CONFIG_IP_MULTICAST” value mentioned as “n” then multicast disabled. We should make it as “y” (yes)

Configure Network interface to send muticast traffic over the network:
We should add a default gateway to multicast traffic, to the specific Network Interface. Use the below command to add default route

# route add -net netmask dev eth0

Then check the default route
#  route -n

You will get output like below
#  route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface       U     0      0        0 eth0

Command to check the multicast group in our host
# netstat -g
# cat proc/net/igmp

From the above commans will get output with multicast address for eth0 interface.
Now we configured a network interface with multicast address.

Leave a Reply

Your email address will not be published. Required fields are marked *