Author Topic: Openvpn site2site in Virtualbox (LABHOME)  (Read 1056 times)

Gilberto Ferreira

  • Zen Hero
  • *****
  • Posts: 516
  • Karma: +12/-1
    • View Profile
Openvpn site2site in Virtualbox (LABHOME)
« on: October 21, 2021, 07:19:57 pm »
Hi there

I have deploy two Zentyal Server 4.0 in VirtualBox (V 6.1.27 r147422). I am using my laptop to this purpose.

I also have create two host network, like:

vboxnet0 - 192.168.152.0
vboxnet1 - 192.168.157.0

Aditionaly I have create a few iptables rules in my laptop, to allow both zentyal servers to use the internet properly:
# Flush IPTABLES
iptables -F
iptables -t nat -F
# Loopack
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i vboxnet0 -j ACCEPT
iptables -A INPUT -i vboxnet1 -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# Allow all from virtualbox
iptables -A INPUT -s 192.168.152.0/24 -j ACCEPT
iptables -A INPUT -s 192.168.157.0/24 -j ACCEPT

# Masquerade virtualbox network
iptables -t nat -A POSTROUTING -s 192.168.152.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.157.0/24 -j MASQUERADE

#turn on ip forwarding
sysctl -w net.ipv4.ip_forward=1

After install both zentyal server, I have create a openvpn tunnel between two server.
I was unable to use the default IP addrss inside the vpn tunnel, i.e 192.168.0.0 in both sides doesn't work.
I needed to use 192.168.10.0 in server1 and 192.168.20.0 in server2. After that I can now ping both side and the 2 windows 7 behind each servers.
But I can not reach the Windows Client behind VPN.

Server1 has the IP 192.168.152.100 as WAN and 172.16.0.10 as LAN
Server2 has the IP 192.168.157.100 as WAN and 172.18.0.10 as LAN

I have dhcp serving IPS 172.16.0.0 to the Windows 7 behind server1 and I have dhcp serving IPS 172.18.0.0 to the Windows 7 behind server2

Both server1 and server2 are communicating. In both server1 and server2 I can ping Windows behind server1 and Windows behind server2

But inside Windows 7 behind server1 I can not reach Windows 7 behind server2.

What I missing??
I appreciated for any help!

Thank you.




Gilberto Ferreira

  • Zen Hero
  • *****
  • Posts: 516
  • Karma: +12/-1
    • View Profile
Re: Openvpn site2site in Virtualbox (LABHOME)
« Reply #1 on: October 27, 2021, 02:30:19 pm »
Anybody??

Gilberto Ferreira

  • Zen Hero
  • *****
  • Posts: 516
  • Karma: +12/-1
    • View Profile
Re: Openvpn site2site in Virtualbox (LABHOME) [ SOLVED ]
« Reply #2 on: October 27, 2021, 09:16:07 pm »
SOLVED!

Just change my lan from 172.16 and 172.18 to 192.168.100 and 192.168.200 and now everything is work