I made the test to configure ipv6 on my router behind a Freebox Mini server (one that offers prefix delegation) using the most as possible the luci http interface and the simplification brought by ophcpd. Not that I am reluctant to use the shell and uci, but I based my approach on the following principles:
- reading http://wiki.openwrt.org/doc/uci/network6, it seems that the native IPV6 implementation in OpenWrt is well designed and fitted by default to most situations (so why not behind a Freebox?). Moreover, http://wiki.openwrt.org/doc/uci/network6 describes the settings for the most common situations (why not just follow?),
- luci GUI offers the default options that can be used for the most common settings (as usual for a GUI).
I propose to share my experience. However I am too lazy for screen shots, so that requires some reading. One more word: I am sorry it is in English (and probably bad English) although a part of the thread is already in French, but I feel very deeply uncomfortable to express myself in another language than English in an international forum (this is a strictly personal feeling and I do not blame anyone here for using French).
All that is mentioned below is related to the ipv6 configuration only. In practice, I had to open a shell twice on the router (to collect a local link address and to display the route table). Besides, I had to add two routes (with the luci interface) to complement the settings for cases not covered by the default configuration (thus deviating a little to the "all by default and simple" principle). My router is an Archer C7 v2.0, I do not think it matters a lot since I only reference the wan6 and lan interfaces (already defined by default when opening the luci interface).
As you may already know, Free offers network delegation and this can be done thru the Freebox interface. Actually Free offers a 2a01:e35:xxxx:xxxx:/61 that can be delegated in separate subnetworks. The first one will not be delegated as we reserve it to the Freebox itself for the router stateless configuration. The Freebox address is 2a01:e35:xxxx:xxx0::1.
In the ipv6 menu of the Freebox interface, we define the prefixes and nexthops:
1st subnet: prefix='2a01:e35:xxxx:xxx0:/64' nexthop= left empty.
2nd subnet: prefix='2a01:e35:xxxx:xxx1:/64' nexthop='wan6 local link adress' (open a shell on the OpenWrt router and explore the ifconfig command output). We need the wan6 local link address not the lan address since the Freebox will have to know to which interface it has to pass the packets towards the delegated subnet. The lan local link address is unknown to the Freebox. There is a small inaccuracy in http://wiki.openwrt.org/doc/howto/freebox. It implicitely recommends to collect the LAN local link address. With the router given as example, all local link addresses seem to be the same, so it works by chance.
Other subnets: not needed here
That's all for the Freebox.
On the router, we will now configure wan6, lan, make test connectivity and add the missing pieces. That makes three short steps.
1 - Wan6 configuration
1.1 - open 'general setup' tab
By default DHCPV6 is proposed as default proto. We leave it selected (the Freebox offers only SLAAC but odhcpd handles it).
- 'Request IPv6-address=try'
- 'Request IPv6-prefix of length=automatic' (it actually picks up a /64)
1.2 - open 'advanced settings' tab
No need to modify the default selection (all boxes should be selected), just add:
- 'Custom delegated IPv6-prefix=2a01:e35:xxxx:xxx1:/64'
1.3 - Restart the wan6 interface, normally it should receive a global scope address (based on its hw mac address because of the stateless configuration)
2 - Lan configuration
2.1 - open 'general setup' tab
- 'IPv6 assignment length=64'
2.2 - open 'ipv6 settings' tab
- 'Router Advertisement-Service=server mode'
- 'Always announce default router': selected
I do not give the details here, what matters is that each client obtains at least one ipv6 address (scope global). Possibilities offered by these options are well and extensively detailed here http://wiki.openwrt.org/doc/howto/freebox.
2.2 - Restart the Lan interface, it receives the 2a01:e35:xxxx:xxx1::1/64 global scope address
3 - Connectivity and final adjustment
Connect the clients. They should receive a global scope address with a 2a01:e35:xxxx:xxx1:/64 prefix. From the clients "ping6 ipv6.google.com" will answer that the host is unreachable. That is the sign that some route rules are missing.
To see what is going on, I had to access the router'shell a second time. Running ' ip -6 route list table main' reveals that here is no route for 2a01:e35:xxxx:xxx1:/64 subnet. Besides the default route address (gateway for the outside) is the Freebox local link address. To my opinion, this is not unexpected that OpenWrt does not add a route for the local net behind the lan interface: one could split the delegated network to more than one lan interface. I did not test, but I guess that it should work correctly if a value was given to ip6hint (in our example, the mask would have to be shifted through ip6assign). Indeed in such case, there would be a clear relationship between the interface and the subnet and no doubt about the routing. As for the missing default gateway on wan6, my guess is that it is related to the Freebox itself that only offers SLAAC and does not announce the gateway address.
However, we can add static routes directly from the luci interface.
Open the 'network->static route' panel and for the ipv6 add the two following routes:
interface wan6 / target ::0/0 / gateway 2a01:e35:xxxx:xxx0::1
interface lan / target 2a01:e35:xxxx:xxx1:/64
From the clients "ping6 ipv6.google.com" is now successful and test-ipv6.com gives a 10/10.
Hope it can help.