title: Can see multicast packets with TCPdump/Wireshark but cannot receive it in application
body: <p>I have a Centos 7 server with 6 nics. I have two of them connected to different LANs -  ens20f3 (my home LAN) enp130s0f0 (for accessing a different network). I need to read multicast packets that are being received on enp130s0f0. If I do a <code>tcpdump -i enp130s0f0 -n</code> I can see multicast packets being received by the interface.</p>
  
  <p>But when I try to read packets in my test python application, I cannot read anything. I have checked that I join the correct group using <code>netstat -gn</code>. I have disabled rp_filter. I even tried putting the interface in promiscuous mode as suggested in one post. I have tested that my python application on a different machine and it is working fine. </p>
  
  <pre><code>MYPORT = 10872
  MYGROUP_4 = '239.50.50.72'
  
  import time
  import struct
  import socket
  import sys
  
  def main():
  group = MYGROUP_4
  # Look up multicast group address in name server and find out IP version
  addrinfo = socket.getaddrinfo(group, None)[0]`
  # Create a socket
  s = socket.socket(addrinfo[0], socket.SOCK_DGRAM)
  
  # Allow multiple copies of this program on one machine
  # (not strictly needed)
  s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  
  # Bind it to the port
  s.bind(('', MYPORT))
  
  group_bin = socket.inet_pton(addrinfo[0], addrinfo[4][0])
  # Join group
  if addrinfo[0] == socket.AF_INET: # IPv4
      mreq = group_bin + struct.pack('=I', socket.INADDR_ANY)
      s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
  else:
      mreq = group_bin + struct.pack('@I', 0)
      s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, mreq)
  
  # Loop, printing any data we receive
  while True:
      data, sender = s.recvfrom(1500)
      while data[-1:] == '\0': data = data[:-1] # Strip trailing \0's
      print (str(sender) + '  ' + repr(data))
  
  if __name__ == '__main__':
  main()
  </code></pre>
  
  <p>My routing table is as follows:</p>
  
  <pre><code>Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  0.0.0.0         10.230.47.129   0.0.0.0         UG    100    0        0 enp130s0f0
  10.230.47.128   0.0.0.0         255.255.255.128 U     100    0        0 enp130s0f0
  172.19.0.0      10.230.47.129   255.255.0.0     UG    100    0        0 enp130s0f0
  192.168.110.0   0.0.0.0         255.255.255.0   U     100    0        0 ens20f3
  </code></pre>
  
  <p>The tcp dump output looks like this:</p>
  
  <pre><code>17:30:24.444744 IP 172.19.250.28.56915 &gt; 239.100.39.25.10225: UDP, length 56
  </code></pre>
  
  <p>Hence the entries corresponding to <code>172.19.*.*</code></p>
  
  <p>Any pointers to what I can look for to fix this issue?</p>