VPN stop browsing after few minutes

Need help configuring your VPN? Just post here and you'll get that help.

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
sohaibk
OpenVpn Newbie
Posts: 16
Joined: Thu Jun 10, 2021 11:27 am

VPN stop browsing after few minutes

Post by sohaibk » Thu Jun 10, 2021 12:13 pm

Hi there,

I have setup and openvpn TCP/UDP protocol successfully but my issue is that when i connect the client to VPN it get connected successfully but after few minutes my internet stop working, whereas my VPN is connected fine.
I even cannot ping the gateway IP of VPN server it completely disconnect me to internet.

Here is my configuration of SERVER:

Code: Select all

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
dh dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
tls-crypt myvpn.tlsauth
cipher AES-256-CBC
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
log         openvpn.log
log-append  openvpn.log
verb 3
explicit-exit-notify 1

My client config

Code: Select all

client
tls-client
ca ca.crt
cert client.crt
key client.key
tls-crypt myvpn.tlsauth
;remote-cert-eku "TLS Web Client Authentication"
proto udp
remote xxx.xxx.xxx.xxx 1194 udp
dev tun
topology subnet
pull
user nobody
group nobody

does this issue has something related to ISP provider?

Please help me in this situation i need to fix it

thanks in advnace.

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

Re: VPN stop browsing after few minutes

Post by TinCanTech » Thu Jun 10, 2021 12:55 pm

Set --verb 4 and see your logs for problems.

sohaibk
OpenVpn Newbie
Posts: 16
Joined: Thu Jun 10, 2021 11:27 am

Re: VPN stop browsing after few minutes

Post by sohaibk » Thu Jun 10, 2021 2:06 pm

Hi,

Thanks for you reponse.

I have set verbs 4 in server config but it only shows the logs while connecting to server but nothing show while browsing

http://i.prntscr.com/hff9GF0ASOqSQ1HMC6NcBQ.png

please see the logs

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

Re: VPN stop browsing after few minutes

Post by TinCanTech » Thu Jun 10, 2021 2:26 pm

sohaibk wrote:
Thu Jun 10, 2021 12:13 pm
i connect the client to VPN it get connected successfully but after few minutes my internet stop working
If the VPN is dropped then it will be logged, wait for the log to update.

sohaibk
OpenVpn Newbie
Posts: 16
Joined: Thu Jun 10, 2021 11:27 am

Re: VPN stop browsing after few minutes

Post by sohaibk » Thu Jun 10, 2021 3:20 pm

VPN does not drop, it keep the vpn connected but we cannot browse anything neither we can ping anything.

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

Re: VPN stop browsing after few minutes

Post by TinCanTech » Thu Jun 10, 2021 4:32 pm

Then it is not openvpn at fault.

Either your server is doing something to change it's network configuration or somebody outside is blocking you.

sohaibk
OpenVpn Newbie
Posts: 16
Joined: Thu Jun 10, 2021 11:27 am

Re: VPN stop browsing after few minutes

Post by sohaibk » Fri Jun 11, 2021 9:01 am

what could be the possible reason? as internet works fine right after connecting VPN, but after few minutes it stop working, but the VPN is connected.

Is there anything related to Encrption or something? or anything related to ISP?

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

Re: VPN stop browsing after few minutes

Post by TinCanTech » Fri Jun 11, 2021 9:12 am

Need to see your logs ..

viewtopic.php?f=30&t=22603#p68963

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: VPN stop browsing after few minutes

Post by 300000 » Fri Jun 11, 2021 10:27 am

You need IPforward and NAT at your server. at the moment it only can ping 10.8.0.1 only.

open terminal and type
sudo su

/proc/sys/net/ipv4/ip_forward =1


this make IPforward then

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

this is NAT so client can find the way get out to internet.

sohaibk
OpenVpn Newbie
Posts: 16
Joined: Thu Jun 10, 2021 11:27 am

Re: VPN stop browsing after few minutes

Post by sohaibk » Fri Jun 11, 2021 1:33 pm

Hi,

Thanks for your reponse,

I have already set this, but the problem is when i connect the VPN it works find just for few minut or sometime few seconds, i can ping gateway I can ping 8.8.8.8 and other Internet IP, but after few seconds it stop everything, i cannot ping gateway as well 10.8.0.1

but the status of my VPN is connected

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: VPN stop browsing after few minutes

Post by 300000 » Fri Jun 11, 2021 1:42 pm

You need look at log to see what happened after connected. Something is wrong so it stop working. Without log nobody know why.

sohaibk
OpenVpn Newbie
Posts: 16
Joined: Thu Jun 10, 2021 11:27 am

Re: VPN stop browsing after few minutes

Post by sohaibk » Fri Jun 11, 2021 7:29 pm

300000 wrote:
Fri Jun 11, 2021 1:42 pm
You need look at log to see what happened after connected. Something is wrong so it stop working. Without log nobody know why.
http://i.prntscr.com/hff9GF0ASOqSQ1HMC6NcBQ.png

this is my server logs, it does not log anything once my internet stop working.

i have tested this on other PC as well, same result

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

Re: VPN stop browsing after few minutes

Post by TinCanTech » Fri Jun 11, 2021 7:47 pm

What sort of machine is your server and where is it ?

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: VPN stop browsing after few minutes

Post by 300000 » Fri Jun 11, 2021 8:18 pm

that log show nothing at all . event not full log so how do people know what is wrong with?

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

Re: VPN stop browsing after few minutes

Post by TinCanTech » Fri Jun 11, 2021 8:36 pm

300000 wrote:
Fri Jun 11, 2021 8:18 pm
that log show nothing at all
Because it is not openvpn going wrong, it is either his server or ISP doing the block.

sohaibk
OpenVpn Newbie
Posts: 16
Joined: Thu Jun 10, 2021 11:27 am

Re: VPN stop browsing after few minutes

Post by sohaibk » Mon Jun 14, 2021 1:32 pm

TinCanTech wrote:
Fri Jun 11, 2021 7:47 pm
What sort of machine is your server and where is it ?
I have installed server on Centos7
the machine is hosted on cloud in Netharland

sohaibk
OpenVpn Newbie
Posts: 16
Joined: Thu Jun 10, 2021 11:27 am

Re: VPN stop browsing after few minutes

Post by sohaibk » Mon Jun 14, 2021 1:33 pm

TinCanTech wrote:
Fri Jun 11, 2021 8:36 pm
300000 wrote:
Fri Jun 11, 2021 8:18 pm
that log show nothing at all
Because it is not openvpn going wrong, it is either his server or ISP doing the block.
I know this log does not show anything, but the situation is it does not disconenct the VPN, it only stopped me to access internet. i can only ping the Main IP of server on which i conencted the VPN, i cannot even ping the VPN gateway IP 10.8.0.1

Post Reply