Dear all,
I managed to get around my problem by having a script which modifies the server's config file after it is updated from GUI and before the server (re)starts. So despite being curious about the question above, this part is solved on my end.
But I ran into another problem right after, and so far I was not able to track down the cause.
Here is a quick description:
LAN1:
Net+Mask: 10.201.1.0 / 24
Gateway LAN: 10.201.1.1
Gateway WAN: 192.168.111.99 (it is 'local' ip, but I do have a public IP - "xxx.xxx.xxx.xxx" mapped to it and external access obviously works - tested)
Open VPN server is running on Gateway
VPN server ip: 10.222.1.5
LAN2:
Net+Mask: 10.201.2.0 / 24
Gateway LAN: 10.201.2.1
Gateway WAN: 10.56.166.26 (it is 'local' ip, but I do have a public IP - "yyy.yyy.yyy.yyy" mapped to it and external access works - tested)
Open VPN client is running on Gateway
VPN client ip: 10.222.1.6
What works:
Gateways can ping each other and any client on any LAN.
Clients from LAN1 can ping both gateways and any client on both LANs.
Clients from LAN2 can ping both gateways, but only clients on LAN2 and not on LAN1 🙁
I went through so many guides and threads and I think my setup is correct. As far as I see (if I am not blind), I am in line with what is written here
http://community.openvpn.net/openvpn/wiki/RoutedLans
It could be a firewall issue, but I doubt it, as it would be then blocking other traffic too (or would it?).
Here is my truncated config:
Server config
...
proto udp
dev tun1
...
server 10.222.1.0 255.255.255.0
client-to-client
...
push "route 10.201.1.0 255.255.255.0"
push "route 10.201.2.0 255.255.255.0"
route 10.201.2.0 255.255.255.0
Server route table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.201.1.0 * 255.255.255.0 U 0 0 0 eth0
10.201.2.0 10.222.1.2 255.255.255.0 UG 0 0 0 tun1
10.221.1.0 * 255.255.255.0 U 0 0 0 tap0
10.222.1.0 10.222.1.2 255.255.255.0 UG 0 0 0 tun1
10.222.1.2 * 255.255.255.255 UH 0 0 0 tun1
192.168.111.0 * 255.255.255.0 U 0 0 0 eth1
eth1 is the WAN interface of the gateway...it goes to another router/gateway, but this has no effect on the setup I think
client config
client
dev tun
proto udp
remote 1.2.3.4 5678 (in real config replaced by my server's public IP and port in use)
float
+ per-client file on the server which adds "iroute 10.201.2.0 255.255.255.0" to the client
client route table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.56.166.1 0.0.0.0 UG 0 0 0 eth0
10.56.166.0 * 255.255.255.0 U 0 0 0 eth0
10.201.1.0 10.222.1.5 255.255.255.0 UG 0 0 0 tun0
10.201.2.0 * 255.255.255.0 U 0 0 0 eth1
10.222.1.0 10.222.1.5 255.255.255.0 UG 0 0 0 tun0
10.222.1.5 * 255.255.255.255 UH 0 0 0 tun0
eth0 - WAN; eth1 - LAN
Can anyone see a problem, or have a suggestions as to where I should look why my pings are not getting through. FYI, it is not just ping that is not working. From LAN2 I cannot access any client on LAN1 even when I try http or ftp (for those clients that run those services).
Thank you.
B.