Wireshark sees the udp packet but my application doesn't
I'm using this python example to test a connection using broadcast udp packets. For some strange reason I can see the packets coming in on my RHEL server through wireshark (not in promiscuous mode), though the python recv doesn't get them. Sending the packets on the same computer to 'localhost' does work. Also, using a different pair of computers, my code does work. So I have this specific RHEL computer that's problematic.
I've tried binding on 127.0.0.1, 0.0.0.0, 255.255.255.255 to no avail. I turned off SELinux, the RHEL firewall, iptables and ip6tables. I checked netstat and see my python script is the only one listening on that udp port. In thor's name what's wrong?
Got it! This is the command that fixed the problem:
ifconfig eth2 -broadcast 30.255.255.255
The original Bcast address was 30.0.0.255 and I was broadcasting to 30.255.255.255, so while wireshark saw this as a relevant Bcast (not promiscuous), the OS did not.
精彩评论