-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dns/ddclient: Add support for altering IPv6 addresses in ddclient plugin #4491
Conversation
@SaarLAN-Pissbeutel can you offer some examples of the full input and expected output? This feels a bit convoluted, but I don't mind taking a look at the PR if we can make the requirements clear enough. |
@AdSchellevis yes, of course! I just updated and de-convoluted the code to also include the other web based ip checks. This PR should help people who receive a dynamic prefix from their provider which changes every now and then and want to update their DynDNS records to resolve another host on the network. The "Dynamic IPv6 Host" alias for firewall rules is very similiar. A use case would be a service on another machine in the network which should be made available to the internet. In the IPv4 world, having the WAN IP of the OPNsense and NAT is sufficient. For IPv6, the DynDNS updater must either run on the other machine and update the record with its own IP or if OPNsense updates the record with its own IP, NAT has to be used again. With this feature, there is no need to run a lot of DynDNS updaters on other machines while still having the records updated to point to the specific hosts. @nk404030 has described the scenario in his report #4466. There are 3 possibilities:
Possible inputs are partial IPv6 addresses (the last 64 bit) according to the regex. Examples would be:
How can I help to make the requirements clear enough? |
ok, I think I understand what you want, so let me rephrase to be sure (in the ipv6 + input case), with
Ideally we should validate the input data, the ip address split might need some normalization as well, but we can take a look at that later. |
Yes, that's right. We use the existing network identifier (first 64 bits) and swap out the host identifier (last 64 bits) for our custom host. During my testing, the regex in the DynDNS.xml nicely validated the data and only accepted what ipaddress.ip_address can work with. The normalization is done with ipaddress.ip_address(ipv6host).exploded which would convert ::1 to :0000:0000:0000:1. |
you're right, the regex seems to match pretty well. Let me take a look at the rest of the code. |
* simplify network / host concat a bit * add try...except for the curl fetch in case the other end doesn't return a valid address * extend form help text for "Dynamic ipv6 host" a bit
@SaarLAN-Pissbeutel I've added a3b405c on top, can you double check if this does the trick? If so, I'll close this PR and merge the adjusted branch. |
@AdSchellevis thanks for the adjustments. Looks good to me and works as intended! Looking forward to see the feature in the stable release 😃 |
…gin (#4497) * Add support for altering IPv6 addresses in ddclient plugin * Refactoring of checkip * dns/ddclient - minor cleanups for #4491 * simplify network / host concat a bit * add try...except for the curl fetch in case the other end doesn't return a valid address * extend form help text for "Dynamic ipv6 host" a bit --------- Co-authored-by: SaarLAN-Pissbeutel <[email protected]> Co-authored-by: Marc Philippi <[email protected]>
@SaarLAN-Pissbeutel thanks for your feedback, merged in 8606b35 |
When using the DynDNS client in combination with IPv6 addresses with a dynamic prefix, it is currently impossible to change the host part of the address to another host in the network. This pull request aims to fix this issue by adding the necessary functionality to the ddclient plugin.
A new field is added to the advanced view, where a partial IPv6 address (the host part) can be added. Validation is performed, so that the user can only enter a valid partial IPv6 address.
When this field is populated and the IP in question is an IPv6 (e.g. by using the "Interface [IPv6]" method), the IP for the DynDNS service will be altered so that the prefix stays and the host part is added.
Should resolve #4466