Skip to content
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

Allow specification of which interfaces to bind to #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SphtKr
Copy link

@SphtKr SphtKr commented Jan 17, 2024

In cases where the container has multiple interfaces/multiple IPs, it may be necessary to specify which interfaces Samba should use. In my case (microk8s+multus) it was listening additionally on a k8s-internal IP address and registering that IP address in DNS, which clients on the LAN would not be able to reach. This change allows specification of an environment variable BINDINTERFACES that becomes the interfaces value in smb.conf. The default is ${HOSTIP} lo which excluded any IPs other than the HOSTIP value.

This is a change from previous behavior, where all interfaces would be used, but this new behavior is probably desirable. The old behavior can be preserved by providing false explicitly in BINDINTERFACES.

In cases where the container has multiple interfaces/multiple IPs, it may be necessary to specify which interfaces Samba should use. In my case (microk8s+multus) it was listening additionally on a k8s-internal IP address and _registering that IP address in DNS_, which clients on the LAN would not be able to reach. This change allows specification of an environment variable `BINDINTERFACES` that becomes the `interfaces` value in smb.conf. The default is `${HOSTIP} lo` which excluded any IPs other than the HOSTIP value.

This is a change from previous behavior, where all interfaces would be used, but this new behavior is probably desirable. The old behavior can be preserved by providing `false` explicitly in `BINDINTERFACES`.
@SphtKr
Copy link
Author

SphtKr commented Jan 17, 2024

Perhaps notably, I have added the interfaces options to the commands that join a DC to an existing domain, but the ${HOSTIP_OPTION} is not provided to those commands. I don't believe this breaks anything, but I wonder if the ${HOSTIP_OPTION} should be provided to those commands for a similar reason to the need for this PR's change.

@SphtKr
Copy link
Author

SphtKr commented Jan 17, 2024

it was listening additionally on a k8s-internal IP address and registering that IP address in DNS

One other comment--besides this, but any time the container was restarted it was likely to get a new (dynamic) internal IP, which would be added instead of replaced in DNS (I am using Bind9 though, which may be specific to this behavior)... so this was needed to stop proliferation of many unreachable IPs in DNS, not just one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant