I installed OpenVPN server successfully on a server (X.X.X.X/32). Here is my OpenVPN config file:

port 1194
proto udp6
dev tun

ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh.pem
crl-verify /etc/openvpn/keys
crl-verify /etc/openvpn/keys/ca-crl.pem
tls-auth /etc/openvpn/keys/ta.key 0
auth SHA256
cipher AES-256-CBC
tls-version-min 1.2

ifconfig-pool-persist ipp.txt

push "route"
keepalive 5 30
compress lzo
user nobody
group nogroup

status openvpn-status.log
status-version 1
log-append /var/log/openvpn.log
verb 3

On that server (X.X.X.X/32) I have a vagrant machine running in (host-only network) private network (vm.network 'private_network') with ip

After connecting to OpenVPN from my localhost I would like to ping I can only ping As you can see Vagrant private network, and OpenVPN network is different. Please somebody can help with this issue? I'm also attaching my ovpn (snippet) file:

auth SHA256
cipher AES-256-CBC
remote-cert-tls server
tls-version-min 1.2

proto udp
remote X.X.X.X 1194
dev tun
resolv-retry 5
keepalive 5 30
compress lzo
verb 3
route-method exe
route-delay 2
key-direction 1

EDIT1: I'm using because vagrant shows a warning for vagrant up:

guest: You assigned a static IP ending in ".1" to this machine. ==> guest: This is very often used by the router and can cause the ==> guest: network to not work properly. If the network doesn't work ==> guest: properly, try changing this IP.

route -n output on Vagrant machine:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    100    0        0 enp0s3   U     0      0        0 enp0s3 UH    100    0        0 enp0s3     U     0      0        0 docker0   U     0      0        0 enp0s8

EDIT2: Vagrant's machine ip changed to I also added the following line to ovpn file: route From localhost I can now ping after connecting to vpn, but I'm still unable to ping

  • What is Commented Feb 24, 2020 at 7:48
  • Please describe what X.X.X.X/32 is supposed to represent. Commented Feb 24, 2020 at 7:50
  • 1
    If you want clients to be able to talk to each other on the VPN network, you generally need the client-to-client setting on the VPN server, I believe.
    – Kusalananda
    Commented Feb 24, 2020 at 7:50
  • @Kusalananda the OP's VPN network is, so I don't think that's relevant here...? Commented Feb 24, 2020 at 7:50
  • 1
    Sigh. Please put your updates INTO YOUR QUESTION. Commented Feb 24, 2020 at 8:08

2 Answers 2


Ok, I found a solution. My vagrant machine (virtualbox provider) is located on private network with ip, on server (X.X.X.X/32).

If I would like to ping from my localhost, after connecting to vpn, I need to execute the following command inside of the vagrant machine first:

ip route add via dev <VARGRANT_NETWORK_INTERFACE>


  • = openvpn network
  • = vboxnet* ip
  • VARGRANT_NETWORK_INTERFACE = in my case it was enp0s8

You need to enable IP forwarding (routing) on your VPN server host, if you want your VPN to communicate with other hosts through the VPN server host:

sysctl -w net.ipv4.ip_forward=1

See this answer.

  • yes! IP forwarding needs to be enabled too.
    – Zili
    Commented Jun 5, 2020 at 15:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .