title: Cannot bind to external IP address of google compute engine VM instance
body: <p>I am trying to test a simple client-server setup between my laptop and my google compute engine instance using python.  The setup works fine between 2 laptops.  But when I run the server program in my VM instance I get the following error after calling the bind command: &quot;socket.error: [Errno 99] Cannot assign requested address&quot;</p>
  <p>I am trying to bind to the external IP address so I can receive data from an external device.</p>
  <p>Here is the code snippet</p>
  <pre><code>import socket
  
  s = socket.socket()
  
  port = 12345
  
  s.bind(('xxx.xxx.xxx.xxx',port))
  </code></pre>
  <p>Can anyone please tell me why I can't bind to the external IP address. I have tried to find the answer in Google's docs and via online searches but to no avail. I am new to this and don't really even know what info to post that would help in troubleshooting. Thanks in advance.</p>
  <p>Here are my firewall rules
  <a href="https://i.stack.imgur.com/rlmO7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rlmO7.png" alt="Firewall rules" /></a></p>