elpin I have 3 computers and 2 OpenVPN networks in separate subnets. One computer is an OpenVPN client and connects to a server. The server machine has two virtual adapters installed and it's also a client to a different OpenVPN server. Schematically it's like this: client1 (10.8.0.2) --- vpn1 --->>> server1 (10.8.0.1)/client2 (10.7.0.2) --- vpn2 --->>> server2 (10.7.0.1) Why is it that client1 (10.8.0.2) can ping its server1 (10.8.0.1) but it can't ping its server on the IP address of the second vpn (10.7.0.2)? server1 has a directive in the server configuration file: push "route 10.7.0.0 255.255.255.0" So in theory client1 should know about the network 10.7.0.0 and should know where to send the packet when I ping 10.7.0.2. But it seems that the client2 doesn't know where to route the packet back, correct? When I try the same thing on a local network and instead of pushing the other VPN network (10.7.0.0) I push a LAN (192.168.0.0) it works and I can ping the server1/client2 machine on the LAN address. Why it doesn't work for VPN? Thanks a lot! David
Mimiko You can verify the routing table on client 1 with route print And do a tracert 10.7.0.2 from client 1.
elpin Oh! It's suddenly working now! I'm sorry, it must have been me forgetting something. By the way, I have read somewhere that this static routing is possible only when the VPN is using TUN mode instead of TAP. Is it correct?
janjust nope, static routing is also possible when using 'tap' mode but the syntax of the 'route' statement is slightly different - in 'tap' mode you usually need to explicitly specify the remote gateway (third parameter).
elpin Thanks a lot for reply janjust. I'm having trouble figuring out what this gateway parameter should be? Since I'm pushing the route to different clients, I can't set the gateway to a specific IP address, no? I looked into the manual and there it says that the gateway could be 3 variables: vpn_gateway net_gateway remote_host From my understanding: vpn_gateway should assign a gateway IP to be an IP address of the vpn interface on the client (for example 10.8.0.2 on client1) net_gateway should assign a gateway IP to be an IP address of the lan interface on the client (for example 192.168.0.101 on client1) remote_host should assign a gateway IP to be an IP address of vpn server (for example 10.8.0.1 on client1) Do I understand it correctly? If so, I should use a vpn_gateway, right? push "route 10.7.0.0 255.255.255.0 vpn_gateway" Is this correct? It doesn't work for me :-( OpenVPN tells me that vpn_gateway is undefined.
Mimiko If you want to use vpn_gateway, you can ignore the parameter as it is implicit. Also you can use for GW any IP address corresponding to a routable IP in client's routing table.
elpin Unfortunately I cannot. OpenVPN tells me route command needs 3 parameters in tap mode. As for the IP - each client needs a different IP of the gateway so I can't put a specific IP there.