Server-client confiuration issue in opevpn

Need help configuring your VPN? Just post here and you'll get that help.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
hitendra
OpenVpn Newbie
Posts: 9
Joined: Mon Apr 13, 2020 10:38 am

Server-client confiuration issue in opevpn

Post by hitendra » Mon Apr 13, 2020 10:58 am

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
      Last edited by Pippin on Mon Apr 13, 2020 11:03 am, edited 1 time in total.
      Reason: Formatting

      hitendra
      OpenVpn Newbie
      Posts: 9
      Joined: Mon Apr 13, 2020 10:38 am

      Re: Server-client confiuration issue in opevpn

      Post by hitendra » Tue Apr 14, 2020 12:16 pm

      any help on this issue ??

      User avatar
      TinCanTech
      OpenVPN Protagonist
      Posts: 7145
      Joined: Fri Jun 03, 2016 1:17 pm

      Re: Server-client confiuration issue in opevpn

      Post by TinCanTech » Tue Apr 14, 2020 12:45 pm

      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

      hitendra
      OpenVpn Newbie
      Posts: 9
      Joined: Mon Apr 13, 2020 10:38 am

      Re: Server-client confiuration issue in opevpn

      Post by hitendra » Thu Apr 16, 2020 10:26 am

      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 ?

      hitendra
      OpenVpn Newbie
      Posts: 9
      Joined: Mon Apr 13, 2020 10:38 am

      Re: Server-client confiuration issue in opevpn

      Post by hitendra » Tue May 05, 2020 10:15 am

      Hi any help for the issue ?

      User avatar
      TinCanTech
      OpenVPN Protagonist
      Posts: 7145
      Joined: Fri Jun 03, 2016 1:17 pm

      Re: Server-client confiuration issue in opevpn

      Post by TinCanTech » Tue May 05, 2020 11:56 am

      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

      300000
      OpenVPN Power User
      Posts: 153
      Joined: Tue May 01, 2012 9:30 pm

      Re: Server-client confiuration issue in opevpn

      Post by 300000 » Tue May 05, 2020 12:06 pm

      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 ?

      hitendra
      OpenVpn Newbie
      Posts: 9
      Joined: Mon Apr 13, 2020 10:38 am

      Re: Server-client confiuration issue in opevpn

      Post by hitendra » Mon May 18, 2020 3:43 am

      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 .

      hitendra
      OpenVpn Newbie
      Posts: 9
      Joined: Mon Apr 13, 2020 10:38 am

      Re: Server-client confiuration issue in opevpn

      Post by hitendra » Tue May 19, 2020 3:27 am

      Hi team.
      any Help on this ?

      User avatar
      TinCanTech
      OpenVPN Protagonist
      Posts: 7145
      Joined: Fri Jun 03, 2016 1:17 pm

      Re: Server-client confiuration issue in opevpn

      Post by TinCanTech » Tue May 19, 2020 10:04 am

      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 ..

      300000
      OpenVPN Power User
      Posts: 153
      Joined: Tue May 01, 2012 9:30 pm

      Re: Server-client confiuration issue in opevpn

      Post by 300000 » Wed May 20, 2020 1:56 am

      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

      Post Reply