Skip to content

Instantly share code, notes, and snippets.

@makotom
Created February 12, 2013 13:03
Show Gist options
  • Save makotom/4762719 to your computer and use it in GitHub Desktop.
Save makotom/4762719 to your computer and use it in GitHub Desktop.
Helper script to launch v6 over v4 and radvd sequentially
#!/bin/bash
ETH="p1p1"
NET6SCRPATH="/usr/local/bin/iij-ipv6-up"
$NET6SCRPATH
NET6PREFIX=$(ip -6 addr show dev ppp128 scope global | grep inet6 | sed -e s/^\ \*inet6\ //g -e s/\ .\*\$//g -e s/\\\(:[0-9a-f]*\\\)\\{4\\}\\/64//g)"::/64"
sysctl net.ipv6.conf.all.forwarding=1
echo "interface $ETH
{
AdvSendAdvert on;
MinRtrAdvInterval 30;
MaxRtrAdvInterval 100;
prefix $NET6PREFIX {};
RDNSS 2001:240::13 2001:240::14 {};
};" > /etc/radvd.conf
killall radvd
radvd
route --inet6 add $NET6PREFIX $ETH
route --inet6 add default ppp128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment