hello, i am having trouble with the openvpn docker continuously disconnecting and reconnecting, sometimes it stays connected for 5 6 minutes, then it disconnects again, and try to reconnect again, i am connecting it to hotspot shield vpn service, the .ovpn is get from their website, both the file vpn.ovpn and vpn.auth is detected and used as it should, the ovpn file is:
client
dev tun
proto udp
remote braincontrols.us 8041
verify-x509-name braincontrols.us name
resolv-retry infinite
remote-random
nobind
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
ping 15
ping-restart 0
reneg-sec 0
remote-cert-tls server
comp-noadapt
auth-user-pass
auth sha256
cipher AES-128-CBC
verb 3
<cert>
-----BEGIN CERTIFICATE-----
blablabla
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
blablabla
-----END PRIVATE KEY-----
</key>
<ca>
-----BEGIN CERTIFICATE-----
blablabla
-----END CERTIFICATE-----
</ca>
the logs for the container is:
Killed
# Warning: iptables-legacy tables present, use iptables-legacy to see them
Error: ipv4: FIB table does not exist.
Dump terminated
+ exec sg vpn -c 'openvpn --cd /vpn --config /vpn/vpn.ovpn --script-security 2 --redirect-gateway def1 --route-up '\''/bin/sh -c " iptables -A OUTPUT -d 127.0.0.11 -j ACCEPT"'\'' --route-pre-down '\''/bin/sh -c " iptables -D OUTPUT -d 127.0.0.11 -j ACCEPT"'\'' --auth-user-pass /vpn/vpn.auth --mute-replay-warnings '
2024-11-02 17:08:46 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
2024-11-02 17:08:46 VERIFY EKU OK
2024-11-02 17:08:46 VERIFY X509NAME OK: CN=braincontrols.us
2024-11-02 17:08:46 VERIFY OK: depth=0, CN=braincontrols.us
2024-11-02 17:08:46 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 2048 bit RSA, signature: RSA-SHA256
2024-11-02 17:08:46 [braincontrols.us] Peer Connection Initiated with [AF_INET]139.28.218.164:8041
2024-11-02 17:08:46 TLS: move_session: dest=TM_ACTIVE src=TM_INITIAL reinit_src=1
2024-11-02 17:08:46 TLS: tls_multi_process: initial untrusted session promoted to trusted
2024-11-02 17:08:47 SENT CONTROL [braincontrols.us]: 'PUSH_REQUEST' (status=1)
2024-11-02 17:08:47 PUSH: Received control message: 'PUSH_REPLY,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,explicit-exit-notify,sndbuf 16384,rcvbuf 262144,dhcp-option DISABLE-NBT,redirect-gateway def1 bypass-dhcp,route-delay 5,inactive 172800 2048,route-gateway 10.254.128.1,topology subnet,ping 10,ping-restart 120,compress stub-v2,ifconfig 10.254.128.25 255.255.128.0,peer-id 24,cipher AES-256-GCM'
2024-11-02 17:08:47 WARNING: You have specified redirect-gateway and redirect-private at the same time (or the same option multiple times). This is not well supported and may lead to unexpected results
2024-11-02 17:08:47 OPTIONS IMPORT: --sndbuf/--rcvbuf options modified
2024-11-02 17:08:47 Socket Buffers: R=[212992->524288] S=[212992->32768]
2024-11-02 17:08:47 OPTIONS IMPORT: --ifconfig/up options modified
2024-11-02 17:08:47 OPTIONS IMPORT: route options modified
2024-11-02 17:08:47 OPTIONS IMPORT: route-related options modified
2024-11-02 17:08:47 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
2024-11-02 17:08:47 net_route_v4_best_gw query: dst 0.0.0.0
2024-11-02 17:08:47 net_route_v4_best_gw result: via 172.18.0.1 dev eth0
2024-11-02 17:08:47 ROUTE_GATEWAY 172.18.0.1/255.255.0.0 IFACE=eth0 HWADDR=02:42:ac:12:00:04
2024-11-02 17:08:47 TUN/TAP device tun0 opened
2024-11-02 17:08:47 net_iface_mtu_set: mtu 1500 for tun0
2024-11-02 17:08:47 net_iface_up: set tun0 up
2024-11-02 17:08:47 net_addr_v4_add: 10.254.128.25/17 dev tun0
2024-11-02 17:08:47 Data Channel: cipher 'AES-256-GCM', peer-id: 24, compression: 'stubv2'
2024-11-02 17:08:47 Timers: ping 10, ping-restart 120, inactive 172800 2048
2024-11-02 17:08:47 Protocol options: explicit-exit-notify 1
2024-11-02 17:08:52 net_route_v4_add: 139.28.218.164/32 via 172.18.0.1 dev [NULL] table 0 metric -1
2024-11-02 17:08:52 net_route_v4_add: 0.0.0.0/1 via 10.254.128.1 dev [NULL] table 0 metric -1
2024-11-02 17:08:52 net_route_v4_add: 128.0.0.0/1 via 10.254.128.1 dev [NULL] table 0 metric -1
2024-11-02 17:08:52 Initialization Sequence Completed
---Ping from 8.8.8.8 failed, restarting container,...---
---Checking for optional scripts---
---No optional script found, continuing---
---Taking ownership of data...---
---Starting...---
---Starting service for connected containers on port: 27286---
2024-11-02 17:09:08 DEPRECATED OPTION: --cipher set to 'AES-128-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305). OpenVPN ignores --cipher for cipher negotiations.
2024-11-02 17:09:08 Note: Kernel support for ovpn-dco missing, disabling data channel offload.
2024-11-02 17:09:08 OpenVPN 2.6.3 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] [DCO]
2024-11-02 17:09:08 library versions: OpenSSL 3.0.14 4 Jun 2024, LZO 2.10
2024-11-02 17:09:08 DCO version: N/A
2024-11-02 17:09:08 WARNING: --ping should normally be used with --ping-restart or --ping-exit
2024-11-02 17:09:08 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
2024-11-02 17:09:08 TCP/UDP: Preserving recently used remote address: [AF_INET]139.28.218.166:8041
2024-11-02 17:09:08 Socket Buffers: R=[212992->212992] S=[212992->212992]
2024-11-02 17:09:08 UDPv4 link local: (not bound)
2024-11-02 17:09:08 UDPv4 link remote: [AF_INET]139.28.218.166:8041
2024-11-02 17:09:08 TLS: Initial packet from [AF_INET]139.28.218.166:8041, sid=6cb58e9c 08a46604
2024-11-02 17:09:08 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
2024-11-02 17:09:08 VERIFY OK: depth=2, C=US, O=Internet Security Research Group, CN=ISRG Root X1
2024-11-02 17:09:08 VERIFY OK: depth=1, C=US, O=Let's Encrypt, CN=R11
2024-11-02 17:09:08 VERIFY KU OK
2024-11-02 17:09:08 Validating certificate extended key usage
2024-11-02 17:09:08 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
2024-11-02 17:09:08 VERIFY EKU OK
2024-11-02 17:09:08 VERIFY X509NAME OK: CN=braincontrols.us
2024-11-02 17:09:08 VERIFY OK: depth=0, CN=braincontrols.us
2024-11-02 17:09:08 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 2048 bit RSA, signature: RSA-SHA256
2024-11-02 17:09:08 [braincontrols.us] Peer Connection Initiated with [AF_INET]139.28.218.166:8041
2024-11-02 17:09:08 TLS: move_session: dest=TM_ACTIVE src=TM_INITIAL reinit_src=1
2024-11-02 17:09:08 TLS: tls_multi_process: initial untrusted session promoted to trusted
2024-11-02 17:09:09 SENT CONTROL [braincontrols.us]: 'PUSH_REQUEST' (status=1)
2024-11-02 17:09:09 PUSH: Received control message: 'PUSH_REPLY,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,explicit-exit-notify,sndbuf 16384,rcvbuf 262144,dhcp-option DISABLE-NBT,redirect-gateway def1 bypass-dhcp,route-delay 5,inactive 172800 2048,route-gateway 10.254.128.1,topology subnet,ping 10,ping-restart 120,compress stub-v2,ifconfig 10.254.128.26 255.255.128.0,peer-id 25,cipher AES-256-GCM'
2024-11-02 17:09:09 WARNING: You have specified redirect-gateway and redirect-private at the same time (or the same option multiple times). This is not well supported and may lead to unexpected results
2024-11-02 17:09:09 OPTIONS IMPORT: --sndbuf/--rcvbuf options modified
2024-11-02 17:09:09 Socket Buffers: R=[212992->524288] S=[212992->32768]
2024-11-02 17:09:09 OPTIONS IMPORT: --ifconfig/up options modified
2024-11-02 17:09:09 OPTIONS IMPORT: route options modified
2024-11-02 17:09:09 OPTIONS IMPORT: route-related options modified
2024-11-02 17:09:09 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
2024-11-02 17:09:09 net_route_v4_best_gw query: dst 0.0.0.0
2024-11-02 17:09:09 net_route_v4_best_gw result: via 172.18.0.1 dev eth0
2024-11-02 17:09:09 ROUTE_GATEWAY 172.18.0.1/255.255.0.0 IFACE=eth0 HWADDR=02:42:ac:12:00:04
2024-11-02 17:09:09 TUN/TAP device tun0 opened
2024-11-02 17:09:09 net_iface_mtu_set: mtu 1500 for tun0
2024-11-02 17:09:09 net_iface_up: set tun0 up
2024-11-02 17:09:09 net_addr_v4_add: 10.254.128.26/17 dev tun0
2024-11-02 17:09:09 Data Channel: cipher 'AES-256-GCM', peer-id: 25, compression: 'stubv2'
2024-11-02 17:09:09 Timers: ping 10, ping-restart 120, inactive 172800 2048
2024-11-02 17:09:09 Protocol options: explicit-exit-notify 1
2024-11-02 17:09:14 net_route_v4_add: 139.28.218.166/32 via 172.18.0.1 dev [NULL] table 0 metric -1
2024-11-02 17:09:14 net_route_v4_add: 0.0.0.0/1 via 10.254.128.1 dev [NULL] table 0 metric -1
2024-11-02 17:09:14 net_route_v4_add: 128.0.0.0/1 via 10.254.128.1 dev [NULL] table 0 metric -1
2024-11-02 17:09:14 Initialization Sequence Completed
is there anything that i could do to make this connection smoother and persistent?
thank you for your time