[Problem] Site to site, tunnel working but I need to reach to same network subnet on both sides of tunnel

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
droid
OpenVpn Newbie
Posts: 2
Joined: Sun Oct 04, 2020 2:05 am

[Problem] Site to site, tunnel working but I need to reach to same network subnet on both sides of tunnel

Post by droid » Sun Oct 04, 2020 2:13 am

Hi,

Here is my situation:

Site A
172.20.0.1 - ROUTER/GATEWAY DEBIAN

Code: Select all

enp2s0 (LAN)
172.20.0.1 

enp3s0 (WAN)
192.168.100.250
Server config

port 2020
proto udp
dev tun1
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 172.30.0.0 255.255.0.0
ifconfig 172.30.0.1 172.30.0.2
route 172.20.0.0 255.255.0.0
push "route 172.30.0.0 255.255.0.0"
push "route 172.20.0.0 255.255.0.0 172.30.0.1"
client-to-client
client-config-dir /etc/openvpn/server/ccd
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem


/etc/openvpn/server/ccd/gateway2

Code: Select all

iroute 172.20.0.0 255.255.0.0
Site B
172.20.100.1 - ROUTER/GATEWAY DEBIAN

Code: Select all

enp2s0 (LAN)
172.20.100.1 

enp3s0 (WAN)
192.168.100.250

Client config

client
dev tun1
proto udp
remote xxx.xxx.xxx.xxx 2020
resolv-retry infinite
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
float
verb 3
status openvpn-gate-status.log
<ca>
...



The tunnel is working because I can ping 172.30.0.1 and 172.30.0.2 from both sides. But as both have same Lan network I wan to be able to access both sides on 172.20.0.0/16 from debian gateway and clients from both sides.


ip forwared is ok
iptables seems ok also.

What am I missing? How can I check if CCD is working for current connection?


Thank you
Last edited by droid on Sun Oct 04, 2020 11:11 am, edited 7 times in total.

droid
OpenVpn Newbie
Posts: 2
Joined: Sun Oct 04, 2020 2:05 am

Re: [Problem] Site to site

Post by droid » Sun Oct 04, 2020 2:15 am

I need to translate OpenVPN network (172.30.0.0/16) into local network 172.20.0.0/16 from both sides gateway and clients.

Post Reply