Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache mod_proxy and how to force outgoing over specific internface

Status
Not open for further replies.

Halfwalker

Programmer
Jan 26, 2008
1
US
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 ...

Code:
ProxyPass        /foo [URL unfurl="true"]http://foo.example.com/bar[/URL]
ProxyPassReverse /foo [URL unfurl="true"]http://foo.example.com/bar[/URL]
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      This needs to be entered via form

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top