logo elektroda
logo elektroda
X
logo elektroda

[Solved] Problem with configuring the VPN server on the home UPC network

milu86 9069 7
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19313918
    milu86
    Level 9  
    Hello,
    Due to my profession, I travel around the country quite often, there are also several-day trips abroad and, being on such a trip, I would like to be able to watch TV via the Horizon Go application on a mobile or a laptop connected to some hotel network via Wi-Fi. Due to the stupid requirement to be in the UPC network, some channels are unavailable when I use the application while connected to the net from a provider other than UPC.

    I wanted to somehow get around this blockade and found a solution on the Internet that was to put a VPN server on one of the computers in my home network using the OpenVPN software and properly configure the router so that I could 'enter' my network from the outside. So I set up OpenVPN as instructed on the website [url=]https://community.openvpn.net/openvpn/wiki/Easy_Windows_Guide[/url] . There is already some success, because I was able to establish a VPN connection from the 'client' laptop (there is a laptop from my internal network, but for testing purposes I connect to the internet via a mobile phone [T-Mobile network]) to my computer acting as a server VPN.
    Unfortunately, it does not work as it should, i.e. after establishing a VPN connection on the 'client' laptop, the public IP address is the same as it was before the connection was established (i.e. the public 'T-Mobile' address), and mine is the goal is to get a public address from UPC on this 'client' laptop.
    I searched the internet for this problem and from what I could read, in this case, you should supplement the VPN server configuration file with an entry push "redirect-gateway def1" . Unfortunately, after updating the configuration file like this, the VPN connection works, but then after establishing a connection on the 'client' laptop, I do not have access to the Internet at all and I am not able to verify the public IP address on this laptop in any way.

    Below I present the contents of the server and client configuration files, it may be helpful in diagnosing the problem:

    Server configuration file (server.ovpn):
    port 1194
    proto udp
    dev tun
    ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
    cert "C:\\Program Files\\OpenVPN\\config\\server.crt"
    key "C:\\Program Files\\OpenVPN\\config\\server.key"  # This file should be kept secret
    dh "C:\\Program Files\\OpenVPN\\config\\dh2048.pem"
    server 10.8.0.0 255.255.255.0
    ifconfig-pool-persist ipp.txt
    keepalive 10 120
    tls-auth ta.key 0 # This file is secret
    cipher AES-256-CBC
    persist-key
    persist-tun
    status openvpn-status.log
    verb 3
    explicit-exit-notify 1


    Client configuration file (dell-sl-laptop.ovpn):
    client
    dev tun
    proto udp
    remote [publiczny_adres_IP_z_UPC] 1194
    resolv-retry infinite
    nobind
    persist-key
    persist-tun
    ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
    cert "C:\\Program Files\\OpenVPN\\config\\dell-sl-laptop.crt"
    key "C:\\Program Files\\OpenVPN\\config\\dell-sl-laptop.key"
    remote-cert-tls server
    tls-auth ta.key 1
    cipher AES-256-CBC
    verb 3
    


    Additional steps that I did on the UPC (Horizon) router as part of the OpenVPN configuration:
    - forwarding of the external port 1194 to the internal port 1194 to the internal IP address (192.168.1.95) of my computer, which acts as a VPN server (in the Advanced tab, in the Forwarding section, I created the following entry: Public Port Range 1194-1194 , Target IP Address 192.168.1.95 , Target Port Range 1194-1194 , Protocol UDP ).

    Additional steps that I performed on a computer inside my network (IP address 192.168.1.95) acting as a VPN server (Windows 10):
    - configuration in Windows Defender Firewall to allow incoming traffic for UDP protocol to local port 1194.

    I am asking for help in solving the problem, thank you in advance for any tips and suggestions.
  • ADVERTISEMENT
  • #2 19314153
    przeqpiciel
    Network and Internet specialist
    From what you are replying, the ovpn server does not send the correct static route configuration to the client.

    Check the internet for push-route options or something like that. Or you can take a look at WireGuard, which is probably easier to set up
  • ADVERTISEMENT
  • Helpful post
    #3 19314160
    K_o_s

    Level 25  
    See here: https://komputerowiec.net/vpn.html. The description is for Raspberry Pi, but the configuration is similar. Your configuration lacks a definition for DNS on client ends, maybe there is a problem here (https://openvpn.net/community-resources/pushing-dhcp-options-to-clients/).

    Greetings
  • #4 19314206
    milu86
    Level 9  
    Thank you for your answer. I understand that your suggestion relates to the fact that there is no internet on the 'client' laptop side after establishing a VPN connection, right?
    In the example server configuration file, there are indeed entries starting with 'push "route (...)"', they are as follows:
    ; push "route 192.168.10.0 255.255.255.0"
    ; push "route 192.168.20.0 255.255.255.0"
    .
    Are these routes? And do you need to set these parameters only on the server side (in the sense by adding appropriate entries in the server configuration file), or also on the client side (i.e. you should add similar entries in the client's configuration file)?

    Added after 1 [hours] 3 [minutes]:

    I supplemented the server configuration with DNS entries:
    push "dhcp-option DNS 8.8.8.8"
    push "dhcp-option DNS 8.8.4.4"


    Now, after establishing a VPN connection, DNS's on the 'client' latop are set to the same as above (I verified it with the ipconfig / all command), unfortunately the configuration update did not help, still (after establishing a VPN connection) on the client side no internet access.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #8 19314500
    milu86
    Level 9  
    SOLUTION:
    Set value to 1 in the registry for Atritib IPEnableRouter in the key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters and launching services Routing and remote access and OpenVPNService solved the problem. After establishing a VPN connection, the 'client' computer has access to the Internet and has the correct public IP address.

Topic summary

The discussion revolves around configuring a VPN server using OpenVPN on a home UPC network to bypass restrictions on the Horizon Go application while traveling. The user initially faced issues with the client laptop not having internet access after establishing a VPN connection. Suggestions included checking static route configurations and DNS settings. The user later confirmed that adding DNS entries in the server configuration resolved some issues. Ultimately, the solution involved modifying the Windows registry to enable IP routing and starting the necessary services, which allowed the client to access the internet with the correct public IP address after connecting to the VPN.
Summary generated by the language model.
ADVERTISEMENT