[tech] IPv6 at increasing usage

David Adam zanchey at ucc.gu.uwa.edu.au
Thu Jul 15 20:59:34 WST 2010


On Fri, 4 Sep 2009, Daniel J. Axtens wrote:
> > We hand out IPv6 address to clients who will take them using RADVD on
> > Madako, on the clubroom, the wireless and the loft network. As far as I
> > know you don't get IPv6 on the VPN.
> 
> > 3. <your idea here>
> 
> Fix the VPN to hand out IPv6 addresses.

So, this works. Kind of. http://silmor.de/66 was my starting point.

Basically, if your PPTP client supports IPv6 (e.g. mpd5 on FreeBSD, 
Windows Vista or newer, pptpclient on Linux), the server will negotiate a 
link-local IPv6 address (fe80::$SOMEVAL) with your client.

Then /etc/ppp/ipv6-up.d/global-ipv6 runs, which is below. In short, we run 
a new instance of RADVD for each link, and hand the client out an address 
based on the pppX interface number.

This means you get a dynamic(ish) IP but which is globally routeable. You 
only get one; you cannot automatically route a subnet. This requires 
prefix delegation and DHCPv6, which is the next step, I guess.

I'd be keen to hear from people who have this working on platforms that 
aren't mpd5 or Linux's pptpclient - in particular, I can't make it work on 
NetworkManager yet.

Also, UCC's IPv6 uplink is currently down, so all you can do to make sure 
it works is ping6 mooneye.ipv6.ucc.asn.au. In the future, everything will 
work.

David Adam
UCC Wheel Member
zanchey at ucc.gu.uwa.edu.au

---8<---

# this is a giant hack and will potentially eat our address space
# our allocation is a /59 but we need to give clients a /64 for the link
# (because the PPP-RFC specifies that the generated or configured IPv6CP
# Interface-ID is 64 bits long. This forces the link-local setting to be
# /64. The only choice for auto-configuration of the global address is now
# /64 - otherwise you have to not use one at all or use DHCPv6 (which sucks)
# This is massively wasteful but "Best Practice".

# so we take the interface number (the 1 in ppp1)
IFACENUM=$(echo $PPP_IFACE | tr --delete --complement '[:digit:]')

# and bitwise-or that with A0, so that addresses will be > A0
PPP_PREFIX=`printf '%x' $((0xA0 | $IFACENUM))`
CLIENT_SUBNET='2001:388:7094:40'$PPP_PREFIX

#configure locally
ifconfig $IFNAME add $CLIENT_SUBNET::1/64

#generate radvd config
RAP=/etc/ppp/ipv6-radvd/$IFNAME
RA=$RAP.conf
echo interface $IFNAME >$RA
echo '{ AdvSendAdvert on; MinRtrAdvInterval 5; MaxRtrAdvInterval 100;' 
>>$RA
echo ' prefix' $CLIENT_SUBNET::/64 '{};' >>$RA
echo ' RDNSS 2001:388:7094:4080::9 {}; };' >>$RA

#start radvd
/usr/sbin/radvd -C $RA -p $RAP.pid

exit 0

---8<---


More information about the tech mailing list