Apache mod_proxy and how to force outgoing over specific interface

Discussion in 'Apache' started by Halfwalker, Jan 26, 2008.

  1. #1
    Double question here ... Running on Debian Etch and Apache 2.0

    I'm not sure whether to try to get this working using reverse-proxy with mod_proxy, or perhaps some configuration using normal forward proxying. Perhaps even squid ?

    The requirement is to provide a simple initial main page that would allow the client to select a local interface from a drop-down list and enter a URL into an input field. Apache would then fetch the URL using the specified interface (eth0:1 at 1.1.1.1, eth0:2 at 2.2.2.1, eth0:3 at 3.3.3.1 and so on). This is the test how the remote site handle queries from specific source addresses.

    So it's kind of like a normal forward proxy, except we don't want to have to configure the client browser to use a proxy.

    1) Using mod_proxy and/or mod_proxy_http in apache 2.0.

    The basics of using mod_proxy are pretty simple so long as you're using a static config. I'm trying to figure out how to do it dynamically - that is, allow the entry of a url via a form and proxy THAT url ...

    
    ProxyPass        /foo http://foo.example.com/bar
    ProxyPassReverse /foo http://foo.example.com/bar
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
                          This needs to be entered via form
    
    Code (markup):
    This would be a simple page that has a drop-down list to select the outgoing interface (see part 2) and box to enter a url. Clicking the button would fetch the url using the selected interface.

    2) Force a mod_proxy outgoing connection to use a specific local interface (eth0:1, eth0:2 and so on) each with its own IP address/network.

    3) Perhaps use a small perl/php script to call wget to fetch the remote URL. Wget can specify the local interface to use for the fetch.

    What's the best way to attack something like this ?

    Thanks -

    D.
     
    Halfwalker, Jan 26, 2008 IP