Time to another part of the ipv6 story. We already have ipv6 subnet sharing linux-6to4-mikrotik configured so lets propagate some prefixes across the internal network.

Like in the previous blog post IPv6 subnets are usually /64 because that is required in order for SLAAC (stateless address autoconfiguration) to work!

So we will work with 2001:abc:4321:a::/64 subnet and we already have those IPs attached:

  • 2001:abc:4321:a::1 - linux server that is sharing ipv6 (6to4)
  • 2001:abc:4321:a::2 - mikrotik 6to4 interface
  • 2001:abc:4321:a::3 - mikrotik bridge IP (this one we need to add)

1. Link-Local Addresses

After IPv6 has been enabled each running interface should have link-local IPv6 address. This is needed for proper IPv6 setup.

[admin@MikroTik]> /ipv6 address print
Flags: X - disabled, I - invalid, D - dynamic, G - global, L - link-local 
 #    ADDRESS                                     FROM-POOL INTERFACE   ADVERTISE
 0 DL fe80::3:538e:c549/64                                  pomidor     no
 1 DL fe80::ce2d:e0ff:fe2b:8228/64                          bridge      no
 ...

If there are no link-local addresses on the interfaces please check /system package print and look for ipv6 - if its disable you might have to restart your router in order to enable it.

2. SETUP

I'm using a bridge on my Mikrotik to be able to connect all my local networks together:

/interface bridge
add admin-mac=CC:2D:A1:2B:82:48 arp=proxy-arp auto-mac=no comment=defconf name=bridge
/interface bridge port
add bridge=bridge comment=defconf interface=ether2-master
add bridge=bridge comment=defconf hw=no interface=sfp1
add bridge=bridge comment=defconf hw=no interface=wlan1
add bridge=bridge comment=defconf hw=no interface=wlan2
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
add bridge=bridge interface=ether5
add bridge=bridge interface=dynamic

So first thing is to add a pool (ipv6-pool) that will be advertised:

/ipv6 pool
add name=ipv6-pool prefix=2001:abc:4321:a::/64 prefix-length=64

Then add ipv6 address to the bridge interface and advertise the subnet:

/ipv6 address
add address=2001:abc:4321:a::3 from-pool=ipv6-pool interface=bridge advertise=yes
...

Setup the DHCP server:

/ipv6 dhcp-server
add address-pool=ipv6-pool interface=bridge lease-time=14w1d name=ipv6-server

RouterOS has Ipv6 Neighbor Detection and stateless address auto-configuration support using Router Advertisement Daemon (RADVD):

/ipv6 nd
set [ find default=yes ] hop-limit=64

3. Testing

How linux works with this configuration.

Each interface should get and dedicated address based on its mac addr as you can see on the example:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.88.254  netmask 255.255.255.0  broadcast 192.168.88.255
        inet6 fe80::ba27:ebff:fe12:3456  prefixlen 64  scopeid 0x20<link>
        inet6 2001:abc:4321:a:fe12:3456  prefixlen 64  scopeid 0x0<global>
        ether b8:27:eb:12:34:56  txqueuelen 1000  (Ethernet)
        RX packets 47137343  bytes 49911900769 (46.4 GiB)
        RX errors 0  dropped 3518  overruns 0  frame 0
        TX packets 41558799  bytes 15421813301 (14.3 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

This is how routing works:

root:~# ip -6 r s
2001:abc:4321:a::/64 dev eth0 proto kernel metric 256  expires 2591777sec pref medium
fe80::/64 dev eth0 proto kernel metric 256  pref medium
default via fe80::ce2d:e0ff:fe2b:8228 dev eth0 proto ra metric 1024  expires 1577sec hoplimit 64 pref medium

How android cope with ipv6

More likely its linux so it should work

23: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 3000
   link/ether c0:ef:4b:f9:40:f8 brd ff:ff:ff:ff:ff:ff
   inet 192.168.88.13/24 brd 192.168.88.255 scope global wlan0
      valid_lft forever preferred_lft forever
   inet6 2001:abc:4321:a:7cbc:fb2c:754e:4adc/64 scope global temporary dynamic
      valid_lft 604527sec preferred_lft 85527sec
   inet6 2001:abc:4321:a:c2ee:fbff:fef9:40f8/64 scope global mngtmpaddr dynamic
      valid_lft 2591969sec preferred_lft 604769sec
   inet6 fe80::c2ae:fbff:fef9:40f8/64 scope link
      valid_lft forever preferred_lft forever