0

I'm trying to set up a VPN-server from my home router so that external users (from other countries) could connect to it. Basically, I want it to work this way:

External User (IP-address "A") -> connect to my home VPN-server (IP-address "B") -> search web with IP-address "B".

I've watched many YT-guides, which I followed thoroughly and step by step, but I'm not sure it works, since another device's IP-address doesn't change.

I've done so far:

  • set up a DDNS adderss;
  • set up an OpenVPN server in my router settings;
  • exported a config and uploaded it into OpenVPN GUI;
  • after some googling added redirect-gateway def1 / push "redirect-gateway def1". Unfortunately, none of these have worked so far.

Some sources say I need a statip IP address to make it work.

Any advice on this issue? And more importantly, is the info about a static IP correct?

UPDATE:

  1. Somehow I managed to make it work on both Android and iOS devices. IP-address changes to the one provided in the config file.
  2. However, the same config (or its copy) doesn't work on any PC (have tried on windows and macos so far). 2a. When I use the same config I get the following error:
     Options error: unknown --redirect-gateway flag: ipv4 
    When I fix it, another error occurs: 2b.
    OPTIONS ERROR: failed to negotiate cipher with server. Configure --data-ciphers-fallback if you want to connect to this server.
    2023-09-02 17:08:18 ERROR: Failed to apply push options
    2023-09-02 17:08:18 Failed to open tun/tap interface
    
    2c. When I add
     data-ciphers-fallback "AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305" 
    I manage to connect, however the Internet is not accessible and VPN keeps reconnecting all the time.

This is config through which I connect on mobile devices:

 client
dev tun
proto tcp
float
nobind
tls-client
remote-cert-tls server
cipher AES-128-CBC
comp-lzo adaptive
resolv-retry infinite
persist-key
persist-tun
remote username.tplinkdns.com port
redirect-gateway def1 ipv4
register-dns

Config I try to use on Windows:

client
dev tun
proto tcp
float
nobind
tls-client
remote-cert-tls server
data-ciphers-fallback "AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305"
comp-lzo adaptive
resolv-retry infinite
persist-key
persist-tun
remote username.tplinkdns.com port
redirect-gateway def1
register-dns

UPDATE 2: Client config:

client
dev tun
proto tcp
float
nobind
cipher AES-128-CBC
comp-lzo adaptive
resolv-retry infinite
persist-key
persist-tun
remote username.tplinkdns.com port
redirect-gateway def1

Server config:

client
dev tun
proto tcp
float
nobind
cipher AES-128-CBC
comp-lzo adaptive
resolv-retry infinite
persist-key
persist-tun
remote *inner IP-address starting with 10.* the same port
8
  • got it, thank you
    – JunGi
    Sep 1 at 15:56
  • In addition to what was written above, you will probably need to setup port forwarding on your router, so that users on the WAN side of your router can reach the VPN server on the LAN side of the router.
    – mti2935
    Sep 1 at 18:49
  • Please post your OpenVPN client and server configs (please anonymize DDNS and port #)
    – JW0914
    Sep 2 at 12:46
  • @JW0914 Hello. I've updated the post. Can you check, please.
    – JunGi
    Sep 2 at 14:47
  • @JunGi Please also post the server config - both server and client config are required to troubleshoot. If unable to get the server config in text form from your router, please screenshot all OpenVPN options on the router's WebUI (please block out any sensitive info like the DDNS, port #, WAN IP, etc.). It will also help to have the server and client log files: change the server log verbosity to verb 4 and the client to verb 5, restart the server, try to connect with a client, then post the the logs from both, again anonymizing any of the aforementioned sensitive info.
    – JW0914
    Sep 2 at 15:08

0

You must log in to answer this question.

Browse other questions tagged .