I can confirm that:
1. 6rd support on a static IP address works fine if you get the settings all correct.
2. 6rd support with dynamic IP addressing can be fully implemented within a Mikrotik script.
This is an incomplete yet functional script to configure a 6rd tunnel up on the Australian ISP iiNet. It assumes you already have the 6in4 tunnel IPv6 address with a comment of "6rd" (to identify the one that needs to be updated). It will only work with an IPv4 Mask Length of 0 but could be adapted for other mask lengths.
The tricky part of this is to convert the IPv4 address into a hexadecimal IPv6 pair. In Mikrotik scripting this can only be done at the end of an IPv6 address (e.g. 1::192.168.0.1 will translate correctly), however with 6rd this translation of the public IP address to the hexadecimal pair needs to be before then (for iiNet the prefix is 2001:4479, so your IPv6 address is 2001:4479:aabb:ccdd::/64 (where your IPv4 public IP address is translated into the hex pairs aa, bb, cc, and dd).
My script is adapted from the following script which is for the Tomato USB Toastman which was posted in the iiNet IPv6 forums (credited to zujik):
WANIP=$(nvram get wan_ipaddr)
if [ -n "$WANIP" ]; then
ip tunnel del tun6rd
V6PREFIX=$(printf '2001:4479:%02x%02x:%02x%02x' $(echo $WANIP | tr . ' '))
ip tunnel add tun6rd mode sit local $WANIP ttl 64
ip addr add ${V6PREFIX}::1/32 dev tun6rd
ip addr add ${V6PREFIX}::1/64 dev br0
ip link set tun6rd up
ip -6 route add ::/0 via ::203.0.178.66 dev tun6rd
service radvd restart
fi
Note: Most of the above script is not included in the below Mikrotik script. My main goal is to include the 'set IP address' part which is needed when the dynamic publiic IP address changes. There is no code to detect the IP address change yet.
So finally, here is the Mikrotik script.
:local waninterface "pppoe-iinet"
:local ipv6prefix "2001:4479:"
:local ipv6suffix "::"
:local ipv6interface "sit1"
:local addrcomment "6rd"
:local IPv4addr [/ip address get [find interface=$waninterface] address];
:local IPv4addr [:pick $IPv4addr 0 [:find $IPv4addr "/"]]
:put "IPv4 Address $IPv4addr";
:local IPv6temp [:toip6 ("1::" . $IPv4addr)]
:if ($IPv6temp="") do={
:error "IPv6 temporary address error"
}
:put "IPv6 Temp $IPv6temp"
:local IPv4hex [:pick $IPv6temp 3 15]
:put "IPv4 Hex $IPv4hex"
:local IPv6addr [($ipv6prefix . $IPv4hex . $ipv6suffix)]
:put "IPv6 6rd Address $IPv6addr"
:local IPv6addrnumber [/ipv6 address find where comment=$addrcomment]
:if ($IPv6addrnumber="") do={
:error "IPv6 Address Number error"
}
:put "IPv6 address number $IPv6addrnumber"
:put "Updating $IPv6addrnumber to $IPv6addr"
:put ("Old address: " . [/ipv6 address get $IPv6addrnumber address])
/ipv6 address set number=$IPv6addrnumber address=$IPv6addr
:put ("New address: " . [/ipv6 address get $IPv6addrnumber address])