I had my openvpn client working fine and my pi crashed. I have installed new os and reset up my openvpn client setup and had all the trouble in the world.
I had an issue where this fixed it
https://forums.openvpn.net/viewtopic.php?t=27419 and finally got it running. ( I didnt have to do this last time I set it up)
But
when the Pi turns on and automatically connects to the vpn server I now lose ssh access and cant ping the device.
I used to be able to connect via the local ip or the vpn ip. now cant ping either.
server is setup on my router
pretty sure I setup the files with easyrsa2.x
please bear with me im quite limited in my linux/openvpn knowledge I think its something to do with routes but not sure what to do.
client
dev tun
proto tcp
remote my.ddns.net 1194
nobind
persist-key
persist-tun
verb 4
float
ca ca.crt
cert Pi.crt
key Pi.key
comp-lzo yes
tun-mtu 1500
auth SHA256
cipher AES-128-CBC
auth-user-pass /etc/openvpn/auth.txt
this is the settings for the server on my router
OpenVPN Server/Daemon
OpenVPN Enable
Start Type WAN
Config as Server
Server mode Router (TUN)
Network 192.168.1.0
Netmask 255.255.255.0
Port 1194 (Default: 1194)
Tunnel Protocol TCP (Default: UDP)
Encryption Cipher AES-128 CBC
Hash Algorithm SHA256
Advanced Options Enable
TLS Cipher None
LZO Compression Adaptive
Redirect default Gateway Disable
Allow Client to Client Enable
Allow duplicate cn Disable
Tunnel MTU setting 1500 (Default: 1400)
Tunnel UDP Fragment (Default: Disable)
Tunnel UDP MSS-Fix Disable
CCD-Dir DEFAULT file
Additional Config
# Routes VPN to LAN
push "route 192.168.0.0 255.255.255.0 vpn_gateway"
i dont even know if the push route there is correct
my lan ip is 192.168.0.x
my vpn ip is 192.168.1.x
side note. vpn on my phone works fine same config setup and can access my lan or vpn connections while out and about but I lose access to internet when connected to the vpn.
this is a copy of my server log from when the Pi connects
[olog]20211221 07:33:21 I TCP connection established with [AF_INET]192.168.0.54:56224
20211221 07:33:21 192.168.0.54:56224 TLS: Initial packet from [AF_INET]192.168.0.54:56224 sid=08b4b1f9 cc985f99
20211221 07:33:22 192.168.0.54:56224 VERIFY OK: depth=1 CN=AAA11
20211221 07:33:22 192.168.0.54:56224 VERIFY OK: depth=0 CN=Pi
20211221 07:33:22 W 192.168.0.54:56224 WARNING: 'link-mtu' is used inconsistently local='link-mtu 1572' remote='link-mtu 1571'
20211221 07:33:22 W 192.168.0.54:56224 WARNING: 'comp-lzo' is present in local config but missing in remote config local='comp-lzo'
20211221 07:33:22 192.168.0.54:56224 Data Channel Encrypt: Cipher 'AES-128-CBC' initialized with 128 bit key
20211221 07:33:22 192.168.0.54:56224 Data Channel Encrypt: Using 256 bit message hash 'SHA256' for HMAC authentication
20211221 07:33:22 192.168.0.54:56224 Data Channel Decrypt: Cipher 'AES-128-CBC' initialized with 128 bit key
20211221 07:33:22 192.168.0.54:56224 NOTE: --mute triggered...
20211221 07:33:22 192.168.0.54:56224 2 variation(s) on previous 3 message(s) suppressed by --mute
20211221 07:33:22 I 192.168.0.54:56224 [Pi] Peer Connection Initiated with [AF_INET]192.168.0.54:56224
20211221 07:33:22 I Pi/192.168.0.54:56224 MULTI_sva: pool returned IPv4=192.168.1.3 IPv6=(Not enabled)
20211221 07:33:22 Pi/192.168.0.54:56224 OPTIONS IMPORT: reading client specific options from: /tmp/openvpn_cc_1de90037b0158344a1694c09119d6d8f.tmp
20211221 07:33:22 Pi/192.168.0.54:56224 MULTI: Learn: 192.168.1.3 -> Pi/192.168.0.54:56224
20211221 07:33:22 Pi/192.168.0.54:56224 MULTI: primary virtual IP for Pi/192.168.0.54:56224: 192.168.1.3
20211221 07:33:23 Pi/192.168.0.54:56224 PUSH: Received control message: 'PUSH_REQUEST'
20211221 07:33:23 I Pi/192.168.0.54:56224 send_push_reply(): safe_cap=940
20211221 07:33:23 Pi/192.168.0.54:56224 SENT CONTROL [Pi]: 'PUSH_REPLY route 192.168.0.1 255.255.255.0 vpn_gateway route-gateway 192.168.1.1 topology subnet ping 10 ping-restart 120 socket-flags TCP_NODELAY ifconfig 192.168.1.3 255.255.255.0' (status=1)
20211221 07:33:30 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20211221 07:33:30 D MANAGEMENT: CMD 'state'
20211221 07:33:30 MANAGEMENT: Client disconnected
20211221 07:33:30 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20211221 07:33:30 D MANAGEMENT: CMD 'state'
20211221 07:33:30 MANAGEMENT: Client disconnected
20211221 07:33:30 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20211221 07:33:30 D MANAGEMENT: CMD 'state'
20211221 07:33:30 MANAGEMENT: Client disconnected
20211221 07:33:30 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20211221 07:33:30 MANAGEMENT: Client disconnected
20211221 07:33:30 NOTE: --mute triggered...
20211221 07:33:30 1 variation(s) on previous 3 message(s) suppressed by --mute
20211221 07:33:30 D MANAGEMENT: CMD 'status 2'
20211221 07:33:30 MANAGEMENT: Client disconnected
20211221 07:33:30 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20211221 07:33:30 D MANAGEMENT: CMD 'status 2'
20211221 07:33:30 MANAGEMENT: Client disconnected
20211221 07:33:30 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20211221 07:33:30 D MANAGEMENT: CMD 'log 500'
19700101 10:30:00
dh /tmp/openvpn/dh.pem ca /tmp/openvpn/ca.crt cert /tmp/openvpn/cert.pem key /tmp/openvpn/key.pem keepalive 10 120 verb 3 mute 3 syslog writepid /var/run/openvpnd.pid management 127.0.0.1 14 management-log-cache 100 topology subnet script-security 2 port 1194 proto tcp-server cipher aes-128-cbc auth sha256 client-connect /tmp/openvpn/clcon.sh client-disconnect /tmp/openvpn/cldiscon.sh client-config-dir /jffs/etc/openvpn/ccd comp-lzo adaptive tls-server ifconfig-pool-persist /tmp/openvpn/ip-pool 86400 client-to-client tcp-nodelay tun-mtu 1500 mtu-disc yes server 192.168.1.0 255.255.255.0 dev tun2 tun-ipv6 # Routes VPN to LAN push "route 192.168.0.1 255.255.255.0 vpn_gateway"
[/olog]