I have a two routers based on ClearOS. On both of them i have OpenVPNΒ service running. One of them connects with no problem but on the second one a cannot ping any device/server/printer on “the other side”.
I executed route command and got this:
|
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.16.1 0.0.0.0 UG 1024 0 0 wlp16s0 10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0 10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp16s0 |
So i figured out that there is no route to the remote place. As root I executed this command:
|
route add -net 192.168.3.0 gw 10.8.0.5 netmask 255.255.255.0 dev tun0 |
And finally i could access servers from “the other side”. The problem was in router/server which was running openvpn service.
I have had to edit /etc/openvpn/clients.conf and /etc/openvpn/clients-tcp.conf files and add this line at the end of both files:
|
push "route 192.168.3.0 255.255.255.0" |
After restarting the OpenVPN service on the server and connecting to the remote place via openvpn command everything goes right
The route command gave me this output:
|
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.16.1 0.0.0.0 UG 1024 0 0 wlp16s0 10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0 10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 192.168.3.0 10.8.0.5 255.255.255.0 UG 0 0 0 tun0 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp16s0 |
which was good and everything was working as it was planned.