In certain case, our ISP only provide us a /64 PD and we cannot further split it into subnets. If we cascade multiple routers together, the downstream routers may loose IPv6 access. IPv4 access can be easily guaranteed by NAT. But in the world of IPv6, NAT should be avoided where possible.
The following setup will be on an OpenWrt router connected behind an ISP-provided IPv6-ready router. All configurations are done on the OpenWrt router, and we don't touch the ISP-provided router. We dont need to configure any IPv4, it uses NAT and will work by default.
Here is how to configure relay for IPv6:
In /etc/config/network
, our IPv6 upstream interface looks like this
config interface 'wan6'
option proto 'dhcpv6'
option device 'eth0'
option reqaddress 'none'
option reqprefix 'no'
option norelease '1'
The key is reqprefix
.
Optionally, you can have reqaddress
to prevent the interface from getting extra IPv6 address from the ISP-provided router.
In /etc/config/dhcp
, we create a DHCP service for the upstream IPv6 interface, set the upstream IPv6 interface as the "designated master",
then set RA-Service
, DHCPv6-Service
, and NDP-Proxy
to relay mode:
config dhcp 'wan6'
option interface 'wan6'
option ignore '1'
option master '1'
option ra 'relay'
option dhcpv6 'relay'
option ndp 'relay'
config dhcp 'lan'
option interface 'lan'
...
option ra 'relay'
option dhcpv6 'relay'
option ndp 'relay'
Note that ignore
means this DHCP service ignores IPv4 and only handles IPv6. The key is master
.