Where you run the client is less important then to register the raspberrry's GUA... with a static interface identifier once you know the prefix, you can construct the GUA and hence register it even from the router... but then having the raspberry do the registering itself is fine as well.
As mk24 stated a traffic rule should do.
I run a WG server in my network (on an EA8500) I have given that a static IP address, the hostid uses the prefix and adds 06 (it is hex but I use this to be the same as the IPv4 address):
config host
option dns '1'
option name 'EA8500'
option mac 'C0:56:27:XX:XX:XX'
option ip '192.168.0.6'
option leasetime '6h'
option duid '00030001a0562713278d'
option hostid '06'
The traffic rule uses a negative mask so that if the prefix changes it does not matter:
config rule
option name 'wg-server6-6'
list proto 'udp'
option src 'wan'
option dest 'lan'
option dest_port '51810'
option target 'ACCEPT'
option family 'ipv6'
list dest_ip '::6/-64'
So I was continuing playing with IPv6 and found that I am not able to ssh to my oracle cloud instance via ssh (port is not standard 22, I changed it for security reasons)
Then I disable IPv6 completely in openwrt following this, then I was able to ssh.
Any logical explanation for this?
So this file is modified as below to add a static ipv6 address to the raspberry pi where I want to host the website, is that correct?
config host
option dns '1'
option name 'pi2b'
option mac '<MAC ADDRESS OF RPI>'
option ip '192.168.0.240'
option leasetime '6h'
option duid '00030001a0562713278d'
option hostid '06'
Where can I get duid? I tried
root@OpenWrt:~# cat /etc/config/network | grep duid
root@OpenWrt:~#
But comes empty. Could it be because I disabled IPv6 completely earlier?
Got it back to yesterday state, found the duid from Active DHCPv6 Leases.
Now adding below entry to /etc/config/dhcp
config host
option dns '1'
option name 'pi2b'
option mac '<MAC ADDRESS OF RPI>'
option ip '192.168.0.6'
option leasetime '6h'
option duid '<duid I found>'
option hostid '06'
And then when I power on rpi and do ifconfig, should I expect to see an IPv6 address and that stays same on every reboot of pi/openwrt?
Edit: one more question, this duid I found is not of rpi, it was of some other device( I think my ipad's) is that fine?
config rule
option name 'rpi-website'
list proto 'udp'
option src 'wan'
option dest 'lan'
option dest_port '80'
option target 'ACCEPT'
option family 'ipv6'
list dest_ip '::6/-64'
and restarted router.
Now trying to access the site as http://[< IPv6-PD>] from external network just like yesterday but page not opening.
No the DUID is specific for each device just as your MAC address (it is actually derived from the MAC address) you cannot use the DUID of another device!
The ip address 192.168.0.6 must be in the subnet of your router so it works only if your routers IP br-lan address is 192.168.0.X with subnet 255.255.255.0 (or /24 if CIDR notation is used)
Most providers use dynamic IPv6 prefixes so the first 64 bits can change.
I think someone else already gave you the advice to remove the ULA address as that is not needed if you have GUA addresses and therefore might be confusing.
IPv6 is a different beast than IPv4, if you want to use it you better read up on it.
The prefix can change (the prefix is the first 64 bits), that is where the negative netmask (/-64) comes in, it basically states do not care about the first 64 bit but use ::6 as address (which is :00:00:00:06)
So this takes care of the changing prefix
But to access your Pi you have to use the full GUA address (e.g. 2406:7400:51:275d::6 ) and as the prefix (2406:7400:51:275d) can change you need DDNS to keep track of a changing prefix
Ok finally, I was able to reach my website (hosted on raspberry pi in my home lan) from outside network without any port forward.
in /etc/config/dhcp,
config host
option dns '1'
option name 'pi2b'
option mac 'XX:XX:XX:XX:XX:XX'
option ip '192.168.0.6'
option leasetime '6h'
option duid 'xxxxxxxxxxxxaxxxaxxxxxxxxxxxx'
option hostid '06'
Note: First I noted down duid without above change and connecting pi to network and going to DHPC and DNS->Static Leases
config rule
option name 'rpi-website'
option src 'wan'
option dest 'lan'
option dest_port '80'
option target 'ACCEPT'
option family 'ipv6'
list dest_ip '::6/-64'
list proto 'tcp'
After this, I power cycled router and pi.
In pi when I do ifconfig, I got below IPv6 addresses,
Of course that is why we are using that as static lease and opening up the firewall for that address
The local fe80 is just that for local use, and consider getting rid of the ULA addresses, they have no purpose as you now can use the GUA addresses and they might be confusing.
Under Network > Interfaces > Global Network options delete the ULA prefix