3

I have a (Webserver)Server with two network interfaces. The first is the standard interface with the public internet connection, the other is a virtual VPN-networkinterface.

Now I want to send POST data via curl on an other Webservice within the VPN-Network.

How I can say the php there have to call the address with the VPN-Networkinterface?

Denis
  • 439
  • 4
  • 17
  • Possible duplicate of [select outgoing ip for curl request](http://stackoverflow.com/questions/2425651/select-outgoing-ip-for-curl-request) – Scuzzy May 03 '17 at 23:23
  • contact your VPN provider, they are more likely to help you (it depends on the interface you are using) – Kr1 Nov 07 '18 at 20:15

1 Answers1

5

The documentation lists CURLOPT_INTERFACE as a configurable option.

CURLOPT_INTERFACE The name of the outgoing network interface to use. This can be an interface name, an IP address or a host name.

curl_setopt($ch, CURLOPT_INTERFACE, "XXX.XXX.XXX.XXX");
Scuzzy
  • 12,186
  • 1
  • 46
  • 46