Page 1 of 1

Server-client confiuration issue in opevpn

Posted: Mon Apr 13, 2020 10:58 am
by hitendra
Hi Team,

I'm new to openvpn and i want to set-up openvpn.

Here is my configuration and question:
    I have a laptop and I'm giving the internet to laptop via mobile's wifi (means created hotspot).
      The same way , I have PC and I'm giving the internet to PC via some other mobile's USB tethering.

      Note : Both mobile have different internet connection . 1st one have JIO and 2nd have Airtel.

      Now, in laptop where my Openvpn server is running I got IP address like 192.168.72.xx and the client means on PC i got 192.168.60.xx. also VPN tunnel is set on 10.8.0.0.

      I got the pubilc IP of server by tying what is my IP in google. I added this in client.conf but not bale to connect to openvpn server.

      Can anyone help me ? what is that I'm doing wrong here ??
      Server config

      port 1194
      proto tcp

      dev tun
      ca /etc/openvpn/keys/ca.crt
      cert /etc/openvpn//keys/server.crt
      key /etc/openvpn/keys/server.key # This file should be kept secret
      dh /etc/openvpn/keys/dh2048.pem

      # Network topology
      topology subnet

      server 10.8.0.0 255.255.255.0

      ifconfig-pool-persist ipp.txt
      push "redirect-gateway def1 "
      push "dhcp-option DNS 10.8.0.1"
      client-to-client
      keepalive 60 120

      cipher AES-256-CBC # AES
      auth SHA256
      comp-lzo no
      max-clients 100
      user nobody
      group nogroup

      persist-key
      persist-tun
      status openvpn-status.log
      verb 6

      Client config

      client

      dev tun
      proto tcp
      remote 150.129.140.205 1194 tcp-client
      remote-random
      resolv-retry infinite
      nobind
      user nobody
      group nogroup
      persist-key
      persist-tun

      ca /etc/openvpn/keys/ca.crt
      cert /etc/openvpn/keys/gama.crt
      key /etc/openvpn/keys/gama.key
      remote-cert-tls server
      cipher AES-256-CBC
      auth SHA256

      topology subnet
      pull
      comp-lzo no
      route-delay 4
      verb 6

      Can anyone help me ? what is that I'm doing wrong here ??

      Regards,
      Hitendra Prajapati

      Re: Server-client confiuration issue in opevpn

      Posted: Tue Apr 14, 2020 12:16 pm
      by hitendra
      any help on this issue ??

      Re: Server-client confiuration issue in opevpn

      Posted: Tue Apr 14, 2020 12:45 pm
      by TinCanTech
      If your server log does not show any failed connection attempts then you have not setup your network correctly.

      You need to forward the correct port on your external router.

      If you are at home then test openvpn by using your local LAN IP of the server: 192.168.72.xx

      Re: Server-client confiuration issue in opevpn

      Posted: Thu Apr 16, 2020 10:26 am
      by hitendra
      Hi @TinCanTech

      Thank you for your feedback.

      As I mention in question that I'm not using router. I'm using the mobile networks .

      SO how can I forward the port in mobile connection ?? I think no external router here ?? what can you say about that ??

      Both mobile connection can get public IP ,but not able to ping each other .
      what can i do for that, at least they can ping each other ?

      Re: Server-client confiuration issue in opevpn

      Posted: Tue May 05, 2020 10:15 am
      by hitendra
      Hi any help for the issue ?

      Re: Server-client confiuration issue in opevpn

      Posted: Tue May 05, 2020 11:56 am
      by TinCanTech
      hitendra wrote:
      Mon Apr 13, 2020 10:58 am
      Both mobile have different internet connection . 1st one have JIO and 2nd have Airtel.

      Now, in laptop where my Openvpn server is running I got IP address like 192.168.72.xx and the client means on PC i got 192.168.60.xx. also VPN tunnel is set on 10.8.0.0.

      I got the pubilc IP of server by tying what is my IP in google
      Those are not viable internet addresses.

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

      Re: Server-client confiuration issue in opevpn

      Posted: Tue May 05, 2020 12:06 pm
      by 300000
      you need to call to your mobile phone which you make hotspot for your server connect to open port first , and from hot spot on your mobile phone you need using iptables to fordward port to your server so after that you can connec from client to your server .

      nobody try to make server running from hop spot from the phone , if you want to do that the best is rent a host on the net and make site to site connection so from everywhere you can connect.

      if you want to run server you need to have an static ip or at least real ip on internet , mobile phone provider never give to you a real ip address how can you connect ?

      Re: Server-client confiuration issue in opevpn

      Posted: Mon May 18, 2020 3:43 am
      by hitendra
      Hi Team,

      I just drop the idea fro openvpn client and server using two mobile.

      My question as below :

      I have a gateway with GSM modem on it. It have airtel SIM card and i got IP 100.90.10.xxx . I started the Openvpn server on this gateway.

      Now , using my laptop which have wifi from my mobile's internet (Jio connection) got IP 192.168.43.42 .

      I run openvpn client on this laptop but not able to connect OpenVPN server run on the gateway.

      I already enable IPV4 net.ipv4.ip_forward=1 and also forward he port 1194.

      Still why i'm not connected to server ?? what is am I the missing here ?

      I got error like timeout for TLS hanshake to server and It will start again to connect the server .

      Please help me .

      Re: Server-client confiuration issue in opevpn

      Posted: Tue May 19, 2020 3:27 am
      by hitendra
      Hi team.
      any Help on this ?

      Re: Server-client confiuration issue in opevpn

      Posted: Tue May 19, 2020 10:04 am
      by TinCanTech
      Perhaps your internet provider does not allow such connections .. but this is not something we can help with.

      Check your server log for failed connection attempts ..

      Re: Server-client confiuration issue in opevpn

      Posted: Wed May 20, 2020 1:56 am
      by 300000
      he doesnt have internet sevice provider at all , he want to use sim card for internet connection and get internet from simcard , i told you cant do it , there is no way you can do it , simcar internet dont give you real ip address so you cant connect to it , they use CG-NAT so forget what you want to do , just buy vpn somewhene to use it and make site to site connection so from two point you can communication