The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Choose outgoing IP address

Discussion in 'General Discussion' started by legalbrr, Mar 3, 2010.

  1. legalbrr

    legalbrr Member

    Joined:
    Nov 1, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    [Solved] Choose outgoing IP address

    Hello everybody,

    In my VPS, I have 5 IP addresses.

    cPanel allows me to distribute them to some accounts that require a dedicated IP address, but how do I use these IPs on OUTGOING requests?

    - PHP allows me to connect to other servers (curl, sockets, fopen, etc..)
    - EXIM allows me to connect to other mail servers

    Unfortunally, all of them uses only the primary IP addresses, and I don't know how to change or customize it!

    I mean, when I try file_get_contents("http://www.whatismyip.com/"), always the main IP is returned.

    How would I "choose" the IP that makes that request?
    Is it possible to change it for each user? (Ex: users 'a' and 'b' uses x.x.x.1, users 'b' and 'c' uses 'x.x.x.2', etc..)?

    What I really want:
    user 'a': php fetchMyIp.php --> Result: x.x.x.1
    user 'c': php fetchMyIp.php --> Result: x.x.x.2
    exim: --> x.x.x.3

    What I would love to hear: "use php function change_my_ip() before any requests" (yeah, I know its just a dream.. isn't it?)

    Ps: cPanel 11.25, Apache2, PHP 5.3, using SUEXEC and FCGI.
     
    #1 legalbrr, Mar 3, 2010
    Last edited: Mar 3, 2010
  2. legalbrr

    legalbrr Member

    Joined:
    Nov 1, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1

Share This Page