OpenVPN on Ubuntu Linux, connection established, how to send data through vpn?

1

I installed OpenVPN on my Ubuntu machines (both client and server are Ubuntu machines). Its a fresh Ubuntu installation (13.10). I wrote some config files, for client and server:

server.conf: (my servers IP is 192.168.0.3)

local 192.168.0.3
port 1194
proto tcp
dev tun
ca /etc/openvpn/easy-rsa/easyrsa3/pki/ca.crt
cert /etc/openvpn/easy-rsa/easyrsa3/pki/issued/server.crt
key /etc/openvpn/easy-rsa/easyrsa3/pki/private/serverreq.key  
dh /etc/openvpn/easy-rsa/easyrsa3/pki/dh.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.0.0 255.255.254.0"
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3

client.conf:

client
dev tun
proto tcp
remote 192.168.0.3 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/client.crt
key /etc/openvpn/keys/clientreq.key
comp-lzo

As you see from the screenshoots, connection is established:

client side: http://postimg.org/image/s1g5stkpj/

I guess it all seem to work. So if I have such VPN connection, how can I send/receive data through it? Do I need a special command or what? Please give step by step instruction :)

  1. My VPN server IP address is 10.8.0.1
  2. My VPN client IP address is 10.8.0.6

mirx

Posted 2014-03-02T10:56:22.077

Reputation: 197

What traffic do you want to go through the VPN? Connections to 192.168.0.0/23, like specified? Or everything? – Daniel B – 2014-03-02T11:38:36.957

@DanielB: I was thinking about sending files through my vpn, for example with scp. Is that possible? How can I know that Im sendind it through the VPN connection, not my "default" connection? – mirx – 2014-03-02T11:44:08.437

You can tell from the local socket, using netstat -np for example. I'm not sure it would work for you though, because you're trying to tunnel your local network. – Daniel B – 2014-03-02T12:03:03.977

@DanielB: ok but when I use VPN IP addresses (from 10.x.x.x sebnet) instead of local addresses (from 192.x.x.x subnet) to send files, it will send them through the VPN tunnel, right? – mirx – 2014-03-02T12:23:17.677

That's correct. – Daniel B – 2014-03-02T12:46:19.830

Answers

2

If you see the "Initialization Sequence Completed" message, you should be connected to your VPN and every traffic should be routed to the VPN server. If not, please post the output of the "route" command. Also you can test if you're connected to the VPN by visiting a webpage that shows you your IP address. Visit such a webpage before you run openvpn and than reload it when you see "Initialization Sequence Completed".

jhscheer

Posted 2014-03-02T10:56:22.077

Reputation: 126

Thanks for the answer! Heres the output you asked for: http://pastie.org/private/as6eb3kavcqooib69urylw. How can I know that Im sendind it through the VPN connection, not my "default" connection? As you see from the output I posted, "default" destination is 192.168.0.0, so I guess it won't use the VPN connection by default? Tested the IP address as you suggested, its same before and after I connect to my VPN server.

– mirx – 2014-03-02T11:43:41.450