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

improve the Linux configuration instructions #541

Closed
wants to merge 7 commits into from

Conversation

anarcat
Copy link
Contributor

@anarcat anarcat commented Sep 17, 2018

This is a bunch of patches to improve the Linux instructions for the
"red" VPN. Each commit has detailed instructions, but here's an
overview:

  • remove hardcoded IP address
  • add port 53 to sample config
  • cleanup configuration file
  • remove (broken) non-root instructions
  • sync update-resolv-conf script with Debian

It seems strange to me to have the IP address of the VPN server
here. It makes it needlessly difficult for Riseup to move that server
and makes the configuration more opaque for users. Instead, switch to
the domain name which also removes a duplicate configuration.
The VPN server also listens on port 53, but this wasn't documented in
the sample configuration.
This is not relevant for users, while the `auth-user-pass` parameter
might be.
The sample config file points to the script available in the Debian
package (which works), but the documentation says to install it in a
different place (which will fail if users are not running Debian and
is useless if they are).
We would previously tell people to overwrite a script already provided
in the openvpn Debian package.
In my tests, those instructions do not work at all. OpenVPN does
switch to the non-root user, but then when it exits, it cannot cleanup
after itself:

 * routes will be left dangling
 * the tunnel interface might be left
 * the resolv.conf file will keep the VPN-specific entries

While it would be nice to have a working config like this it seems
impractical, in my tests, with the provided instructions. Here is the
output when exiting as user "nobody":

RTNETLINK answers: Operation not permitted
Mon Sep 17 12:09:38 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
RTNETLINK answers: Operation not permitted
Mon Sep 17 12:09:38 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
RTNETLINK answers: Operation not permitted
Mon Sep 17 12:09:38 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
Mon Sep 17 12:09:38 2018 /sbin/ip addr del dev tun0 172.27.100.15/22
RTNETLINK answers: Operation not permitted
Mon Sep 17 12:09:38 2018 Linux ip addr del failed: external program exited with error status: 2
Mon Sep 17 12:09:38 2018 /etc/openvpn/update-resolv-conf tun0 1500 1571 172.27.100.15 255.255.252.0 init
rm: cannot remove 'tun0.openvpn': Permission denied
Mon Sep 17 12:09:38 2018 WARNING: Failed running command (--up/--down): external program exited with error status: 1
Mon Sep 17 12:09:38 2018 Exiting due to fatal error
The script apparently comes from Debian, but it looks really, really
old. There were changes done to the script since then including
improvements on error handling and refactoring that make the script
easier to read and audit.

The script content was synchronized with the OpenVPN 2.4.6-1 Debian
package, as available here:

https://sources.debian.org/data/main/o/openvpn/2.4.6-1/debian/update-resolv-conf
Copy link
Contributor

@micah micah left a comment

Choose a reason for hiding this comment

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

I think the reason this was changed to the IP address was because people had difficulty connecting to the VPN when they couldn't resolve things properly. For example, OpenDNS has a "family filter" that lists all VPN providers, including ours, and will just return a NXDOMAIN for us. It turns out this filter is used in a lot of locations, especially cafes and other free wifi spots. I've encountered it numerous times.

@anarcat
Copy link
Contributor Author

anarcat commented Sep 21, 2018

I think the reason this was changed to the IP address was because people had difficulty connecting to the VPN when they couldn't resolve things properly. For example, OpenDNS has a "family filter" that lists all VPN providers, including ours, and will just return a NXDOMAIN for us. It turns out this filter is used in a lot of locations, especially cafes and other free wifi spots. I've encountered it numerous times.

I see. Well I think that's rather unusual - what about if that's available as a comment instead?

Otherwise if you feel strongly about this, I can fixup that commit to, instead, document why that's an IP address to resolve the WTF I felt when reading the config. :)

Thanks for the review!

@micah
Copy link
Contributor

micah commented Sep 24, 2018 via email

@anarcat
Copy link
Contributor Author

anarcat commented Sep 24, 2018 via email

@disturbio disturbio closed this Aug 19, 2020
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