Hi,

I was wondering if anyone could help.
I've got a linux server with virtual hosts set up with separate ips and domain names.
Everything works fine for incoming requests, but when I send an outgoing call (using curl php but am willing to change if necessary) the ip address received by the target is the server's primary ip address.
I need it to show that it's from the ip address that has been set to the virtual host where the php page is located.
Any help would be appreciated.

Thanks,
Lee

Hello Lee,

If you are trying to get the Webpage from interface "eth1" the your command should be

curl -j --interface eth1 google.com

This will allow you to use make the Curl/Wget from the interface "eth1" instead of default inetface "eth0"..

In case if you are trying to get the Webpage from a Virtual interface say "eth2:1" the your command should be

curl -j --interface eth2:1 google.com

Let me know if you still find difficulty,

Regards,

Sheltan T T

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.