Is there a way to increase the limit of 20 multicast groups that you can join on a given socket? Is there some system setting that I am missing or is there some hard limit which cannot be exceeded?


Well, incase someone is searching for this, the following parameter exists:


Currently my install says 20, in the sources, I also see:

bits/in.h:#define IP_MAX_MEMBERSHIPS              20

I think bumping up the system parameter may be enough, else will have to patch the header as well!

EDIT: looks like bumping up the system parameter does the trick.

| improve this answer | |

From Fernando Garcia over on rti:

Modify net.ipv4.igmp_max_memberships in /etc/sysctl.conf.

You can reload the configuration file by using sysctl -p or by rebooting your system.

In my case, the line didn't exist, so I had to append it. Here's an example with a new limit of 75:

net.ipv4.igmp_max_memberships = 75

Note that this differs from the answer by @Nim in that it makes the change permanent, whereas changing the value in /proc/sys/net/ipv4/max_igmp_memberships will only change the value for the current session, until log out.

| improve this answer | |
  • Please do not post comments to an answer as an answer in its own right. Once you have sufficient reputation, you will be able to comment on any post. – AdminBee Feb 5 at 14:28
  • I figured it held as its own answer, since it is a different method of achieving the sets the max memberships. It sets it permanently, whereas the first answer sets it only until the next boot. Do you disagree? The first sentence does make it sound like a comment, I agree with that. Should I remove it? – PhilippeAtM Feb 5 at 14:53
  • 2
    I think you are right, but would recommend rephrasing the first sentence to avoid giving the impression of a "comment as answer" post. Thank you for taking the time to consider the issue. – AdminBee Feb 5 at 15:08
  • Please rephrase the text as a self-contained answer. Users have already flagged it as "not an answer". – Kusalananda Feb 5 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.