rgeissert / http-redirector

Debian mirrors HTTP redirector
http://httpredir.debian.org/
88 stars 8 forks source link

httpredir.debian.org returns IPv4 only domains for an IPv6 only machine #62

Open x539 opened 9 years ago

x539 commented 9 years ago
apt-get update
...
Err http://httpredir.debian.org jessie Release.gpg
  Could not resolve 'ftp.rrzn.uni-hannover.de'

With ftp.rrzn.uni-hannover.de having no IPv6 address as host -6 ftp.rrzn.uni-hannover.de 2001:4860:4860::8888 shows.

romanrm commented 9 years ago

What is your output of:

host httpredir.debian.org

Seems to work fine for me:

$ host httpredir.debian.org httpredir.debian.org has address 176.9.184.93 httpredir.debian.org has address 5.153.231.35 httpredir.debian.org has address 128.31.0.66 httpredir.debian.org has IPv6 address 2001:41c8:1000:21::21:35 httpredir.debian.org has IPv6 address 2a01:4f8:151:555d::42 httpredir.debian.org mail is handled by 0 .

x539 commented 9 years ago

I have the same IPs, different (random) order

$ host httpredir.debian.org httpredir.debian.org has address 5.153.231.35 httpredir.debian.org has address 128.31.0.66 httpredir.debian.org has address 176.9.184.93 httpredir.debian.org has IPv6 address 2001:41c8:1000:21::21:35 httpredir.debian.org has IPv6 address 2a01:4f8:151:555d::42 httpredir.debian.org mail is handled by 0 .

The problem is random, too. But I tested both IPv6 address explicitly by using /etc/hosts. And for now I had no problems with this:

2a01:4f8:151:555d::42 httpredir.debian.org

but with this I had:

2001:41c8:1000:21::21:35 httpredir.debian.org
romanrm commented 9 years ago

Still seems to work fine:

curl -vg6 -HHost:httpredir.debian.org [2001:41c8:1000:21::21:35]

x539 commented 9 years ago

Well, http://httpredir.debian.org/ is not redirecting anyway. But see this:

$ curl -vg6 -HHost:httpredir.debian.org http://[2001:41c8:1000:21::21:35]/debian/dists/jessie/main/binary-amd64/Packages.gz

*   Trying 2001:41c8:1000:21::21:35...
* Connected to 2001:41c8:1000:21::21:35 (2001:41c8:1000:21::21:35) port 80 (#0)
GET /debian/dists/jessie/main/binary-amd64/Packages.gz HTTP/1.1
User-Agent: curl/7.40.0
Accept: */*
Host:httpredir.debian.org

< HTTP/1.1 302 Found
< Date: Fri, 31 Jul 2015 17:37:15 GMT
< Location: http://ftp.rrzn.uni-hannover.de/debian/debian/dists/jessie/main/binary-amd64/Packages.gz
< Content-Type: text/plain
< X-Clacks-Overhead: GNU Terry Pratchett
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< 
* Connection #0 to host 2001:41c8:1000:21::21:35 left intact

With ftp.rrzn.uni-hannover.de not being IPv6 reachable.

$ curl -vg6 -HHost:httpredir.debian.org http://[2a01:4f8:151:555d::42]/debian/dists/jessie/main/binary-amd64/Packages.gz

*   Trying 2a01:4f8:151:555d::42...
* Connected to 2a01:4f8:151:555d::42 (2a01:4f8:151:555d::42) port 80 (#0)
GET /debian/dists/jessie/main/binary-amd64/Packages.gz HTTP/1.1
User-Agent: curl/7.40.0
Accept: */*
Host:httpredir.debian.org

< HTTP/1.1 302 Found
< Date: Fri, 31 Jul 2015 17:42:14 GMT
< Location: http://debian.morphium.info/debian/dists/jessie/main/binary-amd64/Packages.gz
< Content-Type: text/plain
< Link: <http://debian.morphium.info/debian/dists/jessie/main/binary-amd64/Packages.gz>; rel=duplicate; pri=1; depth=1, <http://debian.mirror.lrz.de/debian/dists/jessie/main/binary-amd64/Packages.gz>; rel=duplicate; pri=1; depth=1, <http://mirror.de.leaseweb.net/debian/dists/jessie/main/binary-amd64/Packages.gz>; rel=duplicate; pri=1; depth=1
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< 
* Connection #0 to host 2a01:4f8:151:555d::42 left intact

However debian.morphium.info is IPv6 reachable.

rgeissert commented 9 years ago

What was the IP address that was used to connect to the redirector? The only way for it to redirect you to an ipv4-only mirror when you made the request over v6 is if you used an ipv6 over ipv4 tunnel of some kind.

x539 commented 9 years ago

Yes, it is a 2002::/16 (6to4) address.

rgeissert commented 9 years ago

Apologies for getting back until now. So how come you are doing 6to4 but are not able to establish a route to an ipv4 host? The redirector considers connections from teredo and 6to4 addresses to be due to a communication error and explicitly looks for an ipv4 mirror for those clients.

x539 commented 9 years ago

It was a test to build an IPv6-auto-configure only Network. With the internet Gateway doing the 6to4.