Mobile app version of vmapp.org
Login or Join
RJPawlick198

: Curl to itself behind firewall 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

@RJPawlick198

Posted in: #Dns #Php

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @RJPawlick198

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

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


Switch the script to use the 127.0.0.1 if possible if you're running the script on the same machine.
Use the 172.x.x.x internal n/w IP, which is more likely to have set up routes.
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)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme