Pivpn: Modified sysctl.conf (Disabled ipv6) breaks installer

Created on 6 Feb 2018  路  3Comments  路  Source: pivpn/pivpn

Issue 1:
Installation fails on raspbian stretch, before it allows to select an external ip-address, if ipv6 has been disabled in /boot/cmdline.txt and /etc/sysctl.cnf

On this raspbian configuration,
/boot/cmdline.txt contains: ipv6.disable=1
/etc/sysctl.cnf contains additional ipv4 rules (as shown below)

sysctl: net.ipv4.ip_forward = 1
cannot stat /proc/sys/net/ipv6/conf/all/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/default/disable_ipv6: No such file or directory
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1

followed by:
::: Install Complete...

Issue 2:
Can't open /etc/openvpn/easy-rsa/pki/index.txt.attr for reading
(Resolved by running installer a second time)

PiVPN Issue Template

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   178  100   178    0     0    143      0  0:00:01  0:00:01 --:--:--   143
100 53505  100 53505    0     0  35869      0  0:00:01  0:00:01 --:--:-- 35869
:::
::: You are root.
::: Verifying free disk space...
:::
::: apt-get update has not been run today. Running now... done!
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your system is up to date! Continuing with PiVPN installation...
::: Using interface: eth1
::: Static IP already configured.
::: Using User: jasper
:::
::: Checking for existing base files...
:::    Checking /etc/.pivpn is a repo...:::    Cloning https://github.com/pivpn/pivpn.git into /etc/.pivpn... done!
:::
::: Stopping OpenVPN service... done.
:::
::: Installing scripts to /opt/pivpn... done.
::: Using protocol: udp
::: Building CA...
Generating a 4096 bit RSA private key
...............................................++
......................................................................................................++
writing new private key to '/etc/openvpn/easy-rsa/pki/private/ca.key.ck0zueQEdv'
-----

::: CA Complete.

Note: using Easy-RSA configuration from: ./vars
rand: Use -help for summary.
Generating a 4096 bit RSA private key
..............................................................++
............................................................++
writing new private key to '/etc/openvpn/easy-rsa/pki/private/server_Ehulpdh5olw42tbR.key.itNM6ob9ic'
-----
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.cnf
Can't open /etc/openvpn/easy-rsa/pki/index.txt.attr for reading, No such file or directory
1995974048:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:74:fopen('/etc/openvpn/easy-rsa/pki/index.txt.attr','r')
1995974048:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:81:
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
commonName            :ASN.1 12:'server_Ehulpdh5olw42tbR'
Certificate is to be certified until Feb  4 11:58:20 2028 GMT (3650 days)

Write out database with 1 new entries
Data Base Updated
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   780  100   780    0     0    317      0  0:00:02  0:00:02 --:--:--   317

Note: using Easy-RSA configuration from: ./vars
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.cnf

An updated CRL has been created.
CRL file: /etc/openvpn/easy-rsa/pki/crl.pem

sysctl: net.ipv4.ip_forward = 1
cannot stat /proc/sys/net/ipv6/conf/all/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/default/disable_ipv6: No such file or directory
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
::: Install Complete...
::: Restarting services...
Synchronizing state of openvpn.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable openvpn
::: done.
:::
::: Installation Complete!
::: Now run 'pivpn add' to create an ovpn profile for each of your devices.
::: Run 'pivpn help' to see what else you can do!
::: It is strongly recommended you reboot after installation.
:::
::: The install log is located at: /etc/pivpn/install.log

Have you taken any steps towards solving your issue?

Enable ipv6, by removing entry from /boot/cmdline.txt and removing additional ipv4 params from /etc/sysctl.cnf
(Installation succesfully completes afterward...)

Should be an easy fix.

Needs Investigation bug

All 3 comments

I can confirm this issue. Google led me here when I was searching why PiVPN never asked me for a host/dns name (tried many times). I re-enabled ipv6, re-installed and everything worked fine. Thanks @JasperG for logging this issue, and thanks to the maintainers for looking into it !

I too confirm this issue running Debian Stretch @ a Mac Mini.

confirm same here:

DietPi Version | v6.2
SBC Device | RPi 3 Model B (armv7l) (index=3)
Distro | stretch (index=4)

IPV6 DISABLED:

confOpenVPN - appears to finish fine - the server.conf is created
but the netfilter-persistent save (PLAT=Raspbian) in confNetwork brakes off with:

run-parts: executing /usr/share/netfilter-persistent/plugins.d/15-ip4tables save
run-parts: executing /usr/share/netfilter-persistent/plugins.d/25-ip6tables save
ip6tables-save v1.6.0: Cannot initialize: Address family not supported by protocol

run-parts: /usr/share/netfilter-persistent/plugins.d/25-ip6tables exited with return code 1

https://github.com/pivpn/pivpn/blob/25aaf24c893175894d0a54d159a10fbb74b6b463/auto_install/install.sh#L987
subsequent functions confOVPN / setClientDNS ..etc.. are missing

IPV6 ENABLED:

installs fine

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hesi-Re picture Hesi-Re  路  4Comments

peterHendrickx picture peterHendrickx  路  4Comments

PunkRa1n picture PunkRa1n  路  4Comments

rothgar picture rothgar  路  6Comments

andersonentwistle picture andersonentwistle  路  6Comments