Here is my problem, I have 3 distinct sites:
site1 22.214.171.124 netmask 255.255.0.0 gateway 126.96.36.199
site2 192.168.0.0 netmask 255.255.0.0 gateway 192.168.0.1
site3 188.8.131.52 netmask 255.255.0.0 gateway 184.108.40.206
I need to interconnect them through internet, so I setup a VPN tap server on 220.127.116.11 and a VPN tap client on 192.168.0.1 and 18.104.22.168.
The VPN is set on 22.214.171.124 netmask 255.255.255.0 and every gateway has been configured to route traffic from and to the VPN.
On the server side I push "route 126.96.36.199 255.255.0.0" so site2 ans site3 can access site1, but I also need site1 to access site2 and site3.
I would need something like a push "route 192.16x.0.0 255.255.0.0" on the client side, but a push can only be performed from the server to the client, not the other way around.
And I also need site2 and site3 to see each others, so I would also need something like:
except for site2 push "route 192.168.0.0 255.255.0.0 site2"
except for site3 push "route 188.8.131.52 255.255.0.0 site3"
Or if site1 can access site2 ans site3, maybe routing through site1 won't hurt:
except for site2 push "route 192.168.0.0 255.255.0.0"
except for site3 push "route 184.108.40.206 255.255.0.0"
Of course this kind of rules doesn't exist in OpenVPN, so I wonder if there's an elegant way to do that ?
I've already thought about a solution: Use static IP for the clients and so set static routes on the server and the clients. It works, but I would prefer something more dynamic, it would be more flexible in the case I need to add more sites (ex: just add some push on the server and every sites will know the new route for the new site).