You really need to understand the
Simple Examples from the man page--particularly Example 2.
The two arguments to the
ifconfig configuration file option are the addresses of the near and far endpoints of the tunnel--typically two private addresses like 10.0.0.1 and 10.0.0.2 that
are not address from either private network. You have the far address and a netmask. The argument to
remote should be the public address of the far end--the real Internet address if that's what is in between. I assume you've tried using a netmask in order to establish routing between the two tunnelled networks. This must be done by adding routing information
after the tunnel is established. The openvpn executable can automatically run a script to do this for you.
Your config should look like:
Code: Select all
dev tun
remote far.end.real.ip
ifconfig 10.3.0.1 10.3.0.2
secret /etc/openvpn/test/openvpn.key
up tunnel.up
down tunnel.down
At the far end the ifconfig line will have the addresses reversed and your public ip address in the remote argument. Tunnel.up and tunnel.down are scripts to add/remove routes when the tunnel is established/torn down. You need to write these yourself using knowledge of the remote network. Something like:
Code: Select all
#!/bin/bash
route add -net 192.168.1.0 netmask 255.255.255.0 gw $5
and
Code: Select all
#!/bin/bash
route del -net 192.168.1.0 netmask 255.255.255.0 gw $5