I have a VPS that has 2 IP addresses on virtual interfaces. Here is the config:
root@vps [~]# ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:571976 errors:0 dropped:0 overruns:0 frame:0
TX packets:571976 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:172900062 (164.8 MiB) TX bytes:172900062 (164.8 MiB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:407339 errors:0 dropped:0 overruns:0 frame:0
TX packets:404999 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:170561404 (162.6 MiB) TX bytes:96416084 (91.9 MiB)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:1.2.3.1 P-t-P:1.2.3.1 Bcast:1.2.3.1 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
venet0:1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:1.2.3.2 P-t-P:1.2.3.2 Bcast:1.2.3.2 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
Right now I have a website setup using (WHM/Cpanel) on the 1.2.3.2 address. The problem is whenever I initiate a connection from the web server (PHP curl script for example) it is always sourced from the 1.2.3.1 address. I have called and talked to the support for my VPS and they say this is impossible and I need to move the site to the other address. For reasons that are not important here I would like to avoid doing that. Is there any way to get the venet0:1 interface to be the default interface for outgoing connections?
EDIT:
Here is the routing table:
root@vps [~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
191.255.255.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 venet0
0.0.0.0 191.255.255.1 0.0.0.0 UG 0 0 0 venet0