Bidirection VPN tunnel between two networks can not setup properly

Need help configuring your VPN? Just post here and you'll get that help.

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
rudolf992
OpenVpn Newbie
Posts: 2
Joined: Sun Aug 21, 2022 6:32 am

Bidirection VPN tunnel between two networks can not setup properly

Post by rudolf992 » Sun Aug 21, 2022 7:20 am

Hello,

I want to connect two networks to give to the remote network (192.168.1.0) a public IP and the networks to be accessible in any direction between.
The system is working, I can access from client side(192.168.1.0) all the devices on 192.168.0.0, but vice versa not. This is what I want to sort out if you can help.

The server device is a qnap NAS, TS-251D. Openvpn is set up via QVPN app.
The client device is an Openwrt router with no public ip.

Server.conf from qnap is this:

Code: Select all

cd /etc/openvpn
dev tun
keepalive 10 60
reneg-sec 0
persist-key
persist-tun
duplicate-cn
script-security 3
client-to-client
management localhost 7505
#username-as-common-name
client-cert-not-required
auth-user-pass-verify /usr/sbin/qvpn.sauth via-env
multihome

ca /etc/openvpn/keys/ca.crt
dh /etc/openvpn/keys/dh1024.pem
key /etc/openvpn/keys/myserver.key
cert /etc/openvpn/keys/myserver.crt

client-connect /etc/openvpn/connect.sh
client-disconnect /etc/openvpn/disconnect.sh

status /var/log/openvpn-status.log
writepid /var/run/openvpn.server.pid

port 1194
proto udp
max-clients 5
server 10.8.0.0 255.255.255.0

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

cipher AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-......this is tha last line


The routing table on server:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         dlinkrouter     0.0.0.0         UG    100    0        0 br0
10.0.3.0        *               255.255.255.0   U     0      0        0 lxcbr0
10.0.5.0        *               255.255.255.0   U     0      0        0 docker0
10.0.7.0        *               255.255.255.0   U     0      0        0 lxdbr0
10.8.0.0        10.8.0.2        255.255.255.0   UG    0      0        0 tun0
10.8.0.2        *               255.255.255.255 UH    0      0        0 tun0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
192.168.0.0     *               255.255.255.0   U     0      0        0 br0
253.253.253.0   *               255.255.255.0   U     0      0        0 vethgw01
Also I attach a schema and the vpn setup from qnap server.

I have tried to add routes but I am missing something.

Thank you!

Topology and qvpn setup screenshot here:
https://postimg.cc/cK4krQwK
https://postimg.cc/3khcHMwF

rudolf992
OpenVpn Newbie
Posts: 2
Joined: Sun Aug 21, 2022 6:32 am

Re: Bidirection VPN tunnel between two networks can not setup properly

Post by rudolf992 » Thu Aug 25, 2022 5:48 pm

I have solved it, here is the solution
Title:
" Including multiple machines on the client side when using a routed VPN (dev tun)"
from here: https://openvpn.net/community-resources ... er-subnet/

in order to edit the server.conf you need to edit here: /etc/init.d/vpn_openvpn.sh
because qnap's QVPN this overwrites server.conf when you restart service to apply changes.

Post Reply