Pascal Hambourg wrote:
> Allen Kistler a écrit :
>> For example, http://www.ntp.org.
>>
>> NTP.org has a perfectly good IPv4 site, but the IPv6 site doesn't
>> answer to SYNs.
>
> Weird. I can browse it through IPv6, and get answers to my IPv6 SYNs :
>
> $ nmap -6 -p 22,25,80,110 www.ntp.org
>
> Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2009-06-19 20:50
> CEST
> Interesting ports on ntp2.ntp.isc.org (2001:4f8:0:2::23):
> PORT STATE SERVICE
> 22/tcp filtered ssh
> 25/tcp open smtp
> 80/tcp open http
> 110/tcp filtered pop3
For me, I need -P0 because it won't even ping:
# nmap -6 -p 22,25,80,110 -P0
www.ntp.org
Starting Nmap 4.11 (
http://www.insecure.org/nmap/ ) at 2009-06-20 00:15 CDT
Interesting ports on ntp2.ntp.isc.org (2001:4f8:0:2::23):
PORT STATE SERVICE
22/tcp filtered ssh
25/tcp filtered smtp
80/tcp filtered http
110/tcp filtered pop3
Compare to
www.kame.net:
# nmap -6 -p 22,25,80,110
www.kame.net
Starting Nmap 4.11 (
http://www.insecure.org/nmap/ ) at 2009-06-20 00:19 CDT
Interesting ports on orange.kame.net (2001:200:0:8002:203:47ff:fea5:3085):
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
110/tcp open pop3
> "filtered" here means that it (actually the firewall/router just before
> it) replies with an ICMPv6 "communication prohibited".
"filtered" means the packet is dropped.
"closed" is what you get when there's an ICMP error response.
>> Since RFC-compliant behavior is to try the IPv6 address first, I have
>> to timeout on every page element before switching to IPv4.
>>
>> I was wondering what the options are to deal with the situation. I
>> don't have control of the ntp.org DNS domain (or any other broken
>> domains I might find). Keeping a list in iptables for special
>> behaviors for specific IPv6 addresses really isn't attractive.
>
> RFC 3484 describes an address selection mechanism for IPv6. It is
> implemented in recent versions (don't ask me numbers) of the glibc
> through /etc/gai.conf (GetAddressInfo configuration file). By default
> the IPv4 address space (in its IPv6 mapped form of ::ffff:0:0/96) has
> the lowest precedence. You could increase its precedence above the
> precedence of other IPv6 prefixes so IPv4 addresses are sorted first.
gai.conf is good info. There's even a man page on it, although the
distinction between label and precedence is lost on me. It says if any
label directive is present, the default table is not used. Then it says
precedence is different from label, because if any precedence directive
is present, the default table is not used. So ... it's different
because it's the same? Whatever.
Closer to what I was asking, though, would be to put
2001:4f8:0:2::23/128 in gai.conf and to give it a really low precedence.
That way I'm not turning IPv6 into IPv4 for everything.
I put
www.ntp.org's IPv6 address as the lowest precedence ...
label ::1/128 0
label ::/0 1
label 2002::/16 2
label ::/96 3
label ::ffff:0:0/96 4
label 2001:4f8:0:2::23/128 5
precendence ::1/128 60
precendence ::/0 50
precendence 2002::/16 40
precendence ::/96 30
precendence ::ffff:0:0/96 20
precendence 2001:4f8:0:2::23/128 10
.... but it didn't seem to work. tcpdump reports I'm still trying to
contact the IPv6 address. I also tried putting ::ffff:0:0/96 as the
highest precedence (temporarily). That didn't work, either. Reboot
doesn't help. I didn't expect reboot to help, anyway.
If it worked, this is exactly the kind of thing I wanted. Maybe I just
need to beat on it some more.