Client OpenVPN to connect server outside my network

Client OpenVPN to connect outside my network

I need to connect from my hassio to an OpenVPN server. I have to authenticate with username and password. I have the CA certificate.
How can I achieve this? regards

There any many guides on the internet that explain how to configure OpenVPN on your OS.

What OS are you running? By any chance ubuntu? If so, heres a python script that helps you configure it in 5 minutes.

Now that sounds easy, and this script does make it easy. If you want to configure it yourself, make sure you schedule an hour or two to set it all up manually.

Hi, thanks for your reply, I use in many openvpn distros but in this case I can not understand how to integrate it. What I need is from the Rasp (my hassio) to connect to an OpenVPN server in another site. I have the CA certificate a username and password. the operating system is Hass.io Raspberry Pi 3 Model B and B + 64bit (https://github.com/home-assistant/hassos/releases/download/2.11/hassos_rpi3-64-2.11.img.gz)
I do not need to install the OpenVPN server only the client.
Regards

1 Like

:joy: nothing can anyone help me?

1 Like

https://github.com/larsklitzke/homeassistant-openvpn-client works,
but now I can’t connect hass.io device through openvpn lan :frowning:

That addon does not work for me. I have only CA certificate of the external server and user with password. that addons need private keys.

Why do you need hass.io to connect to a remote vpn server? Why not have your network device do this and setup the required routes?

I need to connect by vpn to another remote server that is in another country where I have sensors to control, it is not safe to establish a route in the local network without vpn. when I just need to connect the hass.io to the remote server.

Hi, sorry, it’s for security, I need that setup, and more people with security and who won’t opening home from outside…

Client OpenVPN to connect outside my network

I need to connect from my hassio to an OpenVPN server. I have to authenticate with username and password. I have the CA certificate.

Hi if you are using raspbian as base os then it is just simply a case of installing openvpn client on raspbian and make sure that it connects to your network. Hass will work as normal as it will be on the same network as the things you wish to control even though it is technically remote

thnx, but now Im using hass.io if I start with raspbian, yes it’s possible

I still don’t understand why this is not doable.

  1. Have your router connect to the the remote vpn. Most routers can do this.
  2. Route traffic from hassio to the remote IP over the vpn. So there should not be any need to mess around with custom devices like hassio.

It seems like you are trying to solve the wrong problem.

My HASS setup is only accessible over VPN. And I also have remote location with site to site VPN setup. The internal devices have no clue how they are connected. All they see is an IP or hostname and the router does all the work (what routers do best). By setting up correct route and firewall rules, you can control which devices can talk to each other over your network.

The routing does not have to do anything at all, if I connect from my hass.io by OpenVPN client to work with the sensors in the remote site it must be transparent to the router or any external routing to my hass.io. I just need to open an OpenVPN client in my hass.io. I work with many servers and I connect from my porthole with the OpenVPN client and transparently access any device within the remote networks.
I connect from my laptop with the OpenVPN client like this:

client
dev tap
proto udp
remote 180.210.166.54
resolv-retry infinite
nobind
persist-key
persist-tun
ca mi-cacert.pem
auth-user-pass
comp-lzo
The ip published that he wrote is fictional.
This is what I want to do with my hass.io to be able to monitor temperatures remotely.
Is it possible to install an OpenVPN client in hass.io with the configuration that was written above?
I am doing what is necessary to maintain the encrypted communications between the hass.io and the OpenVPN server where I am connected. It is not correct to make routes on the routers without encrypting the traffic between the two points.
Excuse my English, it’s very bad.

1 I only want to access the remote server only from my hassio and not that the entire local network can route that traffic

2 The OpenVPN client does the routing only without using any router.

3 I am trying to solve this correctly.

4 If you need more information to help me, please request it and I will gladly provide it.

Thank you

1 Like

I think that this conflicts with interest of Nabucasa as it will compete with the cloud service that is provided.

Openvpn doesn’t work with default hass.io 32-bit RPi4 default image because TUN/TAP support is not enabled in Linux kernel. lsmod | grep tun gives nothing and OpenVPN complains ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)

Is it by design?

I think what you are trying to accomplish may be easier to do with home assistant core installed on raspbian or similar, where you might be able to setup an ovpn client that HA can use.

1 Like

did you resolve this?

I have no access to the router than my internet is provided to me (rental accomodation) which is why i need to connect to an openvpn server, which is a route forward point that i can direct internet traffic to in the same way like duckdns, except that this service routes traffic through a connected vpn connection.

i couldnt get openvpn addon to work at all