0

I can ping the server (192.168.10.1) but i cant ping the other client (192.168.1.242).

This problem solves via command.

sudo route -n add -net 192.168.1.0/24 192.168.10.1

However it is annoying to do it every time I connect to VPN.

What command should I add to open VPN file to automatically add the network?

Current certificate file is shown below.

    client
    proto udp
    remote ip port
    dev tun
    resolv-retry infinite
    nobind
    persist-key
    persist-tun
    remote-cert-tls server
    verify-x509-name 
    auth SHA256
    auth-nocache
    cipher 
    tls-client
    tls-version-min 
    tls-cipher 
    setenv opt block-outside-dns
    verb 
-----BEGIN CERTIFICATE-----
0

You can set up routing according to https://openvpn.net/community-resources/setting-up-routing/.

1
  • I tried to use this command route add 10.0.0.0 mask 255.255.255.0 10.3.0.1 as it is said in the openvpn settings for routing but it didn't work. – Ekat Sim Jan 3 at 7:10
0

If you want to do this on your client, then you need to add the network and gateway to your config file as per the description:

route network/IP [netmask] [gateway] [metric]

Which in your case would be something like this

route 192.168.1.0 255.255.255.0 192.168.10.1

(brackets are optional, so skip [metric])

If you would like all clients to have the route, then use push "route <same format as above>" in your server configuration instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.