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