title: cURL with the real server IP while using CloudFlare
body: <p>Our partners have whitelisted our server IP so we can send them cURL requests with new client data but their CRM returns <code>Error: IP address of a connected platform is not allowed</code> probably because the headers contain a CloudFlare IP rather than the real IP of our server which we asked to whitelist.</p>
  
  <p>Is there a way to reveal our real server IP with a cURL request? </p>
  
  <pre><code>            $curl = curl_init();
              curl_setopt($curl, CURLOPT_URL, 'http://clients.domain.com/api');
  
              curl_setopt($curl, CURLOPT_POST, TRUE);
              curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
              curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
  
  
              $res = curl_exec($curl);
              return $res;
  </code></pre>
  
  <p>Tried this with no success:</p>
  
  <pre><code>    curl_setopt($curl, CURLOPT_HEADER, FALSE);
      curl_setopt($curl, CURLOPT_INTERFACE, '1.1.1.1');
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>curl_setopt($curl, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: 1.1.1.1, HTTP_X_FORWARDED_FOR: 1.1.1.1"));
  </code></pre>
  
  <p>EDIT: their logs show an IPv6 IP instead of the IPv4 server IP and it looks like this: <code>2a02:7aa0:1201::xxxx:xxxx</code>after some investigation it appears that this IPv6 IP is hosted by out hosting company and after whitelisting it everything started working.
  Any thoughts on why cURL send out some strange IPv6 instead of real server IPv4?</p>