-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
plugin/bind: Discard link-local addresses on binding by interface name #4531
Conversation
Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>
Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>
I've also tested this and it's working as expected:
As it can be seen, it listens on all interfaces (including IPv4 and IPv6 of |
plugin/bind/README.md
Outdated
@@ -13,7 +13,7 @@ If several addresses are provided, a listener will be open on each of the IP pro | |||
|
|||
Each address has to be an IP or name of one of the interfaces of the host. Bind by interface name, binds to the IPs on that interface at the time of startup or reload (reload will happen with a SIGHUP or if the config file changes). | |||
|
|||
If the given argument is an interface name, and that interface has serveral IP addresses, CoreDNS will listen on all of the interface IP addresses (including IPv4 and IPv6). | |||
If the given argument is an interface name, and that interface has serveral IP addresses, CoreDNS will listen on all of the interface IP addresses (including IPv4 and IPv6), except for link-local addresses on that interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this includes the v4 range ? 169.254/16 as well?
lgtrm, one question |
Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>
Yeah it works with IPv4 link-local address now. So I also changed the README.md to specify
|
Signed-off-by: Mohammad Yosefpor myusefpur@gmail.com
1. Why is this pull request needed and what does it do?
Binding doesn't work on link local IPv6 addresses (
fe80::/10
). I found multiple stackoverflow/github issues related to binding on IPv6 link-local (e.g. this or this ) explaining why this does not work. It seems we need to also specify scope_id in binding. So it needs changes in coredns/core and caddy parts if we want to be able to bind on link local addresses as well.So I suggest, we add a
IsLinkLocalUnicast()
check and discard link-local IPv6 addresses, and specify aexcept for link-local addresses
in readme.Without this, bind by interface name feature does not work with interfaces with link local address (which in some distros it has by default), so using those interface names will not work then. We should either discard them (what has been done in this PR), or change caddy code to allow binding on link-local addresses.
2. Which issues (if any) are related?
#4219
#4522
3. Which documentation changes (if any) need to be made?
Changed README.md
4. Does this introduce a backward incompatible change or deprecation?
It has backward compatibility.