pivpn/pivpn

PiVPN doesn't work on external wifi but it works with mobile data

JJackintosh opened this issue · 0 comments

Hi I'm getting some problems with PiVPN because it works on my iPhone and on my Macbook when I use mobile data or the iPhone as hotspot, but when I try connecting to some external wifi with the vpn (OpenVPN) , it doesn't work. I always manage to connect to the wifi but the VPN is in some sort of loop while trying connecting...
IMG_7B614BAC8DB4-1

I already tried following the troubleshoot connection issues and everything seems ok, so I don't know what else to do.

I'm using a Raspberry Pi 4 with 4 gb of ram
uname
Linux raspberrypi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux
release:

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    17  100    17    0     0    101      0 --:--:-- --:--:-- --:--:--   101
100   162  100   162    0     0    419      0 --:--:-- --:--:-- --:--:--   419
100  111k  100  111k    0     0   137k      0 --:--:-- --:--:-- --:--:--     0
:::
::: sudo will be used for the install.
::: Update option selected.
[2023-02-21T17:31:29+0000]: ::: The updating functionality for PiVPN scripts is temporarily disabled
[2023-02-21T17:31:29+0000]: ::: To keep the VPN (and the system) up to date, use:
[2023-02-21T17:31:29+0000]:         apt update; apt upgrade
pivpn debug:

Generating Debug Output
         PiVPN debug              ::::
=============================================
::::            Latest commit            ::::
Branch: master
Commit: f7f81e1bf47b5f4564b6ded7a516da5fd3c2f63c
Author: 4s3ti
Date: Mon Nov 28 23:32:17 2022 +0100
Summary: fix(scripts): uninstall default option
=============================================
::::        Installation settings        ::::
PLAT=Debian
OSCN=bullseye
USING_UFW=0
pivpnforceipv6route=1
IPv4dev=eth0
dhcpReserv=1
IPv4addr=192.168.1.8/24
IPv4gw=192.168.1.1
install_user=pi
install_home=/home/pi
VPN=openvpn
pivpnPROTO=udp
pivpnPORT=15275
pivpnDNS1=10.114.240.1
pivpnDNS2=
pivpnSEARCHDOMAIN=
pivpnHOST=REDACTED
TWO_POINT_FOUR=1
pivpnENCRYPT=256
USE_PREDEFINED_DH_PARAM=
INPUT_CHAIN_EDITED=1
FORWARD_CHAIN_EDITED=0
INPUT_CHAIN_EDITEDv6=
FORWARD_CHAIN_EDITEDv6=
pivpnDEV=tun0
pivpnNET=10.114.240.0
subnetClass=24
pivpnenableipv6=0
ALLOWED_IPS=""
UNATTUPG=1
INSTALLED_PACKAGES=(grepcidr bsdmainutils iptables-persistent openvpn unattended-upgrades)
HELP_SHOWN=1
::::  Server configuration shown below   ::::
dev tun
proto udp
port 15275
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/raspberrypi_b11b955e-cc7e-4234-b641-fe00a87e8624.crt
key /etc/openvpn/easy-rsa/pki/private/raspberrypi_b11b955e-cc7e-4234-b641-fe00a87e8624.key
dh none
ecdh-curve prime256v1
topology subnet
server 10.114.240.0 255.255.255.0
# Set your primary domain name server address for clients
push "dhcp-option DNS 10.114.240.1"
push "block-outside-dns"
# Override the Client default gateway by using 0.0.0.0/1 and
# 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of
# overriding but not wiping out the original default gateway.
push "redirect-gateway def1"
client-to-client
client-config-dir /etc/openvpn/ccd
keepalive 15 120
remote-cert-tls client
tls-version-min 1.2
 tls-crypt /etc/openvpn/easy-rsa/pki/ta.key
cipher AES-256-CBC
auth SHA256
user openvpn
group openvpn
persist-key
persist-tun
crl-verify /etc/openvpn/crl.pem
status /var/log/openvpn-status.log 20
status-version 3
syslog
verb 3
#DuplicateCNs allow access control on a less-granular, per user basis.
#Remove # if you will manage access by user instead of device. 
#duplicate-cn
# Generated for use by PiVPN.io
::::  Client template file shown below   ::::
client
dev tun
proto udp
remote REDACTED 15275
resolv-retry infinite
nobind
remote-cert-tls server
tls-version-min 1.2
verify-x509-name raspberrypi_b11b955e-cc7e-4234-b641-fe00a87e8624 name
cipher AES-256-CBC
auth SHA256
auth-nocache
verb 3
=============================================
::::    Recursive list of files in       ::::

::: /etc/openvpn/easy-rsa/pki shows below :::
/etc/openvpn/easy-rsa/pki/:
ca.crt
crl.pem
Default.txt
index.txt
index.txt.attr
index.txt.attr.old
index.txt.old
IPhone.ovpn
issued
MacBook.ovpn
openssl-easyrsa.cnf
private
revoked
safessl-easyrsa.cnf
serial
serial.old
ta.key
vars
vars.example

/etc/openvpn/easy-rsa/pki/issued:
IPhone.crt
MacBook.crt
raspberrypi_b11b955e-cc7e-4234-b641-fe00a87e8624.crt

/etc/openvpn/easy-rsa/pki/private:
ca.key
IPhone.key
MacBook.key
raspberrypi_b11b955e-cc7e-4234-b641-fe00a87e8624.key

/etc/openvpn/easy-rsa/pki/revoked:
private_by_serial
reqs_by_serial

/etc/openvpn/easy-rsa/pki/revoked/private_by_serial:

/etc/openvpn/easy-rsa/pki/revoked/reqs_by_serial:
=============================================
::::            Self check               ::::
:: [OK] IP forwarding is enabled
:: [OK] Iptables MASQUERADE rule set
:: [OK] Iptables INPUT rule set
:: [OK] OpenVPN is running
:: [OK] OpenVPN is enabled 
(it will automatically start on reboot)
:: [OK] OpenVPN is listening on port 15275/udp

I hope I wrote everything you need and for every other command output you need please ask.