Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-11-2010, 01:12 AM   #1
Shyju N
LQ Newbie
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
Enabling iptables to forward multicast or broadcast messages


Can we enable IP tables to forward multicast or broadcast messages?

Our setup is as mentioned below

Machine A (end node, with Linux):
Machine B (end node, with Linux):
Machine C (IP forwarding, with Linux.
IP tables needs to be configured here.
This machine is connected to A and B on to separate Ethernet interfaces 1 and 2 respectively)

Interface 1:
Interface 2:

i.e. machine A and B are connected to each other via machine C.

I have a UDP application which will register all three machines to a multicast group (, and UDP application on Machine A sends out a multicast message and UDP application on Machine B and C will be in a blocked recv() function. Since Machine A is connected to interface 1 of Machine C, the application in Machine C receives the packet, but the same is not forwarded to Machine B.

I have enabled IP Forwarding on Machine C by $ echo "1" > /proc/sys/net/ipv4/ip_forward and there are static routes to Machine A and B from C through interfaces 1 and 2.

Here is the IPTABLES log

$ iptables -A INPUT -m pkttype --pkt-type multicast -j LOG
$ dmesg -c

IN=eth0 OUT= MAC= SRC= DST= LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2

IN=eth0 OUT= MAC= SRC= DST= LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2

Thanks 'n regards
-Shyju N
Old 01-11-2010, 08:34 AM   #2
LQ Newbie
Registered: Apr 2009
Posts: 11

Rep: Reputation: 0
In the given scenarion you have to route it to only one machine, but I suppose the real situation is not that simple. Which is a bit insane, and I'm afraid not possible straight with iptables only. For explanation why it is not possible:

But someone here thinks there is a workaround, that is ugly according to me, yet it might work.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
not able to recieve my own multicast message even after enabling loopback ik_nitk Programming 4 03-15-2006 05:01 AM
setting multicast broadcast address node047 Linux - Networking 0 04-05-2005 07:02 AM
eth0: UP BROADCAST MULTICAST but *not* RUNNING!... romasport Linux - Newbie 1 06-30-2004 11:48 AM
Up Broadcast Running Multicast code_noc Linux - General 2 10-16-2003 10:52 AM
Up Broadcast Notrailers Running Multicast snocked Linux - Networking 2 02-15-2003 10:27 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:55 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration