You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Christian Felsing <pu...@felsing.net> on 2008/08/06 08:46:16 UTC

[users@httpd] Problem: Reverse Proxy Should Use a Specific IP(v6) Address on an Multihomed Interface

Hello,

I created a specific configuration for a reverse proxy, which does some 
URL rewriting and accesses a remote server. This rproxy is a IPv6 to 
IPv4 gateway to allow IPv4 users accessing IPv6 only servers. IPv6 
interface has multiple IPv6 addresses:

1.) 2a01:dead:beef::2/128
2.) 2a01:dead:beef:2::2/124
3.) 2a01:dead:beef::f001/128

httpd is configured so it listens on 1) and 3) only, but it uses 3) as 
outgoing IPv6 address.

Is it possible to tell httpd to use 1) instead of 3) as source IP 
address if rproxy accesses an IPv6 host ?

This is my configuration of regarding vhost:

<VirtualHost 193.x.x.x:80>
   ServerName 4.xxx
   ServerAlias *.4.xxx
   DocumentRoot "/home/www/xxx"
   CustomLog /var/log/apache2/xxx/access_log combined
   ErrorLog /var/log/apache2/xxx/error_log

   RewriteEngine on

   RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
   RewriteRule .* - [F]

   ProxyVia Block

   RewriteCond   %{HTTP_HOST} ^(.+)\.4\.ip6\.li$
   RewriteMap    ip6-map      prg:/mytools/ip4to6gw.pl
   RewriteRule   ^(.+)        %{HTTP_HOST}$1          [C]
   RewriteRule   ^(.+)        http://${ip6-map:$1}    [P]

</VirtualHost>

Only problem is remote IPv6 server see address 2a01:dead:beef::f001 
instead of 2a01:dead:beef::2 which would be desired source IP address. 
Everything else works as expected.

best regards
Christian Felsing

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem: Reverse Proxy Should Use a Specific IP(v6) Address on an Multihomed Interface

Posted by Christian Felsing <pu...@felsing.net>.
This is not a routing issue. Ethernet interface has multiple IP 
addresses from same subnet, so it does not matter which source address 
is selected by application for routing. Some applications provides a 
config option to use a specific IP address if it opens an IP connection 
with SYN and further operations on that socket. Intention is that dest. 
host should see a specific IP address, so it can decide if request is 
done via that reverse proxy or from other application on that host.

httpd "Listen" directive tells httpd to listen on a specific IP address 
only. It does not tell httpd to use a specific IP address for outbound 
connections which are created in reverse proxy operation.

Further investigation showed that httpd uses on Linux last configured 
IP(v6) address on interface. If there are different networks it uses 
last configured address in matching network. This is from point of 
routing ok, but may interfere other intentions regarding e.g. reverse 
DNS. For better understanding a small ascii graphic:


client --> rproxy --> dest. host

if dest. host resolves IP by reverse DNS it should get the right name 
which depends on outbound IP address used by rproxy.

Christian

Krist van Besien schrieb:
> This is most likely an operating system issue. You have to tell your
> server to route packets for your IPv6 hosts over the 1) interface.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem: Reverse Proxy Should Use a Specific IP(v6) Address on an Multihomed Interface

Posted by Krist van Besien <kr...@gmail.com>.
On Wed, Aug 6, 2008 at 08:46, Christian Felsing <pu...@felsing.net> wrote:

> Is it possible to tell httpd to use 1) instead of 3) as source IP address if
> rproxy accesses an IPv6 host ?

This is most likely an operating system issue. You have to tell your
server to route packets for your IPv6 hosts over the 1) interface.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org