Here is my problem, I have 3 distinct sites:
One thing I'll point out about your network ranges is that 18.104.22.168
and 22.214.171.124 (and 126.96.36.199 for that matter) are not IANA-reserved
ranges for private networks; if these are not networks assigned to you
by a public ISP, you shouldn't be using them as it will cause problems
if you ever try to access a real public host with an address in those
ranges. If you need more than the standard /16 provided in the
192.168.0.0/16 address range, use the 172.16.0.0/12 or 10.0.0.0/8
IANA-reserved ranges for private networks.
255.255.0.0 gateway 188.8.131.52
192.168.0.0 netmask 255.255.0.0
Why are you using tap? If you want the sites to route to each other,
you want routing, which uses tun adapters. When using tap adapters,
subnet broadcasts are passed between hosts and there is extra overhead
for Layer2 (Ethernet) frames that otherwise don't need to be sent
across the VPN.
I need to interconnect them through internet, so I setup a VPN tap
184.108.40.206 and a VPN tap client on
192.168.0.1 and 220.127.116.11.
The VPN is set on
18.104.22.168 netmask 255.255.255.0
and every gateway has been configured to route traffic from and to the
You have 2 basic options. First, you can use one of the sites as a
"central" site where all other traffic is routed though; if you set up
site1 as the VPN server, communication between site2 and site3 would
need to be routed through the VPN server hosted at site1. Second, you
can set up point-to-point tunnels between all 3 sites, so that each
site can directly communicate to the other. While this is more
efficient in terms of bandwidth (since traffic from site2 to site3 no
longer needs to send through site1) it is more complicated because you
need a link between each site, which means 2 VPN connections on each
site for a 3-site setup.
On the server side I push "route 22.214.171.124
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.
If you go with a central VPN server (such as one at site1) and have all
other sites connect to this VPN server in order to route traffic
through site1, you will want to push each route separately; you can't
push a supernet, because then routing entries conflict with the local
network. Plus you don't want to push a supernet with your current
network ranges because they're outside the scope of valid private
networks. Also, each site should have an iroute defined that tells the
OpenVPN server to do a couple things: first it will not push the route
for that network to that client (this allows you to push "route
192.168.0.0 255.255.0.0" to all clients but not have it pushed to the
client that owns that network), and second it will allow the OpenVPN
server to correctly route traffic bound for that network. So, in
brief, in a setup where a VPN sever is the central hub for all other
site communication, you want to push each route separately, and define
iroutes for each client, usually using a ccd file for each client.
Hope this clears things up a bit.
Description: OpenPGP digital signature