1

Good afternoon!

I'm trying to configure a VPN server in Ubuntu using openVpn. I already configured the server.conf file and the client.conf file (one of my vpn clients is a Windows virtual machine and the other one is an Ubuntu VM). These are my configurations:

Server.conf

port 1194
proto udp
dev tun
ca ca.crt
cert grupo04vpn.crt
key grupo04vpn.key  # This file should be kept secret
dh dh2048.pem
server 10.0.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 172.17.20.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 172.17.20.4"
client-to-client
keepalive 10 120
comp-lzo
max-clients 100
persist-key
persist-tun
status openvpn-status.log
verb 5

Client.conf

client
dev tun
proto udp
remote 172.17.20.6 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
ns-cert-type server
comp-lzo
verb 3

I'm able to ping 10.0.0.1 (which is the server's ip) from the vpn client, and i'm able to ping 10.0.0.10 (which is the client's ip) from the vpn server. However, when i check the tun0 interface from IPTRAF i see that no traffic is going through tun0, only through eth0. Here you can see a screenshot from iptraf when I ping 10.0.0.1

eth0: eth0 iptraf

This is my network topology

As you can see all the traffic is going through the eth0 interface, and i guess it should go through tun0. I would really appreciate any help to make traffic go through the tunnel as it should be.

Thanks.

UPDATE: This is the output of netstat -rn

Destination   Gateway       Genmask        Flags   MSS Window  irtt Iface
0.0.0.0       10.0.0.5      128.0.0.0       UG       0 0          0 tun0
0.0.0.0       172.16.10.1   0.0.0.0         UG       0 0          0 eth0
10.0.0.0      10.0.0.5      255.255.255.0   UG       0 0          0 tun0
10.0.0.5      0.0.0.0       255.255.255.255 UH       0 0          0 tun0
128.0.0.0     10.0.0.5      128.0.0.0       UG       0 0          0 tun0
169.254.0.0   0.0.0.0       255.255.0.0      U       0 0          0 eth0
172.16.10.0   0.0.0.0       255.255.255.0    U       0 0          0 eth0
172.17.20.0   10.0.0.5      255.255.255.0   UG       0 0          0 tun0
172.17.20.6   172.16.10.1   255.255.255.255 UGH      0 0          0 eth0
11
  • try to use the command in your vpn client "route add -net 0.0.0.0 gw ip 10.0.0.1 dev tun0"
    – c4f4t0r
    Nov 30, 2014 at 22:22
  • I'm sorry for my ignorance, but do i have to add "route add -net 0.0.0.0 gw ip 10.0.0.1 dev tun0" in the client.conf file? I have 2 VPN clients, one is an Ubuntu VM and the other one is a Windows virtual machine
    – Richard
    Nov 30, 2014 at 22:29
  • is a linux command, so you need to give that command in your ubuntu vm
    – c4f4t0r
    Nov 30, 2014 at 22:44
  • I added the route to the /etc/network/interfaces file but the problem persists. I ping 10.0.0.1 and it's successful. However if I check iptraf, all traffic is going through eth0 and nothing through tun0. :-(
    – Richard
    Nov 30, 2014 at 22:53
  • show me the output of the command "netstat -rn", you can use tcpdump -i tun0
    – c4f4t0r
    Nov 30, 2014 at 22:55

0

You must log in to answer this question.

Browse other questions tagged .