I am trying to open a page using urllib2 but i keep getting connection timed out errors.
url = "http://" + "100.12.13.11/api.php"
f = urllib2.urlopen(url)
I have two static IPs: 100.12.13.12, LAN IP - 10.10.209.2, domain - test.com; and 100.12.13.11 , LAN IP - 10.10.209.1, domain - test2.com.
When I access
http://100.12.13.11/api.php
from the server at 100.12.13.12 using urllib2, it says connection timeout error.
Also if I use the domain, for example
http://test.com/api.php
the same thing happens but it works whenever I use the LAN IP
http://10.10.209.1/api.php
(both of the static IPs are in the same network)
The problem doesn't occur whenever I access from outside the network. But, in PHP, it works for domain name, static IP and LAN IP.
Does anyone know why this strange thing is happening?