3

I've setup OpenVPN on Ubuntu 16.04 with these instructions.

I get this message after starting up on the client which seems to indicate everything is good and working:

Wed Jun 21 21:30:18 2017 Initialization Sequence Completed

But when I test my IP address from the browser it is still the same as before I started the process.

Should I be getting an error message if the connection isn't successful?

client1.ovpn:

client
dev tun
proto udp
remote ec2-34-211-11-37.us-west-2.compute.amazonaws.com 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
remote-cert-tls server
cipher AES-128-CBC
auth SHA256
comp-lzo
verb 3
key-direction 1
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

/etc/openvpn/server.conf

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
tls-auth ta.key 0 # This file is secret
key-direction 0
cipher AES-128-CBC   # AES
auth SHA256
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
3
  • Merely setting up OpenVPN isn't enough to ensure that all of your traffic goes through the tunnel - you need to ensure that routing is configured properly and that the remote end of the tunnel is configured to properly NAT your traffic.
    – EEAA
    Jun 22, 2017 at 1:39
  • Please edit your question to include your server and client configuration files.
    – EEAA
    Jun 22, 2017 at 1:47
  • Is the config file posted the ones you were thinking? I edited a few different files on the server while going through the tutorial. Jun 22, 2017 at 1:55

2 Answers 2

1

You missed a crucial step in the tutorial, the step that does what you're looking for it to do: route all of your traffic through the tunnel.

If you would indulge me a bit of a rant, this is why tutorials are so badly frowned upon here. They permit people to implement systems without actually learning what it is they're implementing.

OK, rant over.

Instead of relying on the tutorial, I'd suggest that you read the OpenVPN documentation. Actually read it. Learn what all of the options do, and how they might apply to your situation. This will not only allow you to fully understand what you're implementing, but will also allow you to troubleshoot issues in the future.

4
  • 1
    I appreciate the suggestion but can telling a user to read the documentation really be considered an answer? If you can tell that I missed a step from seeing my configs why not at least give some more insight. Are you saying I'm missing some values in the client config, if so which? Jun 22, 2017 at 2:04
  • "Teach a man to fish"...is a strong MO here. Look, I'm absolutely not trying to be disrespectful here. On the contrary, I'm trying to help you become a better sysadmin. There is a crucial step missing from your server configuration which instructs the client to route all traffic through the tunnel, instead of routing only the OpenVPN subnet.
    – EEAA
    Jun 22, 2017 at 2:06
  • As to whether or not its an answer, well I guess that's for you to decide. If it helps you figure things out, then yes, it's an answer. Someone else may very well come along and spoon-feed exactly what you need to do, and if that happens, that's fine. I guess I prefer to help point people in the right direction and let them follow their nose to the solution, especially when what you need to do is spelled out verbatim in a tutorial. This is much better for long-term learning than just giving an answer.
    – EEAA
    Jun 22, 2017 at 2:07
  • 1
    This isn't an answer.
    – 0x777C
    Apr 6, 2020 at 10:22
3

All credit for this answer goes to @EEAA.

Had to add the following to /etc/openvpn/server.conf

push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
2
  • 1
    Hey, nice work! :)
    – EEAA
    Jun 22, 2017 at 2:27
  • I am facing a similar kind of issue. I am able to connect to the VPN server through network-manager UI. But, when I am trying from the command line it prints some log ends with this line:- Tue Aug 22 15:42:17 2017 Initialization Sequence Completed, not connecting to the VPN. What can be the issue?
    – AKA
    Aug 22, 2017 at 10:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .