Hello Everyone,
Due to shortage of time the post was added without much details. Here they are now ...
Server side is Debian and client1 and client3 are Windows PCs
Server Configuration (/etc/openvpn/server.conf):
local 198.xxx.xxx.96
port 443
proto udp
dev tap0
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
ifconfig-pool-persist ipp.txt
server-bridge 10.8.1.1 255.255.255.0 10.8.1.2 10.8.1.100
client-config-dir ccd
client-to-client
keepalive 10 120
cipher AES-256-CBC # AES
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
log-append openvpn.log
verb 3
Client Configuration Directives
/etc/openvpn/ccd/client1
ifconfig-push 10.8.1.5 255.255.255.0
push "route 0.0.0.0 0.0.0.0 10.8.1.2 1"
/etc/openvpn/ccd/client3
ifconfig-push 10.8.1.2 255.255.255.0
Client Configuration File
c:\Program Files\OpenVPN\config\client1.ovpn
client
dev tap0
proto udp
remote 198.xxx.xxx.96 443
resolv-retry infinite
nobind
ca ca.crt
cert client1.crt
key client1.key
persist-key
persist-tun
ns-cert-type server
cipher AES-256-CBC
verb 3
route-method exe
route-delay 3
Client1 (10.8.1.5) and Client3 (10.8.1.2) are able to ping each other (directly without any hop since we're using bridging). Using the CCD of client1, we're able to push default route (as a static route is pushed, not redirect gateway) so it does get added in the client1's routing table but not with the lowest metric. We're able to acheive the goal by manually addiing the following two commands in the Client1's CLI.
route add 198.xxx.xx.96 mask 255.255.255.255 192.168.1.1
route delete 0.0.0.0 mask 0.0.0.0 192.168.1.1
We're not using redirect-gateway because it pushes the default route towards the Server but in our case we need it pushed towards Client3 (10.8.1.2). It would be great to find a way to use redirect-gateway in such a way that the client1 gets default route towards Client3.
Help shall be highly appreciated !
Regards,
Nawab Asghar