Callumpy wrote:So I have the dynamic firewall script working, only to realise that my Device.PUB.lan address isn't the one the device is using, it's actually using one listed under Device.TMP.PUB.lan
Also sometimes it doesn't list my public address on there at all
I've tried to rename my device, it's currently Unknown-xxx, by putting the config in the dhcp file, but it doesn't appear to work.
Thanks
EDIT: I use a cronjob on my server to update my DDNS, so it's updating my DDNS to the temp address whereas the firewall is being updated to the actual public address.
I've temporarily just set the firewall to use the TMP address, but there are sometimes multiple so there's a chance they will be wrong.
Hi Callumpy,
We have multiple problems to address here.
It appears that the OS of the host that runs your server is using a combination of IPv6 technologies that is designed to make the IPv6 addresses hard to be discovered or guessed. Those are the Privacy Extensions (generates temporary addresses) and Semantically Opaque Interface Identifiers (IIDs), which is supposed to generate static addresses but unfortunately it has not been defined with dynamic prefixes in mind. So in practice it will produce a public address that will also change completely everytime your ISP changes the prefix.
I'd say that this is the worst (most difficult) IPv6 setup for running a server, but it is not your fault. In fact it is the ISP that screws up almost everything by implementing a dynamic prefix. If it is possible, I'd change the server config to not use Semantically Opaque IIDs, or disable Privacy Extensions (temp addr) or use managed (DHCPv6) addresses.
Currently, ip6neigh cannot differentiate between a temporary address and a semantically opaque one, so both are labeled as TMP addresses. If you want to go further trying to workaround this, your approach to use Device.TMP.PUB.lan for getting the address is correct. But periodically the host will generate new temporary addresses and the old ones will become unusable. That is why disabling privacy extensions could help, leaving only the opaque address on the link.
The reason for the Unknown-XXX name is probably because your server is not using DHCPv4 nor DHCPv6 for getting addresses, but may have manually configured addresses instead. It is easily solved by adding a static entry in /etc/config/dhcp. If it did not work, I could help you to figure out why. The worst thing to happen is your host also using a random MAC address, which is unlikely.
By the way, what platform/OS do you use for this server ?
André