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

Document #7 and add preshared key functionality #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JeWe37
Copy link
Contributor

@JeWe37 JeWe37 commented Sep 9, 2022

Preshared keys are used by default by some VPN providers, so this may be useful.

So far I only added a documentation note about #7, but potentially that functionality could be removed entirely as suggested there.

I also added a note about the possibility of routing things into the VPN namespace from the rest of the local network using iptables.

@chrisbouchard
Copy link
Owner

I don't think I understand the following:

Beware that is used in conjunction with the nsswitch.conf and resolv.conf tweaks above this will not work correctly, as systemd does not mount them into the right locations. There using ip netns exec may be more appropriate.

Is this saying that the systemd config given for Transmission Daemon doesn't use the nsswitch.conf or resolve.conf from /etc/netns/$NETNS_NAME? If so, I don't think that's something to be documented — I think that's a bug to be fixed. I thought they were working together correctly on the server where I'm using this, but it's possible I missed something.

@JeWe37
Copy link
Contributor Author

JeWe37 commented Sep 12, 2022

Correct. I tried it by simply making a unit that cat's those two files while joining the netns and indeed they aren't used. The reason I don't think that's a bug is because if it were, it'd be one on systemd's end, which I don't really applies here. The reason is that PrivateNetwork= network namespaces don't even have a name that could be looked up in /etc/netns. The only reason that there is a name is that you're explicitly remounting the systemd network namespace to be your own. So really there's nothing to respect here.

Now it does all still work if you just... don't use DNS. Or just globally don't use systemd-resolved and the like. Hence my suggesting just to document it.

wg set "$WIREGUARD_NAME" \
private-key <(echo "$WIREGUARD_PRIVATE_KEY") \
peer "$WIREGUARD_VPN_PUBLIC_KEY" \
preshared-key <(echo "$WIREGUARD_VPN_PRESHARED_KEY") \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be indented like the other peer properties are

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.

3 participants