Running OpenVPN 2.4.3 client on Windows 10, and have a couple of questions about the connection process. I have the client configured to start 30 seconds after I login, but that leaves a brief window in which programs that load before it can initiate connections out over my regular network connection. I would rather this didn't happen, obviously.
I've figured out a workaround of sorts that seems to do the trick - I run a script on connect that does the following:
ipconfig /release
ipconfig /flushdns
ipconfig /renew
Like I said, this appears to do the trick - once I do this and check my IP on any of the "what is my IP" sites, it comes back properly as the address of my server. However, it seems a little brute-force, and I was wondering if there was a more 'elegant' way of doing this - a scalpel as opposed to a hammer.
If anyone has any suggestions or tips, I'm all ears. Client config is below.
---
# OpenVPN mypc.ovpn
ca keys/ca-desktop.crt
cert keys/mypc-desktop.crt
key keys/mypc-desktop.key
remote XXX.XXX.XXX.XXX 1194
comp-lzo
client
dev tun
redirect-gateway def1
block-outside-dns
remote-cert-tls server
cipher AES-256-CBC
auth SHA512
proto udp
resolv-retry infinite
nobind
persist-key
persist-tun
verb 3
mute 20