IP Dual-Stack IPv4 bevorzugen

So gehts,

die Datei /etc/gai.conf steuert die Priorisierung von getaddrinfo. Auf OpenWRT exisitiert diese Datei nicht und muss angelegt werden.

Entfernt man das Kommentarzeichen vor precedence ::ffff:0:0/96 100 wird IPv4 bevorzugt. ::ffff:0:0/96 ist der Adressraum der IPv4 Adressen im IPv6 Format. Testen kann man das ganze beim IPv6 Test von KabelBW.
Hier die Debian /etc/gai.conf

# Configuration for getaddrinfo(3).
#
# So far only configuration for the destination address sorting is needed.
# RFC 3484 governs the sorting.  But the RFC also says that system
# administrators should be able to overwrite the defaults.  This can be
# achieved here.
#
# All lines have an initial identifier specifying the option followed by
# up to two values.  Information specified in this file replaces the
# default information.  Complete absence of data of one kind causes the
# appropriate default information to be used.  The supported commands include:
#
# reload  <yes|no>
#    If set to yes, each getaddrinfo(3) call will check whether this file
#    changed and if necessary reload.  This option should not really be
#    used.  There are possible runtime problems.  The default is no.
#
# label   <mask>   <value>
#    Add another rule to the RFC 3484 label table.  See section 2.1 in
#    RFC 3484.  The default is:
#
#label ::1/128       0
#label ::/0          1
#label 2002::/16     2
#label ::/96         3
#label ::ffff:0:0/96 4
#label fec0::/10     5
#label fc00::/7      6
#label 2001:0::/32   7
#
#    This default differs from the tables given in RFC 3484 by handling
#    (now obsolete) site-local IPv6 addresses and Unique Local Addresses.
#    The reason for this difference is that these addresses are never
#    NATed while IPv4 site-local addresses most probably are.  Given
#    the precedence of IPv6 over IPv4 (see below) on machines having only
#    site-local IPv4 and IPv6 addresses a lookup for a global address would
#    see the IPv6 be preferred.  The result is a long delay because the
#    site-local IPv6 addresses cannot be used while the IPv4 address is
#    (at least for the foreseeable future) NATed.  We also treat Teredo
#    tunnels special.
#
# precedence  <mask>   <value>
#    Add another rule to the RFC 3484 precedence table.  See section 2.1
#    and 10.3 in RFC 3484.  The default is:
#
#precedence  ::1/128       50
#precedence  ::/0          40
#precedence  2002::/16     30
#precedence ::/96          20
#precedence ::ffff:0:0/96  10
#
#    For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96  100
 
#
# scopev4  <mask>  <value>
#    Add another rule to the RFC 6724 scope table for IPv4 addresses.
#    By default the scope IDs described in section 3.2 in RFC 6724 are
#    used.  Changing these defaults should hardly ever be necessary.
#    The defaults are equivalent to:
#
#scopev4 ::ffff:169.254.0.0/112  2
#scopev4 ::ffff:127.0.0.0/104    2
#scopev4 ::ffff:0.0.0.0/96       14

IPv6 bei sourceforge.net

Nur wenige Mirror von sourceforge.net unterstützen derzeit IPv6. Wer also einen nativen IPv6 Zugang hat, dürfte schnell aufgeschmissen sein.

Der netcologne Mirror unterstützt IPv6.

wget -6 http://netcologne.dl.sourceforge.net/project/*Projektname*/*Titel*/*Verzeichnis*/Dateiname-1.0.0.tar.gz

IPv6 über DHCP an KVM Gäste verteilen

It’s magic.

# cat /etc/network/interfaces
### Hetzner Online AG - installimage
# Loopback device:
auto lo
iface lo inet loopback
 
# device: eth0
auto  eth0
iface eth0 inet static
  address   XXX.XXX.XXX.131
  broadcast XXX.XXX.XXX.191
  netmask   255.255.255.192
  gateway   XXX.XXX.XXX.129
  # default route to access subnet
  up route add -net XXX.XX.XXX.128 netmask 255.255.255.192 gw XXX.XXX.XXX.129 eth0
 
iface eth0 inet6 static
  address 2a01:AAA:AAA:AAA::1
  netmask 128
  gateway fe80::1
# Enable forwarding
    pre-up echo 1 > /proc/sys/net/ipv6/conf/default/forwarding
    pre-up echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
# But disable forwarding on THIS interface so we still get RAs
    pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/forwarding
    pre-up echo 1 > /proc/sys/net/ipv6/conf/eth0/accept_ra
    pre-up echo 1 > /proc/sys/net/ipv6/conf/all/accept_ra
    pre-up echo 1 > /proc/sys/net/ipv6/conf/default/accept_ra
 
auto br0
iface br0 inet6 static
  pre-up brctl addbr br0
  post-down brctl delbr br0
  bridge_stp off
  address 2a01:AAA:AAA:AAA::1
  netmask 64

Die pre-up echo’s sind ein workaround, da nur entweder accept_ra ODER forwarding funktioniert. Genaueres findet man hier.

Als DHCP habe ich den wide-dhcp6-server genommen.

#cat /etc/wide-dhcpv6/dhcp6s.conf
option domain-name-servers 2a01:4f8:0:a0a1::add:1010;
option domain-name-servers 2a01:4f8:0:a111::add:9898;
option domain-name-servers 2a01:4f8:0:a102::add:9999;
 
interface br0 {
        address-pool pool1 3600;
};
 
pool pool1 {
        range 2a01:AAA:AAA:AAAA::0000 to 2a01:AAA:AAA:AAAA::ffff;
};

Damit die auto_ra funktioniert, setzte ich radvd ein, mit dieser Konfig:

interface br0
{
        AdvManagedFlag on;
        MinRtrAdvInterval 3;
        MaxRtrAdvInterval 10;
        AdvSendAdvert on;
 
  prefix 2a01:AAA:AAA:AAA::/64
  {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr on;
  };
};

Bei der Umsetzung hat mir dieser Wiki Eintrag bei Hetzner geholfen.