title: Python 2.7 [Errno 113] No route to host
body: <p>I have 2 computers on the same LAN. The first PC has an ip address 192.168.178.30, the other PC has an ip address 192.168.178.26.
  Ping, traceroute, telnet, ssh, everything works between the two PCs. Both PCs run the same OS - CentOS 7 and both PCs have the same python version 2.7.5 (checked with the python -V command).</p>
  
  <p>I copied simple python code from a computer networking book. </p>
  
  <p>client.py</p>
  
  <pre><code>from socket import *
  serverName = '192.168.178.30'
  serverPort = 12000
  clientSocket = socket(AF_INET, SOCK_STREAM)
  clientSocket.connect((serverName,serverPort))
  sentence = raw_input('Input lowercase sentence: ')
  clientSocket.send(sentence)
  modifiedSentence = clientSocket.recv(1024)
  print 'From Server:', modifiedSentence
  clientSocket.close()
  </code></pre>
  
  <p>server.py</p>
  
  <pre><code>from socket import *
  serverPort = 12000
  serverSocket = socket(AF_INET,SOCK_STREAM)
  serverSocket.bind(('192.168.178.30',serverPort))
  serverSocket.listen(5)
  print 'The server is ready to receive'
  while 1:
         connectionSocket, addr = serverSocket.accept()
         sentence = connectionSocket.recv(1024)
         capitalizedSentence = sentence.upper()
         connectionSocket.send(capitalizedSentence)
         connectionSocket.close()
  </code></pre>
  
  <p>The code works when it is ran on the same PC (where the server is listening on localhost).
  When I run the client code on one PC and the server code on the other PC I get this error on the client side.</p>
  
  <pre><code>Traceback (most recent call last):
    File "client.py", line 5, in &lt;module&gt;
      clientSocket.connect((serverName,serverPort))
    File "/usr/lib64/python2.7/socket.py", line 224, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 113] No route to host
  </code></pre>
  
  <p>Can someone help?</p>