Routing between OpenVPN server and client

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
alexsher91
OpenVpn Newbie
Posts: 4
Joined: Wed Jul 15, 2020 8:47 am

Routing between OpenVPN server and client

Post by alexsher91 » Mon Jul 20, 2020 7:39 am

Hello! Help set up routing between server and client.

Office:
Windows Server 2012 R2 (Server)
IP 192.168.2.1 255.255.255.0
VPN 10.8.0.1 255.255.255.0

Home: Windows 7 (Client)
IP: 192.168.0.101 255.255.255.0
VPN: 10.8.0.6 255.255.255.0

At the moment, pings only take place on the 10.8.0.0 network
I can't get from the client to the local network behind the server, and vice versa.
I ask for help, I am setting up for the first time.

server.ovpn

Code: Select all

port 443
proto udp
dev tun
dev-node QYZYLJAR
dh C:\\OpenVPN\\ssl\\dh2048.pem
ca C:\\OpenVPN\\ssl\\ca.crt
cert C:\\OpenVPN\\ssl\\QYZYLJAR.crt
key C:\\OpenVPN\\ssl\\QYZYLJAR.key
server 10.8.0.0 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
;push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
max-clients 32
keepalive 10 120
client-to-client
comp-lzo
persist-key
persist-tun
cipher AES-256-CBC
status C:\\OpenVPN\\log\\openvpn-status.log
log C:\\OpenVPN\\log\\openvpn.log
verb 4
mute 20
route-delay 5
route-method exe
route 192.168.0.0 255.255.255.0
client.ovpn

Code: Select all

client
nobind
remote MY_EXTERNAL_IP 443
proto udp
dev tun
comp-lzo
ca ca.crt
cert vpn-client.crt
key vpn-client.key
float
cipher AES-256-CBC
keepalive 10 120
persist-key
persist-tun
verb 3
remote-cert-tls server
route-delay 5
route-method exe
route 192.168.2.0 255.255.255.0

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: Routing between OpenVPN server and client

Post by 300000 » Mon Jul 20, 2020 11:46 am

You need iprouting and NAT on your server so client can go to internet and ping server subnet lan

Going this one and try to sort your server
viewtopic.php?f=7&t=7806

alexsher91
OpenVpn Newbie
Posts: 4
Joined: Wed Jul 15, 2020 8:47 am

Re: Routing between OpenVPN server and client

Post by alexsher91 » Mon Jul 20, 2020 1:23 pm

The server acts as a gateway.
The Internet comes to him (2.135 .... 138)
Next comes the distribution to 192.168.2.0/255.255.255.0
In the settings of the network adapter, the checkbox "Allow other network users to use the Internet connection" is already checked. But I have a different connection selected in the list.

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: Routing between OpenVPN server and client

Post by 300000 » Mon Jul 20, 2020 5:19 pm

You need take time to read and do the same win 7 as win10 so when you ve done iprouting and NAT it will work for you

Post Reply