0

I'm trying to set up an OpenVPN connection, I can connect to the VPN using my client, but I can't connect to other devices on the server network

topology

Network

config

IPEnableRouter

Server router - Port Forward

Share network

Ip tables - server

Endereço de rede          Máscara   Ender. gateway       Interface   Custo
          0.0.0.0          0.0.0.0      192.168.1.1     192.168.1.22    291
         10.8.0.0    255.255.255.0         10.8.0.2         10.8.0.1    281
         10.8.0.0  255.255.255.252      No vínculo          10.8.0.1    281
         10.8.0.1  255.255.255.255      No vínculo          10.8.0.1    281
         10.8.0.3  255.255.255.255      No vínculo          10.8.0.1    281
        127.0.0.0        255.0.0.0      No vínculo         127.0.0.1    331
        127.0.0.1  255.255.255.255      No vínculo         127.0.0.1    331
  127.255.255.255  255.255.255.255      No vínculo         127.0.0.1    331
      192.168.0.0    255.255.255.0         10.8.0.2         10.8.0.1    281
      192.168.1.0    255.255.255.0      No vínculo      192.168.1.22    291
     192.168.1.22  255.255.255.255      No vínculo      192.168.1.22    291
    192.168.1.255  255.255.255.255      No vínculo      192.168.1.22    291
     192.168.15.0    255.255.255.0         10.8.0.2         10.8.0.1    281
        224.0.0.0        240.0.0.0      No vínculo         127.0.0.1    331
        224.0.0.0        240.0.0.0      No vínculo          10.8.0.1    281
        224.0.0.0        240.0.0.0      No vínculo      192.168.1.22    291
  255.255.255.255  255.255.255.255      No vínculo         127.0.0.1    331
  255.255.255.255  255.255.255.255      No vínculo          10.8.0.1    281
  255.255.255.255  255.255.255.255      No vínculo      192.168.1.22    291

Server Config

port 1194
proto udp4
dev tun

ca "C:\\Program Files\\OpenVPN\\easy-rsa\\pki\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\easy-rsa\\pki\\issued\\server.crt"
key "C:\\Program Files\\OpenVPN\\easy-rsa\\pki\\private\\server.key"  # This file should be kept secret
dh "C:\\Program Files\\OpenVPN\\easy-rsa\\pki\\dh.pem"
tls-auth "C:\\Program Files\\OpenVPN\\easy-rsa\\pki\\easytls\\tls-auth.key" 0 # This file is secret

;topology subnet
server 10.8.0.0 255.255.255.0

push "route 192.168.1.0 255.255.255.0"
route 192.168.0.0 255.255.255.0
route 192.168.15.0 255.255.255.0

push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"

client-to-client
client-config-dir "C:\\Program Files\\OpenVPN\\ccd"

keepalive 10 120
cipher AES-256-GCM
data-ciphers AES-256-GCM

persist-key
persist-tun

ifconfig-pool-persist "C:\\SGTM\\VPN\\LOG\\ipp.txt"
status "C:\\SGTM\\VPN\\LOG\\openvpn-status.log"

route-method exe
route-delay

verb 5
mute 20
explicit-exit-notify 1

Client config

client

dev tun
proto udp
 
remote mypublicip 1194
 
resolv-retry infinite
nobind
persist-key
persist-tun

ca ca.crt
cert pdc.crt
key pdc.key
tls-auth tls-auth.key 1

cipher AES-256-CBC

remote-cert-tls server
auth-nocache

verb 4

I can access the server using openVPN ip and local ip but can't reach anything else in my server LAN

3
  • Do the devices in that LAN have a route back to you? Commented Sep 11, 2023 at 22:23
  • i have added - route add 192.168.1.0 MASK 255.255.255.255 192.168.1.1 - in all lan machines. but dont work. Commented Sep 12, 2023 at 14:09
  • That's not the route they need – and they already have a route to 192.168.1.0 because they're in it (and a local subnet route doesn't go via 192.168.1.1, either) – they need to know a route to the remote network, i.e. 10.8.0.0 in this case. Commented Sep 12, 2023 at 14:31

1 Answer 1

0

I found the problem, my client didn't see the vpn internal network so I added static route in my router.

configure route in LAN firewall adding this route 10.8.0.0(subnet vpn) on gateway 192.168.1.22(server ip)

My router

You must log in to answer this question.

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