HI,
I am trying to connect two lans via OpenVPN. Both sites have got a linux box as a gateway with iptables SNAT rule. I have installed on the both sites Openvpn.
Both boxes have got a two interfaces, first is a WAN interface and second is LAN.
Ip addresses at first site are 10.11.2.0/24
Ip addresses at second site are 192.168.2.0/24
My goal is to connect these two LAN's via Openvpn tunel.
Below is configuration:
First site:
remote 83.18.YYY.XXX
float
port 8001
dev tun
ifconfig 10.0.0.1 10.0.0.2
persist-tun
persist-local-ip
persist-remote-ip
comp-lzo
ping 15
secret key.key
route 192.168.1.0 255.255.255.0
user nobody
group nogroup
log-append /var/log/openvpn/vpn.log
verb 1
Second site:
remote 43.120.XXX.YYY
float
port 8001
dev tun
ifconfig 10.0.0.2 10.0.0.1
persist-tun
persist-local-ip
persist-remote-ip
comp-lzo
ping 15
secret key.key
route 10.11.2.0 255.255.255.0
user nobody
group nogroup
log-append /var/log/openvpn/vpn.log
verb 1
The tunel is up, I am able to ping from gateways hosts at lan.
But my problem is, that when I am on any box at LAN I am not able to ping host at second site. It looks that SNAT rule is wrong and I do not know how to exclude
second lan, for example 10.11.2.0/24
Tcpdump shows, that source address of outgoing connection is changeing to WAN address,
11:17:49.325686 IP 83.18.XXX.XXX > 10.11.2.72: ICMP echo request, id 512, seq 25902, length 40
11:17:54.823832 IP 83.18.XXX.XXX > 10.11.2.72: ICMP echo request, id 512, seq 26158, length 40
This is my SNAT rule
-A POSTROUTING -s 192.168.1.0/255.255.255.0 -j SNAT --to-source 83.18.XXX.XXX
Could you please indicate what needs to change to connect to the seconda Lan hosts?
Thank you a lot,
cubee