Openvpn disconnected after signing out in Windows Server
Posted: Mon Jan 24, 2022 3:01 am
Good day! I have some problem my Client Windows Server.
My OpenVPN is already connected in Client Windows Server then I sign out with the RDP user the OpenVPN is automatically disconneting.
Do you have any suggestion how to solve this problem?
[oconf=]
#Server Configuration
daemon openvpn-udp
mlock
cd /etc/openvpn
writepid /var/run/openvpn/server.pid
tls-cipher "DEFAULT:@SECLEVEL=0"
topology subnet
client-config-dir ./ccd-udp
ccd-exclusive
port 1194
proto udp
;dev tap
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh.pem
;server-bridge 10.8.0.1 255.255.255.0 10.8.0.6 10.8.0.255
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
client-connect ./MyConnect-UDP.py
client-disconnect ./MyDisconnect-UDP.py
;server-bridge
push "route 10.2.2.0 255.255.255.0"
push "route 10.0.1.0 255.255.255.0"
;push "route 10.0.2.0 255.255.255.0"
;push "route 10.0.3.0 255.255.255.0"
push "route 192.168.1.0 255.255.255.0"
;ifconfig-push 10.8.1.1 10.8.1.2
;route 10.0.1.0 255.255.255.0
;route 10.0.3.0 255.255.255.0
;route 10.0.2.0 255.255.255.0
route 10.0.1.0 255.255.255.0
route 192.168.1.0 255.255.255.0
;route 192.168.40.128 255.255.255.248
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
learn-address ./MyLearnaddress-UDP
;push "redirect-gateway def1 bypass-dhcp"
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
client-to-client
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-GCM
auth SHA256
;comp-lzo no
user openvpn
group openvpn
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log /var/log/openvpn/openvpn.log
log-append /var/log/openvpn/openvpn.log
verb 3
;mute 20
explicit-exit-notify 1
[/oconf]
[oconf=]
#Client Configuration
client
;dev tap
dev tun
proto udp
remote Server_IP 1194
resolv-retry infinite
nobind
;user nobody
;group nogroup
persist-key
persist-tun
ca ./certs/ca.crt
c;ert ./certs/client1.crt
key ./keys/client1.key
remote-cert-tls server
tls-auth ./keys/ta.key 1
cipher AES-256-GCM
auth SHA256
verb 3
key-direction 1
script-security 2
connect-retry 0
route-delay 5
route-method exe
ip-win32 netsh
[/oconf]
My OpenVPN is already connected in Client Windows Server then I sign out with the RDP user the OpenVPN is automatically disconneting.
Do you have any suggestion how to solve this problem?
[oconf=]
#Server Configuration
daemon openvpn-udp
mlock
cd /etc/openvpn
writepid /var/run/openvpn/server.pid
tls-cipher "DEFAULT:@SECLEVEL=0"
topology subnet
client-config-dir ./ccd-udp
ccd-exclusive
port 1194
proto udp
;dev tap
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh.pem
;server-bridge 10.8.0.1 255.255.255.0 10.8.0.6 10.8.0.255
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
client-connect ./MyConnect-UDP.py
client-disconnect ./MyDisconnect-UDP.py
;server-bridge
push "route 10.2.2.0 255.255.255.0"
push "route 10.0.1.0 255.255.255.0"
;push "route 10.0.2.0 255.255.255.0"
;push "route 10.0.3.0 255.255.255.0"
push "route 192.168.1.0 255.255.255.0"
;ifconfig-push 10.8.1.1 10.8.1.2
;route 10.0.1.0 255.255.255.0
;route 10.0.3.0 255.255.255.0
;route 10.0.2.0 255.255.255.0
route 10.0.1.0 255.255.255.0
route 192.168.1.0 255.255.255.0
;route 192.168.40.128 255.255.255.248
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
learn-address ./MyLearnaddress-UDP
;push "redirect-gateway def1 bypass-dhcp"
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
client-to-client
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-GCM
auth SHA256
;comp-lzo no
user openvpn
group openvpn
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log /var/log/openvpn/openvpn.log
log-append /var/log/openvpn/openvpn.log
verb 3
;mute 20
explicit-exit-notify 1
[/oconf]
[oconf=]
#Client Configuration
client
;dev tap
dev tun
proto udp
remote Server_IP 1194
resolv-retry infinite
nobind
;user nobody
;group nogroup
persist-key
persist-tun
ca ./certs/ca.crt
c;ert ./certs/client1.crt
key ./keys/client1.key
remote-cert-tls server
tls-auth ./keys/ta.key 1
cipher AES-256-GCM
auth SHA256
verb 3
key-direction 1
script-security 2
connect-retry 0
route-delay 5
route-method exe
ip-win32 netsh
[/oconf]