Unable to connect to the IPv6 Internet from ULA addresses
I gleened most of these settings from IPv6 configuration
1. Set the ula_prefix
config globals 'globals'
option ula_prefix 'fd51:7480:b731::/48'
...
/etc/config/network
I have set the ula_prefix.
This gives us fd51:7480:b731:: for any ULA interfaces.
2. Setting a lan subnet interface:
2.1 Setting a device for the lan interface:
...
config interface 'lan'
option device 'br-lan'
...
/etc/config/network
2.2 Set a subnet for the lan interface
...
option ip6hint 'a'
option ip6assign '64'
...
Now with the ula_prefix, the subnet (ip6hint), and
the subnet mask, we create a ULA Subnet range of:
fd51:7480:b731:a::/64
2.3 Setting an IPv6 address for the LAN Interface:
Now that we have our ULA Subnet range we can set an IP6 address
within it:
...
option ip6addr 'fd51:7480:b731:a::1'
option proto 'static'
...
/etc/config/network
2.4 Setting an ip6class:
OpenWRT uses the ip6class option to pick between Global Uniqe AddressesGUA and Unique Local Addresses ULA.
Here I am going to pick ULA, since our ULA subnet falls within that range (fd51:7480:b731:a::/64):
...
option ip6class 'local'
...
/etc/config/network
2.4 Lastly, I'm going to set a DNS address for the subnet:
...
option dns '2001:4860:4860::8888'
...
3. Restart the network:
openwrt $ /etc/init.d/network restart
4. Test ping to the DNS from the router:
openwrt $ ping6 2001:4860:4860::8888
(Success)
5. Client Setup with a static IPv6 Address in our ULA subnet
client-on-ula-a-subnet $ nmcli
eth0: connected to NetGear R6260 - LAN Port 1
"Microchip SMS9512/9514"
ethernet (smsc95xx), B8:27:EB:B2:DC:1E, hw, mtu 1500
ipv4 default, ipv6 default
inet4 192.168.1.7/24
route4 default via 192.168.1.1 metric 100
route4 192.168.1.0/24 metric 100
inet6 fe80::363c:4eaf:b5e9:8e5d/64
inet6 fd51:7480:b731:a::2/64
route6 fd51:7480:b731:a::/64 metric 100
route6 fe80::/64 ,etroc 1024
route6 default via fd51:7480:b731:a::1 metric 100
6. Client Ping to DNS:
client-on-ula-a-subnet $ ping6 -v 2001:4860:4860::8888
ping6 sock4.fd -1 (socktype: 0), sock6.fd: 3 (socktype: SOCK_DGRAM), hints.ai_family: AF_INET6
ai->ai_family: AF_INET6: ai->ai_connonname: '2001:4860:4860::8888'
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data byes
^C
--- 2001:4860:4860::8888 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3062ms
(Failure to Ping?)