Can't ping other pc when OpenVPN runs

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
Forssux
OpenVpn Newbie
Posts: 1
Joined: Tue Jun 14, 2022 4:14 pm

Can't ping other pc when OpenVPN runs

Post by Forssux » Tue Jun 14, 2022 4:36 pm

Hi there,

I have in a LXC container on Proxmox OpenVPN running.
It gives ip's in the range of 192.168.20.0.
When I stop OpenVPN with "systemctl stop openvpn" I can ping 192.168.1.1 which is what I want.
However when I do "systemctl restart openvpn" I can't ping anymore from that container.

I noticed that in the script firewall rules are added upon starting and removed when the OpenVPN connection is stopped.
When I launch the add firewall rules without starting the OpenVPN I can ping.
Can somebody explain me why this is the case?

server.conf

port 21209
proto udp
dev tun
persist-key
persist-tun
keepalive 10 120
server 192.168.20.0 255.255.255.0
ifconfig 192.168.20.1 192.168.1.254
push "route 192.168.20.0 255.255.255.0"
push "dhcp-option DNS 192.168.1.6"
push "route 192.168.1.0 255.255.255.0"
route 192.168.20.0 255.255.255.0
route 192.168.1.0 255.255.255.0
client-to-client
client-config-dir /etc/openvpn/ccd
ccd-exclusive
mode server
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key
crl-verify crl.pem
ca ca.crt
cert server_gdnOOIa7FEp8uEW5.crt
key server_gdnOOIa7FEp8uEW5.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
status /var/log/openvpn/status.log
log /var/log/openvpn/openvpn.log
verb 4
# This is the end
Last edited by Forssux on Wed Jun 15, 2022 12:23 pm, edited 1 time in total.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Can't ping other pc when OpenVPN runs

Post by TinCanTech » Tue Jun 14, 2022 5:57 pm

Your config is a mess.

There is no --server

Do not use --ncp-disable

It looks like you have configured openvpn to route your local LAN into the tunnel.

Please read the howto.

And buy a book about networking.

Post Reply