title: Python UDP and TCP communication between VMware host and guest not working
body: <p>I am using VMWare workstation with a Windows 7 host and a Ubuntu guest. I am trying to have communication between the two with either UDP or TCP--have not had success with either. I have my VM set to Bridged networking mode which gives it its own IP address. I have the most basic TCP/UDP server and client code from any example site online which I've tested and works fine If I run both on the host machine. However, when I have either the client or the server on the VM, the communication does not go through. </p>
  
  <p>To try and figure out what's going on, I ran the UDP server on the host machine and ran Wireshark on the host with it filtered to UDP; then I tried sending a packet from the client on the guest, and in wireshark I can see the the packet is going through but the server just does not seem to want to receive it. Any ideas?</p>
  
  <p>UDP Server:</p>
  
  <pre><code>import socket
  import sys
  
  # Create a TCP/IP socket
  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  
  # Bind the socket to the port
  server_address = ('0.0.0.0', 10000)
  print &gt;&gt;sys.stderr, 'starting up on %s port %s' % server_address
  sock.bind(server_address)
  
  while True:
      print &gt;&gt;sys.stderr, '\nwaiting to receive message'
      data, address = sock.recvfrom(4096)
  
      print &gt;&gt;sys.stderr, 'received %s bytes from %s' % (len(data), address)
      print &gt;&gt;sys.stderr, data
  
      if data:
          sent = sock.sendto(data, address)
          print &gt;&gt;sys.stderr, 'sent %s bytes back to %s' % (sent, address)
  </code></pre>
  
  <p>UDP Client:</p>
  
  <pre><code>import socket
  import sys
  
  # Create a UDP socket
  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  
  server_address = ('192.168.100.38', 10000)
  message = 'This is the message.  It will be repeated.'
  
  try:
  
      # Send data
      print &gt;&gt;sys.stderr, 'sending "%s"' % message
      sent = sock.sendto(message, server_address)
  
      # Receive response
      print &gt;&gt;sys.stderr, 'waiting to receive'
      data, server = sock.recvfrom(4096)
      print &gt;&gt;sys.stderr, 'received "%s"' % data
  
  finally:
      print &gt;&gt;sys.stderr, 'closing socket'
      sock.close()
  </code></pre>
  
  <p>In wireshark I can see the packet that is sent from the VM client:</p>
  
  <p>Src=192.168.100.42 Dst=192.168.100.38 Proto=UDP</p>