Installing Debian via IPv6

Fri 05 August 2016 by someone

Plroblem is that Debian preseed doesn''t allow you to bring multiple interfaces up. While in some cases you just don''t know which interface has link and which one of them has IPv6 reachability. Onece provisioned IPv6 node can be moved to anower subnet without any reconfiguration. "Solution" is to bypass standard Debian network configuration binary by replacing it. mv netcfg netcfg.orig Create netcfg file as below:

#!/bin/sh

#all interfaces UP
/bin/sh -c 'for IF in `ip -o link show | cut -d":" -f2`; do ip link set $IF up ; done'

echo 'nameserver 2001:4860:4860::8844' > /etc/resolv.conf
echo 'nameserver 2620:0:ccd::2' >> /etc/resolv.conf

echo "*********************************************" 
echo " PLEASE WAIT , DETECTING NET interfaces "

j=0
while [ $i -lt 900 ]
do
   ping6 -c4 2620:0:ccd::2
   if [ $? -eq 0 ] ; then 
    echo "Interface is up!"
    break ;
   fi
done

exit 0

chmod 555 netcfg

Basicaly we just bring all interfaces up and wait util any of them get IPv6 and we will be able to receive ping response from the public IPv6 DNS server.

Also we have to configure ./etc/network/interfaces to include all interfaces like that:

# The loopback network interface
auto lo
iface lo inet loopback
    up /bin/sh -c 'for IF in `ip -o link show | cut -d":" -f2`; do ip link set $IF up ; done'

Debian installer will copy it as-is to the newly installed system. Make sure you have IPv6 reachable Debian mirror in your preesed.cfg.