Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a server A which is configured behind a firewall and has 30.x.x.x public adress and 172.x.x.x internal address.

I'm trying to make a php Curl call from a script located on that server, to the 30.x.x.x external IP of that server but the curl call cannot be resolved.

It seems that server A does not have a route to that IP. Did you encounter any similar situations? Any chance to solve it through static routes?

share|improve this question

1 Answer 1

Not sure what your route table looks like, but you have a few options:

  1. Switch the script to use the 127.0.0.1 if possible if you're running the script on the same machine.

  2. Use the 172.x.x.x internal n/w IP, which is more likely to have set up routes.

  3. Try adding a default gateway to your router IP (172.x.x.254 as a total guess):

    route add default gw 172.x.x.254;

Your router is going to have to be able to send it out, but that will at least get it to the router.

The only situation you could still run into is if you have firewall settings that block you from going out on the net from that machine. Try pinging the same IP and see if you get a reply (or another port for another service running on that same machine - ICMP may be blocked on the incoming public side of web server for security reasons)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.