Page 1 of 1

OpenVPN client is not able to ping OpenVPN server's local LAN gateway

Posted: Fri Sep 01, 2023 11:19 am
by phoenix12
I have installed the OpenVPN server and client in window 10.

OpenVPN server local LAN IP : 192.168.193.77
OpenVPN server local default gateway IP: 192.168.193.1
OpenVPN server virtual IP: 192.168.100.1

OpenVPN server public IP : 196.1.X.X

OpenVPN client Virtual IP: 192.168.100.6
OpenVPN client LAN IP: 192.168.43.121

Client is able to connect with openvpn server and able to ping server virtual IP(192.168.100.1) and server LAN IP(192.168.193.77) but not able to ping server default gateway IP: 192.168.193.1

server config

_______________________________________________________________

dev-node serverVPN
mode server
port 1194
proto tcp4-server
dev tun

tun-mtu 1500
tun-mtu-extra 32
mssfix 1450

ca ca.crt
cert server.crt
key server.key
dh dh.pem

server 192.168.100.0 255.255.255.0

client-to-client
keepalive 10 120
cipher AES-128-CBC
comp-lzo

persist-key
persist-tun


verb 3
route-delay 5
route-method exe

push "route 192.168.193.0 255.255.255.0"
route 192.168.43.0 255.255.255.0
___________________________________________________________________


Client config
__________________________________________________________________________

client
port 1194

dev tun
proto tcp4-client

remote 196.1.X.X 1194

ca ca.crt
cert client1.crt
key client1.key

resolv-retry infinite
cipher AES-128-CBC
nobind

tun-mtu 1500
tun-mtu-extra 32
mssfix 1450

persist-key
persist-tun
comp-lzo
verb 3

route 192.168.193.0 255.255.255.0
______________________________________________________________________

Ping from client(192.168.100.6 ) to server Virtual IP(192.168.100.1)

C:\Users\setup>ping 192.168.100.1
Pinging 192.168.100.1 with 32 bytes of data:
Reply from 192.168.100.1: bytes=32 time=1208ms TTL=128
Reply from 192.168.100.1: bytes=32 time=986ms TTL=128
Reply from 192.168.100.1: bytes=32 time=646ms TTL=128


Ping from client(192.168.100.6 ) to server local IP(192.168.193.77)

C:\Users\setup>ping 192.168.193.77
Pinging 192.168.193.77 with 32 bytes of data:
Reply from 192.168.193.77: bytes=32 time=101ms TTL=127
Reply from 192.168.193.77: bytes=32 time=102ms TTL=127
Reply from 192.168.193.77: bytes=32 time=110ms TTL=127
Reply from 192.168.193.77: bytes=32 time=90ms TTL=127

Ping from server to client Virtual IP

C:\Program Files\OpenVPN\easy-rsa>ping 192.168.100.6
Pinging 192.168.100.6 with 32 bytes of data:
Reply from 192.168.100.6: bytes=32 time=179ms TTL=128
Reply from 192.168.100.6: bytes=32 time=114ms TTL=128
Reply from 192.168.100.6: bytes=32 time=133ms TTL=128
Reply from 192.168.100.6: bytes=32 time=58ms TTL=128


Ping from client(192.168.100.6 ) to server local gatewayIP(192.168.193.1)

C:\Users\setup>ping 192.168.193.1
Pinging 192.168.193.1 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.193.1:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

_________________________________________________________________________

Here I am not able to ping and access server local LAN gateway and server behind local network other machine.

IP forwarding is enabled and firewall is off.

I also tried to redirect the traffic using push "redirect-gateway def1" but not able to redirect data.

please give the solution for it.