4

First I thought it was in the client.ovpn under remote my-server-1 1194. I had added both my local and public IP under there. However, when I commented out those lines, it still worked.

Where does my client know the IP address of the server? Did it just "remember" from when I didn't had those lines commented out?

2
  • 1
    You are correct; the IP address of the server is specified in client.ovpn. By "still worked" do you mean that an existing connection stayed up (expected behaviour), or that you brought the VPN down and then initiated a new connection with the remote directive commented out (not expected, unless the config file you were editing was not the one openvpn was using). Jul 24, 2016 at 19:24
  • Alright, thanks. By "still worked", I meant that I could still connect after I had disconnected. However, I wasn't using OpenVPN in the command line, but rather a third party application. So it's possible that the software didn't reload the conf file after I modified it.
    – eirik-ff
    Jul 24, 2016 at 19:29

1 Answer 1

5

The server's address is written in the server specific user configuration file client.ovpn. So after downloading client.ovpn file, if you check the file you will see remote directive snippets like:

remote openvpn.foobar.net 3194 udp

Here openvpn.foobar.net is the remote server address, it can also be an IP address:

remote 1.2.3.4 3194 udp

Now, if you can still reach the remote server even after commenting out the remote snippets from client.ovpn, then it must be cached by the client.

I have tested this on my system and getting this error instead:

Options error: --nobind doesn't make sense unless used with --remote
Use --help for more information.

but as openvpn client caches various parameters to have faster response, the response you got is presumably due to the caching.

3
  • Thanks. As I just said in my comment on the main post, it was probably that the software I was using to connect didn't reload the conf file before I tried to reconnect, and thus the public IP of my server was still in the file.
    – eirik-ff
    Jul 24, 2016 at 19:32
  • 1
    @Rinzwind In my case, no reloading was needed. Also what to reload from client side? This must be cached. Check my edits..
    – heemayl
    Jul 24, 2016 at 19:37
  • 1
    @eirik-ff There is no reloading involved in client side. Check my edits..
    – heemayl
    Jul 24, 2016 at 19:37

You must log in to answer this question.

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