OpenVPN Client for any TV, TV-boxes or Game Consoles, provides OpenVPN client running as a service on your Raspberry Pi or any other Linux device. Supports Wired (Ethernet) and Wireless (WiFi) connection types to your devices. Every VPN provider will have configuration files for openvpn (Proton, Nord, Surfshark, Express) as well as you may use respberry-gateway or openvpn-aws to create your own VPN server and generate client configuration files compatible with this project.
When you have your Raspberry Pi with Raspbian OS installed and configured, you can start with VPNTV installation steps described below:
-
Login on your Raspberry Pi as
vpntvuser and update your Raspberry Pi OS:sudo apt-get update && sudo apt-get upgrade -yNote: In case official repositories are not available:
echo "deb http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian/ bullseye main contrib non-free rpi" | sudo tee -a /etc/apt/sources.listthensudo apt-get update && sudo apt-get upgrade -y -
Install Ansible:
sudo apt-get install -y git ansible
-
Clone this repository:
git clone https://github.com/d3vilh/vpntv
-
Then enter the repository directory:
cd vpntv -
Install requirements:
ansible-galaxy collection install -r requirements.yml
If you see
ansible-galaxy: command not found, you have to relogin (or reboot your Pi) and then try again. -
Make copies of the configuration files and modify them for your enviroment:
yes | cp -p example.inventory.ini inventory.ini yes | cp -p example.config.yml config.yml
-
Modify
config.ymlto your needs. To enable WiFi connection for your TV changewifi_enable falseoption towifi_enable trueand vs to disable.List of available options
-
ovpnclient_enable - enable or disable OpenVPN client service. You need to have OpenVPN client configuration file in
client-ovpndirectory (see next installation step). -
ethernet2wifi_enable - enable or disable TV over WiFi connection, while VPNTV connected by Ethernet cable to your home Router. You need to configure here WiFi network name and password of new AP which will be up on vpntv. Prefferable setup. Can't be used with other connection options at the same time.
-
wifi2wifi_enable - enable or disable VT over WiFi connection. VPNTV connects to your home WiFi network and create new WiFi network for your TV. You need to configure here WiFi network name and password of new AP which will be up on vpntv. Used only if you have WiFi dongle connected to your Raspberry Pi. Can't be used with other connection options at the same time.
-
wifi_mod_enable - enable or disable custom WiFi modules installation. You need to enable it if your WiFi dongle does not support AP mode by Raspberry Pi OS by default. Refer to the list of all supported WiFi dongles.
-
wifi2ethernet_enable - enable or disable TV over Ethernet connection. Used only if your TV has Ethernet cable connected to your Raspberry Pi. Can't be used with other connection options at the same time.
Note: You can use only one connection option at the same time. Choose wisely and don't forget to disable (
false) all other options. -
-
Copy your OpenVPN client configuration file to
client-ovpndirectory and rename it toclient.ovpn. Here is example of client.ovpn file configuration. All the parameters ofclient.ovpndepends on your VPN Server configuration.Note: You may use respberry-gateway or openvpn-aws to create your own VPN server and generate client configuration files compatible with VPNTV project. Or go with Proton, Nord, Surfshark, Express, etc profiles.
-
Modify
inventory.iniby replace of IP address with your Pi's IP, or comment that line and uncomment theconnection=localline if you're running it on the Pi you're setting up. -
Run installation playbook:
ansible-playbook main.yml
Note: If running locally on the Pi, you may have error like
Error while fetching server API version. You have to relogin (or reboot your Pi) and then run the playbook again. -
Reboot your Pi:
sudo reboot
-
After the reboot, VPNTV will initiate OpenVPN connection to your VPN server and create WiFi network for your TV. You can connect to it and start using your VPN connection. If your preffered connection option is Ethernet - connect VPNTV to the Ethernet port of your TV and you are ready to go.
If for some reasons you want to remove one or all VPNTV software components from your Raspberry Pi, you can do it following by these steps:
-
Modify
config.ymlto set true components you desired to remove. For example, to remove WiFi modules - changewifi_module_removeoption fromfalsetotrue.List of all removal options
Note: You can remove all components at the same time or do it one by one.
-
wifi_config_remove - true/false when
true- removes all types of VPNTV connections configuration and stop the serives. -
wifi_module_remove - true/false when
true- removes custom WiFi modules and restore original Realtek 8188 module. -
ovpnclient_remove - true/false when
true- removes OpenVPN client service, configuration and OpenVPN packages.
-
-
Run removal playbook:
ansible-playbook remove.yml
-
Reboot your Pi:
sudo reboot


