Openvpn problem with mobile router disconnection every 4 hours
Posted: Mon May 03, 2021 3:45 pm
Hi,
I've a connection between an openVPN server on the cloud and an openVPN client installed on a mobile router using a WindTre SIM.
The problem is that the windTre SIM disconnects every for hours for some second (to change IP address) and this cause openvpn to fall and the openvpn reconnection happens after 17 minutes, this is really too much, is there some option to avoid this ugly behaviour ?
these are the configuration on both sides:
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
push "route 172.18.0.0 255.255.0.0"
client-config-dir ccd
route 172.18.0.0 255.255.0.0
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-CBC
auth SHA512
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 5
explicit-exit-notify 1
management localhost 7505
the client configuration instead is:
config openvpn 'ClientRoutedPTPVPN'
option nobind '1'
option dev 'tun0'
option comp_lzo 'yes'
option persist_tun '1'
option persist_key '1'
option client '1'
option pull '1'
option Username 'admin'
option Password '____'
option remote 'XXX.YYY.ZZZ.WWW'
option remote_random '0'
option proto 'udp'
option resolv_retry 'infinite'
option auth 'SHA512'
option cipher 'AES-256-CBC'
option ca '/lib/uci/upload/cbid.openvpn.ClientRoutedPTPVPN.ca'
option cert '/lib/uci/upload/cbid.openvpn.ClientRoutedPTPVPN.cert'
option key '/lib/uci/upload/cbid.openvpn.ClientRoutedPTPVPN.key'
option tls_auth '/etc/openvpn/tlsauth.key 1'
option enable '1'
option verb '4'
option reneg_sec '0'
I've a connection between an openVPN server on the cloud and an openVPN client installed on a mobile router using a WindTre SIM.
The problem is that the windTre SIM disconnects every for hours for some second (to change IP address) and this cause openvpn to fall and the openvpn reconnection happens after 17 minutes, this is really too much, is there some option to avoid this ugly behaviour ?
these are the configuration on both sides:
Server Config
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
push "route 172.18.0.0 255.255.0.0"
client-config-dir ccd
route 172.18.0.0 255.255.0.0
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-CBC
auth SHA512
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 5
explicit-exit-notify 1
management localhost 7505
the client configuration instead is:
Client Config
config openvpn 'ClientRoutedPTPVPN'
option nobind '1'
option dev 'tun0'
option comp_lzo 'yes'
option persist_tun '1'
option persist_key '1'
option client '1'
option pull '1'
option Username 'admin'
option Password '____'
option remote 'XXX.YYY.ZZZ.WWW'
option remote_random '0'
option proto 'udp'
option resolv_retry 'infinite'
option auth 'SHA512'
option cipher 'AES-256-CBC'
option ca '/lib/uci/upload/cbid.openvpn.ClientRoutedPTPVPN.ca'
option cert '/lib/uci/upload/cbid.openvpn.ClientRoutedPTPVPN.cert'
option key '/lib/uci/upload/cbid.openvpn.ClientRoutedPTPVPN.key'
option tls_auth '/etc/openvpn/tlsauth.key 1'
option enable '1'
option verb '4'
option reneg_sec '0'