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

giving a different answer to external vs VPN hosts #2

Open
vielmetti opened this issue May 21, 2021 · 3 comments
Open

giving a different answer to external vs VPN hosts #2

vielmetti opened this issue May 21, 2021 · 3 comments

Comments

@vielmetti
Copy link

I have a couple of machines in a Tailscale network, where there's an internal VPN address (on tailscale0) and an external address (on eth0). Some of those systems are behind home firewalls. I'd like to run finger2020 everywhere.

I'd also like to have finger2020 give different answers depending on which IP address gets the query, so that I can use finger for some details for the private VPN hosting, and provide something else if someone hits it from a public address.

I think this is more about how to configure systemd to bend it to my will, rather than this code here which is as far as I can tell perfectly suited for the task. So it's not a bug report, more a configuration question.

@vielmetti
Copy link
Author

the hint I'm following is the systemd "ListenStream" where you can bind the listener to a specific IP address, documented at https://www.freedesktop.org/software/systemd/man/systemd.socket.html

@vielmetti
Copy link
Author

the thing that worked was to create mulitple ".socket" files, and in each one put an appropriate interface, e.g.

BindToDevice=eth0

and then associate each one with a separate ".service" file that invoked finger2020 in an appropriate way (different users, different answers).

No changes to the codebase needed, and I don't know how useful in general this info will be.

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

No branches or pull requests

1 participant