Raspberry Pi: Disable Multicast and enforce IGMP - msandholz/RaspberryPi-Tutorials GitHub Wiki

Disable Multicast

Diese Konfiguration behebt die Störungen die in der Konstellation MagentaTV-Receiver, Sunny-HomeManager und Raspberry PI auftreten:

Step 1: Drop all inbound traffic from Sunny-HomeManager: sudo iptables -I INPUT -s 192.168.178.25 -j DROP

Step 2: Drop all inbound mDNS Multicast-traffic: sudo iptables -I INPUT -s 224.0.0.1 -j DROP

Step 3: Drop all outbound Multicast-traffic:

```
sudo iptables -I OUTPUT -d 224.0.0.1 -j DROP
sudo iptables -I OUTPUT -d 224.0.0.22 -j DROP
sudo iptables -I OUTPUT -d 224.0.0.251 -j DROP
sudo iptables -I OUTPUT -d 239.255.255.250 -j DROP
```

Step 4: Check network-traffic with TCPDump: sudo tcpdump -i wlan0 -n igmp

Enforce IGMP-Version

Step 1: Check IGMP-Version cat /proc/sys/net/ipv4/conf/eth0/force_igmp_version

Step 2: Switch to IGMPv3 on eth0 enter echo "3" > /proc/sys/net/ipv4/conf/eth0/force_igmp_version

```
force_igmp_version - INTEGER
0 - (default) No enforcement of a IGMP version, IGMPv1/v2 fallback allowed. 
    Will back to IGMPv3 mode again if all IGMPv1/v2 Querier Present timer expires.    
1 - Enforce to use IGMP version 1. Will also reply IGMPv1 report if receive 
    IGMPv2/v3 query.
2 - Enforce to use IGMP version 2. Will fallback to IGMPv1 if receive IGMPv1 
    query message. Will reply report if receive IGMPv3 query.
3 - Enforce to use IGMP version 3. The same react with default 0.

Note: this is not the same with force_mld_version because IGMPv3 RFC3376 Security 
Considerations does not have clear description that we could ignore other version 
messages completely as MLDv2 RFC3810. So make this value as default 0 is recommended.
```

Step 3: To make the above settings permanent

  • edit file /etc/sysctl.conf

  • add the following lines if not already present.

    net.ipv4.igmp_max_msf = 40
    net.ipv4.conf.eth0.force_igmp_version = 3
    
  • then run sysctl to reread the configuration immediately: sysctl -p