Selecting which IP address to use when connecting to a remote

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • scott.horne@gmail.com

    Selecting which IP address to use when connecting to a remote

    I have a machine with multiple IP addresses and I want to select the IP
    address used by my script when it connects to another location. Does
    any one know a way to select which IP address to use when creating a
    connection ?

  • bobzimuta

    #2
    Re: Selecting which IP address to use when connecting to a remote


    scott.horne@gma il.com wrote:
    I have a machine with multiple IP addresses and I want to select the IP
    address used by my script when it connects to another location. Does
    any one know a way to select which IP address to use when creating a
    connection ?
    AFAIK, you need to configure your webserver so that it will receive
    requests from particular ports/domains and direct to the appropriate ip
    address. The outgoing responses would then be using that ip address.
    This is in the realm of virtual hosts.

    Maybe there's an apache module you can use via apache_note() or
    virtual() to set the outgoing ip address?

    Comment

    • Scott

      #3
      Re: Selecting which IP address to use when connecting to a remote

      Thanks for your reply. I am sorry I should have been more specific.
      This is a command line script and has nothing to do with apache.


      bobzimuta wrote:
      scott.horne@gma il.com wrote:
      I have a machine with multiple IP addresses and I want to select the IP
      address used by my script when it connects to another location. Does
      any one know a way to select which IP address to use when creating a
      connection ?
      >
      AFAIK, you need to configure your webserver so that it will receive
      requests from particular ports/domains and direct to the appropriate ip
      address. The outgoing responses would then be using that ip address.
      This is in the realm of virtual hosts.
      >
      Maybe there's an apache module you can use via apache_note() or
      virtual() to set the outgoing ip address?

      Comment

      • Miguel Cruz

        #4
        Re: Selecting which IP address to use when connecting to a remote

        scott.horne@gma il.com wrote:
        I have a machine with multiple IP addresses and I want to select the IP
        address used by my script when it connects to another location. Does
        any one know a way to select which IP address to use when creating a
        connection ?
        The second option to socket_bind() is the source IP address you'd like
        to use.

        miguel
        --
        Photos from 40 countries on 5 continents: http://travel.u.nu
        Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
        Airports of the world: http://airport.u.nu

        Comment

        • Scott

          #5
          Re: Selecting which IP address to use when connecting to a remote

          Thanks Miguel thats exactly what I needed to know.





          Miguel Cruz wrote:
          scott.horne@gma il.com wrote:
          I have a machine with multiple IP addresses and I want to select the IP
          address used by my script when it connects to another location. Does
          any one know a way to select which IP address to use when creating a
          connection ?
          >
          The second option to socket_bind() is the source IP address you'd like
          to use.
          >
          miguel
          --
          Photos from 40 countries on 5 continents: http://travel.u.nu
          Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
          Airports of the world: http://airport.u.nu

          Comment

          Working...