Networking – How to enable IPv6 in OpenWRT 15.05

ipv6networkingopenwrtrouter

My university provides native IPv6 support in campus network, and I want to let devices (running Linux) in my TL-WR720N router's LAN have IPv6 access.

After many trials, I can make LAN devices able to get Global IPv6 addresses. But when I ping6 some websites, it always says "Network is unreachable", whereas these websites all responded normally when I ping6 them on the router.

Here are my config files:

root@OpenWrt:~# cat /etc/config/network 

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdc8:3a9f:1840::/48'

config interface 'lan'
        option ifname 'eth1'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6hint '1234'
        option ip6assign '48'

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth0'
        option proto 'dhcpv6'

root@OpenWrt:~# cat /etc/config/dhcp 

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra_management '2'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

root@OpenWrt:~# 

I have relatively poor knowledge about IPv6 network and not familiar with some stuff such as Router Advertisement, NDP, IPv6 assignment length/hint, etc. It's really appreciated if someone can help.

Best Answer

You need to request an IPv6 prefix from your upstream provider for the machines on the LAN side of your router to use; this is called DHCPv6 prefix delegation.

config interface 'wan6'
        option ifname 'eth0'
        option proto 'dhcpv6'
        option reqaddress 'force'
        option reqprefix '56'

Of course, this will work if and only if the upstream provider actually provides routed prefixes. In a campus dorm, this may or may not be the case. Contact your university's IT services and ask about this if you don't get a routed prefix after doing this.

Related Question