<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kodi Archives - VPN Expert</title>
	<atom:link href="https://vpn-expert.info/tag/kodi/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Life is too short to remove USB safely …</description>
	<lastBuildDate>Sat, 03 Jun 2023 12:46:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.2</generator>
	<item>
		<title>curl: send messages from the Raspberry Pi (Linux) to Kodi</title>
		<link>https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/</link>
					<comments>https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/#respond</comments>
		
		<dc:creator><![CDATA[guyfawkes]]></dc:creator>
		<pubDate>Mon, 20 Apr 2020 07:52:32 +0000</pubDate>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Apprise]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Kodi]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mediacentre]]></category>
		<category><![CDATA[Pushover]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Raspbian]]></category>
		<category><![CDATA[Slack]]></category>
		<guid isPermaLink="false">https://vpn-expert.info/?p=321</guid>

					<description><![CDATA[<p>Getting notifications in case of an event is not really a big deal these days. Most people have smartphones and use them to get messages. There are also several ways you can have your Raspberry Pi send a message to your smartphone. This works very well via Python (Pushover / Apprise), Slack but also email. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/">curl: send messages from the Raspberry Pi (Linux) to Kodi</a> appeared first on <a rel="nofollow" href="https://vpn-expert.info">VPN Expert</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Getting notifications in case of an event is not really a big deal these days. Most people have smartphones and use them to get messages. There are also several ways you can have your Raspberry Pi send a message to your smartphone. This works very well via <a href="https://vpn-expert.info/coronavirus-beware-of-malware-better-make-own-update-ticker-monthofmaking/"><em>Python</em> (<em>Pushover / Apprise</em>), <em>Slack</em> but also <em>email</em></a>. But it is also possible to send messages to Kodi using <strong>curl</strong>. If your Raspberry Pi is responsible for an automatic process and you definitely want to be informed about important things, you could also have a notification sent to you when you watch a movie, for example.</p>



<p>It&#8217;s really <em>send to Kodi</em> and therefore it doesn&#8217;t matter if you use the multimedia center on an Android box or even a Raspberry Pi via <em>LibreELEC</em>.</p>



<p><strong>Note:</strong> All other methods that allow you to send parameters to Kodi via <em>POST</em> also work. Under Linux <em>curl</em> is very handy because in most cases it is preinstalled. As far as I know it is also preinstalled on the Raspberry Pi, more precisely Raspbian. If not this command helps:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo apt install curl</code></pre>



<p>Now the problem is solved.</p>



<h2 class="wp-block-heading">Allow remote control via HTTP &#8211; then curl works</h2>



<p>However, there is one requirement for sending a message from your Raspberry Pi to Kodi. You must <em>Allow remote control via HTTP</em> in the settings. This is not difficult. The path looks like this:</p>



<p><em>Settings > Services > Control > Allow remote control over HTTP</em></p>



<p>Here a screenshot as a reference:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="576" src="https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-1024x576.jpg" alt="Allow remote control via HTTP in the settings – now you can send messages from your Raspberry Pi via curl" class="wp-image-323" srcset="https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-1024x576.jpg 1024w, https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-300x169.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-768x432.jpg 768w, https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-1536x864.jpg 1536w, https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http.jpg 1600w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Allow remote control via HTTP in the settings – now you can send messages from your Raspberry Pi via curl</figcaption></figure>



<p><strong>Tip:</strong> To create a screenshot in Kodi use the keyboard shortcut <em>ctrl</em> + <em>S</em>.</p>



<p>That&#8217;s all and you can now send messages from a Raspberry Pi or any other Linux distribution to the Raspberry Pi using curl. The command itself works like this (you have to change IP address and port accordingly):</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">curl -v -H "Accept: application/json" -H "Content-type: application/json" -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"My Title!","message":"My Message","displaytime":'"5000"'}}' http://&lt;IP address Kodi>:&lt;Port>/jsonrpc</code></pre>



<p>But as you may have noticed in my screenshot of the settings, you can only control my Kodi installation via <em>username</em> and <em>password</em>. If you set it up that way, you have to pass both parameters to curl. The addition <em>-u username:password</em> does that. The command now looks like this:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">curl -v -u username:password -H "Accept: application/json" -H "Content-type: application/json" -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"My Title!","message":"My Message","displaytime":'"5000"'}}' http://&lt;IP address Kodi>:&lt;Port>/jsonrpc</code></pre>



<p>The parameters <em>title</em> and <em>message</em> are clear. They just send title and message. The <em>displaytime</em> shows the duration of the message on the screen in milliseconds. So in my case it would be 5 seconds. A parameter <em>image</em> would also be possible, as you can read in the <a href="https://kodi.wiki/view/JSON-RPC_API/v8#GUI.ShowNotification" target="_blank" rel="noreferrer noopener">wiki of Kodi</a>.</p>



<p>The result in a movie would look like this:</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://vpn-expert.info/wp-content/uploads/2020/04/kodi-my-message-1024x576.jpg" alt="I sent a message to Kodi using curl" class="wp-image-322"/><figcaption>I sent a message to Kodi using curl</figcaption></figure>



<p>Even if you don&#8217;t have your smartphone near you in the evening or set it to quiet so you&#8217;re not disturbed while watching your movie, you can have important messages sent directly to Kodi.</p>



<p></p>
<p>The post <a rel="nofollow" href="https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/">curl: send messages from the Raspberry Pi (Linux) to Kodi</a> appeared first on <a rel="nofollow" href="https://vpn-expert.info">VPN Expert</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>VPN Router – Raspberry Pi, RaspAP and NordVPN (Wi-Fi Hotspot / Access Point)</title>
		<link>https://vpn-expert.info/vpn-router-raspberry-pi-raspap-and-nordvpn-wi-fi-hotspot-access-point/</link>
					<comments>https://vpn-expert.info/vpn-router-raspberry-pi-raspap-and-nordvpn-wi-fi-hotspot-access-point/#comments</comments>
		
		<dc:creator><![CDATA[guyfawkes]]></dc:creator>
		<pubDate>Thu, 09 Jan 2020 08:07:19 +0000</pubDate>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Access Point]]></category>
		<category><![CDATA[Buster]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Hotspot]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Kodi]]></category>
		<category><![CDATA[LibreELEC]]></category>
		<category><![CDATA[NordLynx]]></category>
		<category><![CDATA[NordVPN]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[RaspAP]]></category>
		<category><![CDATA[Raspbian]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Virtual Private Network]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[VPN Router]]></category>
		<category><![CDATA[Wi-Fi]]></category>
		<category><![CDATA[WireGuard]]></category>
		<guid isPermaLink="false">https://vpn-expert.info/?p=45</guid>

					<description><![CDATA[<p>To use your Raspberry Pi as a hotspot or access point is actually straightforward. You will find many guides that talk about lengthy manual configurations via command line with hostapd and so on. But it is actually much easier if you use RaspAP. Not only is the installation much easier – you also get a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://vpn-expert.info/vpn-router-raspberry-pi-raspap-and-nordvpn-wi-fi-hotspot-access-point/">VPN Router – Raspberry Pi, RaspAP and NordVPN (Wi-Fi Hotspot / Access Point)</a> appeared first on <a rel="nofollow" href="https://vpn-expert.info">VPN Expert</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>To use your Raspberry Pi as a <strong>hotspot</strong> or <strong>access point</strong> is actually straightforward. You will find many guides that talk about lengthy manual configurations via command line with <em>hostapd</em> and so on. But it is actually much easier if you use <strong>RaspAP</strong>. Not only is the installation much easier – you also get a graphical interface (GUI) to manage your Wi-Fi hotspot or access point. Once this is done, you only need a few simple additional steps to <strong>turn your Raspberry Pi into a <a href="https://vpn-expert.info/vpn-virtual-private-network-what-is-it-why-do-i-need-one/">VPN</a> router</strong>. RaspAP does work <em>Raspbian Buster</em> that I am using in this tutorial.</p>



<h2 class="wp-block-heading">Quick guide how to use your Raspberry Pi as a VPN router</h2>



<p>To use your Raspberry Pi as a VPN router seems to be more complicated that it actually is. In a nutshell those are the steps required:</p>



<div class="schema-how-to wp-block-yoast-how-to-block"><p class="schema-how-to-description"></p> <ol class="schema-how-to-steps"><li class="schema-how-to-step" id="how-to-step-1685796148435"><strong class="schema-how-to-step-name"><strong>Install Raspbian Buster</strong></strong> <p class="schema-how-to-step-text"><strong>Install Raspbian Buster </strong>onto your Raspberry Pi. I am using <strong>Raspbian Light</strong> as a graphical interface is not necessary.<img width="405" height="306" src="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_1.png" class="attachment-full size-full" alt="" decoding="async" loading="lazy" style="max-width: 100%; height: auto;" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_1.png 405w, https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_1-300x227.png 300w" sizes="(max-width: 405px) 100vw, 405px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1685796161357"><strong class="schema-how-to-step-name">Get <strong>RaspAP</strong></strong> <p class="schema-how-to-step-text">Get <strong>RaspAP </strong>up and running. This turns your Raspberry Pi into a <strong>Wi-Fi hotspot or access point</strong>.<img width="405" height="306" src="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_2.png" class="attachment-full size-full" alt="" decoding="async" loading="lazy" style="max-width: 100%; height: auto;" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_2.png 405w, https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_2-300x227.png 300w" sizes="(max-width: 405px) 100vw, 405px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1685796167840"><strong class="schema-how-to-step-name">Get a VPN</strong> <p class="schema-how-to-step-text">Get a VPN that runs on Raspbian and ideally one with a command line client. I&#8217;m using NordVPN as it has one of the <strong>most versatile Linu</strong>x clients on the market. You can try NordVPN as the service offers a <strong>30-day money-back-guarantee</strong>. It is undoubtedly one of the best VPNs on the market. <a href="https://vpn-expert.info/link/nordvpn-vpnrouter/">Try NordVPN 30 days <strong>without risk</strong>!</a>*<img width="405" height="306" src="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_3.png" class="attachment-full size-full" alt="" decoding="async" loading="lazy" style="max-width: 100%; height: auto;" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_3.png 405w, https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_3-300x227.png 300w" sizes="(max-width: 405px) 100vw, 405px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1685796174242"><strong class="schema-how-to-step-name"><strong>Install the VPN</strong></strong> <p class="schema-how-to-step-text"><strong>Install the VPN</strong> on Rasbian and connect to a server.<img width="405" height="306" src="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_4.png" class="attachment-full size-full" alt="" decoding="async" loading="lazy" style="max-width: 100%; height: auto;" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_4.png 405w, https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_4-300x227.png 300w" sizes="(max-width: 405px) 100vw, 405px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1685796185742"><strong class="schema-how-to-step-name"><strong>Enjoy your VPN router!</strong></strong> <p class="schema-how-to-step-text"><img width="405" height="306" src="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_5.png" class="attachment-full size-full" alt="" decoding="async" loading="lazy" style="max-width: 100%; height: auto;" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_5.png 405w, https://vpn-expert.info/wp-content/uploads/2020/01/vpn_router_5-300x227.png 300w" sizes="(max-width: 405px) 100vw, 405px" /></p> </li></ol></div>



<h3 class="wp-block-heading">Quick Guide from the comments (thanks!)</h3>



<p>Software changes and sometimes it gets easier. Thanks for this quick guide from a recent installation:</p>



<ol>
<li>Update the system and set Wi-Fi country (<a href="https://raspap.com/#manual-installation">https://raspap.com/#manual-installation</a> Prerequisites)</li>



<li><a href="https://vpn-expert.info/link/nordvpn-vpnrouter/">Get NordVPN</a>* and install the client (you might need to reboot here)</li>



<li>Configure the client:</li>



<li>Log in</li>



<li>Whitelist ports 22, 67-68 (<code>nordvpn whitelist add port</code> or <code>nordvpn whitelist add ports</code>)</li>



<li>Switch to nordlynx (<code>nordvpn set technology nordlynx</code>)</li>



<li>Deactivate NordVPN Firewall: <code>nordvpn set firewall off</code></li>



<li>Install RaspAP</li>



<li>Configure RaspAP:</li>



<li>Change SSID, password etc.</li>



<li>Use NordVPN DNS addresses (103.86.96.100 and 103.86.99.100) in RaspAP to avoid leaks</li>



<li>Restart</li>
</ol>



<p>That is pretty straightforward and really worth a try.</p>



<p><strong>Update:</strong> With Linux client 3.9.0 you can set the firewall on or off (<em>nordvpn set firewall on/off)</em>. That might be helpful as well for your router.</p>



<p>If your connection does freeze once in a while &#8211; maybe that script helps:</p>



<pre class="wp-block-code"><code>! /bin/bash

PING="/bin/ping -q -c1"
HOST=example.com

${PING} ${HOST}
if &#91; $? -ne 0 ]; then
/usr/bin/systemctl restart nordvpnd.service
sleep 45
/usr/sbin/runuser -l pi -c 'nordvpn c UK'
fi</code></pre>



<p>Please check <em>HOST</em> in case you want to ping something else. Also change the user after <em>runuser -l </em>&#8211; in my case that is <em>pi</em> because the script runs on a Raspberry Pi läuft. The script starts the MordVPN daemon new if the ping fails &#8211; after a certain waiting time it connects to the UK. Of course, you can change that as well.</p>



<h2 class="wp-block-heading">Prerequisites for using RaspAP on a Raspberry Pi</h2>



<p>For this to work, you need a Raspberry Pi with two network cards. One of them must logically be a wireless network card (Wi-Fi) because it serves as a hotspot or access point. The other network card could theoretically also be a wireless network card, but better is the integrated Ethernet interface. The Raspberry Pi 4 shown below also works, of course.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="599" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspberry-pi-4-1024x599.jpg" alt="Raspberry Pi 4 – RaspAP is working quite well on it and we ca use it as a VPN router (source: raspberrypi.org)" class="wp-image-46" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspberry-pi-4-1024x599.jpg 1024w, https://vpn-expert.info/wp-content/uploads/2020/01/raspberry-pi-4-300x175.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspberry-pi-4-768x449.jpg 768w, https://vpn-expert.info/wp-content/uploads/2020/01/raspberry-pi-4.jpg 1166w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Raspberry Pi 4 – RaspAP is working quite well on it and we ca use it as a VPN router (source: raspberrypi.org)</figcaption></figure></div>


<p>Let&#8217;s put it this way: The easiest way is to use a Raspberry Pi that already has an Ethernet and wireless interface. The Pi expert knows immediately that we are talking about the Pi 3 B upwards. For Pis without an integrated Wi-Fi card, it&#8217;s best to use a cheap, compatible USB network interface. I have had very good experiences with the Edimax. The cost is about 7 Euro.</p>



<p>Logically you need a suitable power supply, a microSD card and so on. With the microSD card a relatively small one is enough, but you hardly get anything under 16 GB these days. They only cost about 10 Euro — affordable so. You also need a network cable if you want to follow my instructions.</p>



<p>Mouse, keyboard and screen are not necessary! As already mentioned, I use Raspbian Buster as my operating system. But the lite version is enough for me, and we configure the operating system so that you can access it immediately via SSH.</p>



<h2 class="wp-block-heading">Which Raspberry Pi should I use for the hotspot?</h2>



<p>That&#8217;s a good question. The new Raspberry Pi 4 is powerful and works very well but it needs more power than its predecessors. If you don&#8217;t want to buy an additional network card, you can use both Pi 3 B and Pi 3+ B. The most energy saving would probably be a Raspberry Pi Zero W, if you extend it with an Ethernet interface. It might not powerful enough for a task like that but I didn&#8217;t test it to be honest.</p>



<h3 class="wp-block-heading">My scenario</h3>



<p>I tested RaspAP with a Raspberry Pi 3+ and used the integrated network interfaces. The Ethernet interface was connected to the router. This is my gateway to the Internet.</p>



<h2 class="wp-block-heading">Install Raspbian Buster Lite on the microSD card</h2>



<p>In the <a href="https://www.raspberrypi.org/downloads/raspbian/">download area of the project page</a> you can find the image for <em>Raspbian Buster Lite</em>. It has 426 MB and should be downloaded relatively fast.</p>



<p><strong>Update:</strong> The Raspberry Pi Imager is a nice option to install Raspberry Pi OS Lite.</p>



<p>As soon as you have the image, you can upload it to your microSD card. I use <a href="https://www.balena.io/etcher/"><strong>Etcher</strong></a> because it&#8217;s the most convenient way. But also <em>dd</em> or other options are possible.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="797" height="508" src="https://vpn-expert.info/wp-content/uploads/2020/01/buster-lite-etcher.png" alt="Installing Raspbian Buster Lite via Etcher – first step for our VPN router" class="wp-image-47" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/buster-lite-etcher.png 797w, https://vpn-expert.info/wp-content/uploads/2020/01/buster-lite-etcher-300x191.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/buster-lite-etcher-768x490.png 768w" sizes="(max-width: 797px) 100vw, 797px" /><figcaption class="wp-element-caption">Installing Raspbian Buster Lite via Etcher – first step for our VPN router</figcaption></figure></div>


<p>Depending on the OS and speed of the microSD card, the installation may take a while. Once <strong>the image has been installed, mount the microSD card again because we immediately prepare the operating system for remote access</strong>.</p>



<h3 class="wp-block-heading">SSH access from the beginning</h3>



<p>Simply create an empty <em>ssh</em> file on the <em>boot</em> partition without an extension. This is very easy under Linux. For example, the command <em>touch ssh</em> is sufficient. The boot partition looks like this afterwards:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="571" src="https://vpn-expert.info/wp-content/uploads/2020/01/ssh-file-1024x571.jpg" alt="Create the file ssh and you will get remote access" class="wp-image-48" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/ssh-file-1024x571.jpg 1024w, https://vpn-expert.info/wp-content/uploads/2020/01/ssh-file-300x167.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/01/ssh-file-768x428.jpg 768w, https://vpn-expert.info/wp-content/uploads/2020/01/ssh-file.jpg 1078w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Create the file ssh and you will get remote access</figcaption></figure></div>


<p>If the file <em>ssh</em> exists, Raspbian activates the SSH server at system startup and you can access the operating system via <em>Secure Shell</em>. This way you don&#8217;t need a screen, keyboard or mouse. If you connect the Pi to the router via the Ethernet network cable, no further configuration is necessary because the <strong>Pi is assigned an IP address by the DHCP server of the router</strong>.</p>



<p>It gets a little more complicated if there is no DHCP server in the network or if you want to use a wireless network card as gateway. As already mentioned, the Pi in my case uses a network cable.</p>



<h2 class="wp-block-heading">Determining the IP address of the pi</h2>



<p>If you have started the Raspberry Pi, then you find out the IP address. Usually it is enough to check the router. Most routers tell you which devices are within the network and which IP addresses have been assigned.</p>



<p>I like to assign static IP addresses to such devices. Normally, you can assign an IP address to a MAC address in the DHCP server of the router. This way the Raspberry Pi always gets the same IP address and you don&#8217;t have to configure it within the operating system. Another advantage of this method is that the DHCP server does not assign the IP address to any other device. DNS servers and so on are also assigned to the PI by the router.</p>



<p>As soon as you know the IP address, remote access should be possible. In my case, the IP address was <strong>192.168.1.2</strong>. By default, the <strong>name</strong> and <strong>password</strong> of the SSH access on a Pi are: <strong>pi</strong> and <strong>raspberry</strong>:</p>



<pre class="wp-block-code"><code>ssh pi@192.168.1.2</code></pre>



<p>On first access you have to confirm that access is really granted.</p>



<p>As soon as you are logged on to the Raspberry Pi, you should <strong>change the password for the user pi immediately</strong>, otherwise everyone in the same network <strong>can get access to your device</strong>. Either you use the command <em>passwd</em> or you open the Pi configuration:</p>



<pre class="wp-block-code"><code>sudo raspi-config</code></pre>



<p>This opens the command line configuration tool.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="909" height="348" src="https://vpn-expert.info/wp-content/uploads/2020/01/change-password.png" alt="Change your password immediately" class="wp-image-49" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/change-password.png 909w, https://vpn-expert.info/wp-content/uploads/2020/01/change-password-300x115.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/change-password-768x294.png 768w" sizes="(max-width: 909px) 100vw, 909px" /><figcaption class="wp-element-caption">Change your password immediately</figcaption></figure></div>


<p>Because the configuration tool is already open, you can also set the country settings right away — if necessary:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="908" height="386" src="https://vpn-expert.info/wp-content/uploads/2020/01/language-settings.png" alt="Change locale if you want to" class="wp-image-50" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/language-settings.png 908w, https://vpn-expert.info/wp-content/uploads/2020/01/language-settings-300x128.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/language-settings-768x326.png 768w" sizes="(max-width: 908px) 100vw, 908px" /><figcaption class="wp-element-caption">Change locale if you want to</figcaption></figure></div>


<h2 class="wp-block-heading">Update Raspbian Buster straight away</h2>



<p>It is also <strong>advisable to update the system</strong>. An upgrade never hurts and Raspbian know the drill anyway:</p>



<pre class="wp-block-code"><code>sudo apt update
sudo apt dist-upgrade
sudo reboot</code></pre>



<p>Now you need to restart the device before you continue. After that, you have to reconnect to the Pi via SSH. Once the operating system Raspbian Buster is updated and the system restarted, we can convert the Pi into hotspot with RaspAP.</p>



<h2 class="wp-block-heading">Installing RaspAP &#8211; step by step</h2>



<p>Now we install RaspAP. The project page can be found at <a href="https://raspap.com">raspap.com</a>. We don&#8217;t have to visit it directly, but it doesn&#8217;t hurt to know the source. If you are logged in on your Pi, you install RaspAP just like that:</p>



<pre class="wp-block-code"><code>wget -q https://git.io/voEUQ -O /tmp/raspap &amp;&amp; bash /tmp/raspap</code></pre>



<p>The installation is starting now:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="951" height="918" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-wget-command.png" alt="Install RaspAP with wget" class="wp-image-51" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-wget-command.png 951w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-wget-command-300x290.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-wget-command-768x741.png 768w" sizes="(max-width: 951px) 100vw, 951px" /><figcaption class="wp-element-caption">Install RaspAP with wget</figcaption></figure></div>


<p>During the installation I had to answer a few questions, which I answered with Yes: <em>http-cookies -&gt; Yes &#8211; Control service -&gt; Yes</em></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="83" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-php-configuration-1024x83.png" alt="RaspAP: installation PHP configuration" class="wp-image-52" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-php-configuration-1024x83.png 1024w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-php-configuration-300x24.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-php-configuration-768x63.png 768w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-php-configuration.png 1056w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">RaspAP: installation PHP configuration</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="528" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-control-service-1024x528.png" alt="RaspAP: installation control service" class="wp-image-58" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-control-service-1024x528.png 1024w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-control-service-300x155.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-control-service-768x396.png 768w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-control-service.png 1082w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">RaspAP: installation control service</figcaption></figure></div>


<p>Furthermore, the system asks if you want to install the ad blocker and the OpenVPN client. I installed both. The functions don&#8217;t hurt, and you don&#8217;t have to use them if you don&#8217;t want to.</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="656" height="483" src="https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-install.png" alt="You have the option to install an ad blocker and the OpenVPN client" class="wp-image-441" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-install.png 656w, https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-install-300x221.png 300w" sizes="(max-width: 656px) 100vw, 656px" /><figcaption class="wp-element-caption">You have the option to install an ad blocker and the OpenVPN client</figcaption></figure>



<p>That&#8217;s all and it! RaspAP is installed on your system!</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="726" height="52" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-finished.png" alt="RaspAP: installation finished – the groundwork for the VPN router is done" class="wp-image-57" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-finished.png 726w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-installation-finished-300x21.png 300w" sizes="(max-width: 726px) 100vw, 726px" /><figcaption class="wp-element-caption">RaspAP: installation finished – the groundwork for the VPN router is done</figcaption></figure></div>


<p>As you can see in the screenshot, the system wants to restart. So, we do RaspAP the favor.</p>



<h3 class="wp-block-heading">IP address of RaspAP or the hotspot</h3>



<p>By default, the hotspot gateway has the IP address <strong>10.3.141.1</strong>. This is fine because it does not interfere with the other 192.168.1.x network. I have not changed anything at this point. As DHCP area RaspAP is preconfigured with 10.3.141.50 to 10.3.141.255.</p>



<p>By default RaspAP has the name <strong>raspi-webgui</strong> as <strong>SSID</strong> and the <strong>password</strong> is <strong>ChangeMe</strong>. The hotspot or access point is now ready for use and you can log in. You can change the password and SSID in the web GUI if you want.</p>



<p>Here is what you need to know as the default settings:</p>



<ul>
<li><strong>IP address:</strong> 10.3.141.1</li>



<li><strong>Username:</strong> admin</li>



<li><strong>Password:</strong> secret</li>



<li><strong>DHCP range:</strong> 10.3.141.50 — 10.3.141.255</li>



<li><strong>SSID:</strong> raspi-webgui</li>



<li><strong>Password:</strong> ChangeMe</li>
</ul>



<h3 class="wp-block-heading">RaspAP&#8217;s web gui</h3>



<p>You configure your hotspot completely via your browser. Either you log in to the hotspot and use URL 10.3.141.1 or you are in another network and open the admin interface with (in my case) 192.168.1.2.</p>



<p>By default, you log in with <strong>admin</strong> and <strong>secret</strong>. At this point I would advise you to change all passwords first and adapt the hotspot to your needs. You can also configure the DHCP server via the web GUI. Here are some screenshots, how it looks like.</p>



<p>Under <em>Configure hotspot</em> -&gt; <em>Basic</em> you can configure how the Pi hotspot should be found. In my case I changed it to <strong>pi-hotspot</strong> for example.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="905" height="758" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-hotspot-change-ssid.png" alt="RaspAP: Change the SSID of the hotspot" class="wp-image-56" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-hotspot-change-ssid.png 905w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-hotspot-change-ssid-300x251.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-hotspot-change-ssid-768x643.png 768w" sizes="(max-width: 905px) 100vw, 905px" /><figcaption class="wp-element-caption">RaspAP: Change the SSID of the hotspot</figcaption></figure></div>


<p>That works and I can connect:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="779" height="578" src="https://vpn-expert.info/wp-content/uploads/2021/03/raspap-connected.png" alt="" class="wp-image-435" srcset="https://vpn-expert.info/wp-content/uploads/2021/03/raspap-connected.png 779w, https://vpn-expert.info/wp-content/uploads/2021/03/raspap-connected-300x223.png 300w, https://vpn-expert.info/wp-content/uploads/2021/03/raspap-connected-768x570.png 768w" sizes="(max-width: 779px) 100vw, 779px" /><figcaption class="wp-element-caption">My Raspberry Pi is already working as a hotspot</figcaption></figure></div>


<p>A <em>ping</em> to my website confirms to me that I can access the internet via RaspAP.</p>



<p>You change the password for the hotspot under <em>Configure hotspot -&gt; Security</em>. Maybe you want to change <em>Security type</em> to <strong>WPA + WPA2</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="947" height="658" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-hotspot-password.png" alt="Set the password of the hotspot / RaspAP" class="wp-image-54" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-hotspot-password.png 947w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-hotspot-password-300x208.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-hotspot-password-768x534.png 768w" sizes="(max-width: 947px) 100vw, 947px" /><figcaption class="wp-element-caption">Set the password of the hotspot / RaspAP</figcaption></figure></div>


<p>The settings or the DHCP server are under <em>Configure DHCP Server</em>:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="880" height="709" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-dhcp-server.png" alt="Configure the DHCP server of RaspAP" class="wp-image-53" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-dhcp-server.png 880w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-dhcp-server-300x242.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-dhcp-server-768x619.png 768w" sizes="(max-width: 880px) 100vw, 880px" /><figcaption class="wp-element-caption">Configure the DHCP server of RaspAP</figcaption></figure>



<p>In most cases you don&#8217;t have to change these settings.</p>



<h2 class="wp-block-heading">More settings for RaspAP</h2>



<p>The hotspot software also offers a console.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="748" height="493" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-console.png" alt="RaspAP's console – certainly has it's limits" class="wp-image-73" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-console.png 748w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-console-300x198.png 300w" sizes="(max-width: 748px) 100vw, 748px" /><figcaption class="wp-element-caption">RaspAP&#8217;s console – certainly has it&#8217;s limits</figcaption></figure></div>


<p>However, it is only of limited use, since it does not give you <em>root</em> access and you cannot switch with <em>sudo</em>. I would leave that as is and manage the operating system exclusively via SSH.</p>



<p>You don&#8217;t like the theme? Change it! There are a few other options like a terminal theme.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="829" height="497" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-theme-terminal.png" alt="RaspAP offers a terminal theme" class="wp-image-72" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-theme-terminal.png 829w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-theme-terminal-300x180.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-theme-terminal-768x460.png 768w" sizes="(max-width: 829px) 100vw, 829px" /><figcaption class="wp-element-caption">RaspAP offers a terminal theme</figcaption></figure></div>


<p>if you open the <em>Dashboard</em> you always see the most important settings straight away.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="929" height="515" src="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-interface-dashboard.png" alt="Dashboard of RaspAP" class="wp-image-71" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/raspap-interface-dashboard.png 929w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-interface-dashboard-300x166.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/raspap-interface-dashboard-768x426.png 768w" sizes="(max-width: 929px) 100vw, 929px" /><figcaption class="wp-element-caption">Dashboard of RaspAP</figcaption></figure></div>


<p>As you can see, the installation of RaspAP is simple. But basic knowledge of networks in general is helpful.</p>



<h3 class="wp-block-heading">Changing the DNS server of RaspAP</h3>



<p><strong>Update: </strong>In more recent installations of RaspAP you can set the DNS addresses within the GUI. There is no need to do it via command line if you prefer a graphical interface.</p>



<p>By default, RaspAP uses <strong>1.1.1.1</strong> (Cloudflare) and <strong>8.8.8.8</strong> (Google) as DNS servers. The DNS servers are stored in the file <strong>/etc/dhcpcd.conf</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="426" height="90" src="https://vpn-expert.info/wp-content/uploads/2020/01/dns-server-raspap.jpg" alt="The DNS servers that RaspAP uses are in /etc/dhcpcd.conf" class="wp-image-70" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/dns-server-raspap.jpg 426w, https://vpn-expert.info/wp-content/uploads/2020/01/dns-server-raspap-300x63.jpg 300w" sizes="(max-width: 426px) 100vw, 426px" /><figcaption class="wp-element-caption">The DNS servers that RaspAP uses are in /etc/dhcpcd.conf</figcaption></figure></div>


<p>If you want to use your own, change this here. Maybe you have the adblocker Pi-Hole in your network and RaspAP should use it as DNS server. FreeDNS is also a nice alternative.</p>



<p>Your Raspberry Pi is now a <strong>working Wi-Fi hotspot </strong>or <strong>access point</strong>. Now we will turn it into a VPN router. Did you already register with NordVPN?</p>



<p><p style="text-align: center;"><span class="mainSpanButton"><strong><a href="https://go.nordvpn.net/aff_c?offer_id=20&amp;aff_id=18693&amp;url_id=1406&amp;source=v-std2">NordVPN – superb for router</a></strong></span></p></p>



<p>Once you have RaspAP installed and running, take the next step and build your own VPN router. These are just a few additional steps. In this article, I&#8217;ll explain step-by-step how it works.</p>



<h2 class="wp-block-heading">VPN router only counts as one device!</h2>



<p>Many VPN providers allow the use on a router and your <strong>Raspberry Pi will only count as 1 device or 1 connection</strong>, no matter how many smartphones, tablets and computers are connected to it.</p>



<p>That is a nice advantage if you ask me. Furthermore, you can use it as a Wi-Fi access point for devices <strong>where no VPN client does exist for</strong>. Connect your <strong>Chromecast</strong> to the VPN router, your <strong>Smart TV</strong>, your <strong>gaming console </strong>and so on.</p>



<p>A VPN router is also an excellent choice if you want to connect a Kodi device to it. <strong>LibreELEC</strong> is a very nice operating system if you want to <strong>install Kodi on a Raspberry Pi</strong>. But there is no easy way to use VPN apps for Kodi or LibreELEC. However, you could connect your LibreELEC device to your VPN router and circumvent the issue.</p>



<p>Don&#8217;t forget the <strong>rise of IoT (Internet of Service) devices!</strong> A lot of them will connect to Wi-Fi but have very limited options to install additional software. For a lot of those devices t<strong>he only option to use a VPN is a VPN router</strong>.</p>



<p>If your Raspberry Pi acts as a VPN router you <strong>don&#8217;t need to install a client on every device you want to use the VPN</strong>. Just connect the Pi to the server or country you want to use and connect the devices to the Pi. It really is that simple.</p>



<p>So let&#8217;s get started and turn the Raspberry Pi into a VPN router.</p>



<h3 class="wp-block-heading">Do all VPNs work?</h3>



<p>In theory any provider that provides <em>ovpn</em> files works. This allows you to connect to the provider manually via the OpenVPN protocol. First, I&#8217;ll show you how to use the <strong>Linux client from NordVPN to build a VPN router as this is the most convenient way</strong>. After that I&#8217;ll tell you how it works with a normal OpenVPN connection.</p>



<h2 class="wp-block-heading">Install NordVPN on the Raspberry Pi and turn it into a VPN router</h2>



<p>If you want to follow my instructions, you need a subscription to NordVPN. It&#8217;s great that the VPN provider offers a <strong>30-day money-back-guarantee</strong>. You can first try out whether your Raspberry Pi runs properly as a VPN router and if not, you simply demand your money back. The provider doesn&#8217;t ask stupid questions and usually refunds rapidly.</p>



<p><p style="text-align: center;"><span class="mainSpanButton"><strong><a href="https://vpn-expert.info/vpn/nordvpn.php">NordVPN — big discount!</a>*</strong></span></p></p>



<p>My Raspberry Pi runs headless — without peripheral devices like screen, mouse and keyboard. I log on to the device via SSH. After that, I download the <em>deb file</em> from NordVPN.</p>



<pre class="wp-block-code"><code>wget -c https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn-release_1.0.0_all.deb</code></pre>



<p>Now you install the file via shell:</p>



<pre class="wp-block-code"><code>sudo dpkg -i nordvpn-release_1.0.0_all.deb</code></pre>



<p>The <em>deb </em>file is basically only setting up the repository. You have to update the package information and after that you install the Linux client of NordVPN.</p>



<pre class="wp-block-code"><code>sudo apt update
sudo apt install nordvpn</code></pre>



<p>It looks like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="986" height="610" src="https://vpn-expert.info/wp-content/uploads/2020/01/install-nordvpn.jpg" alt="Installation of NordVPN on Raspbian Buster – we need ot for the VPN router" class="wp-image-69" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/install-nordvpn.jpg 986w, https://vpn-expert.info/wp-content/uploads/2020/01/install-nordvpn-300x186.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/01/install-nordvpn-768x475.jpg 768w" sizes="(max-width: 986px) 100vw, 986px" /><figcaption class="wp-element-caption">Installation of NordVPN on Raspbian Buster – we need ot for the VPN router</figcaption></figure></div>


<h2 class="wp-block-heading">Setting up the NordVPN client</h2>



<p>The first step is to log on to the client with your access data from NordVPN:</p>



<pre class="wp-block-code"><code>nordvpn login</code></pre>



<p>Now the client asks for <strong>username</strong> and <strong>password</strong>.</p>



<p>The Linux client of NordVPN provides a so-called <em>Whitelist</em>. I <strong>put port 22 here to be on the safe side so that SSH access is possible in any case</strong>.</p>



<pre class="wp-block-code"><code>nordvpn whitelist add port 22</code></pre>



<p>You can review the settings with the following command:</p>



<pre class="wp-block-code"><code>nordvpn settings</code></pre>



<p>Quick connect to NordVPN work like that:</p>



<pre class="wp-block-code"><code>nordvpn c</code></pre>



<p><strong>Important! Now the Raspberry Pi does not work anymore as a hotspot or access point! </strong>If you are still connected to the Pi hotspot, you won&#8217;t feel a difference. But new connections are impossible — so <strong>we need to fix that</strong>.</p>



<h2 class="wp-block-heading">NordVPN changes iptables on our VPN router (if the firewall is on)</h2>



<p>The reason for the behaviour is that the Linux client of NordVPN modifies <em>iptables</em> — if the firewall is not deactivated. <strong>I recommend deactivating the firewall because it saves a lot of hassle</strong>.</p>



<p>If you want to proceed with the firewall active here are a few hints and tips. You can view the current rules with that command:</p>



<pre class="wp-block-code"><code>sudo iptables -S</code></pre>



<p>If you do that before and after a connection to the VPN you see what I mean:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="920" height="923" src="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-iptables.jpg" alt="iptables on our VPN router before and after a connection to the NordVPN network" class="wp-image-68" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-iptables.jpg 920w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-iptables-300x300.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-iptables-150x150.jpg 150w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-iptables-768x771.jpg 768w" sizes="(max-width: 920px) 100vw, 920px" /><figcaption class="wp-element-caption">iptables on our VPN router before and after a connection to the NordVPN network</figcaption></figure></div>


<p>If I want to connect to the Pi Hotspot now, <strong>I don&#8217;t even get an IP address anymore</strong>. That&#8217;s why I execute the following two commands and the hotspot assigns me an IP address again and works as designed:</p>



<pre class="wp-block-code"><code>sudo iptables -P INPUT ACCEPT
sudo iptables -P OUTPUT ACCEPT</code></pre>



<p>However, the device does not route my traffic to the Internet. Therefore, the following <em>iptables</em> entries are necessary.</p>



<pre class="wp-block-code"><code>sudo iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
sudo iptables -A FORWARD -i tun0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o tun0 -j ACCEPT</code></pre>



<p>Now everything works as designed — but there still is a little catch.</p>



<h3 class="wp-block-heading">Making the settings for VPN router permanent</h3>



<p>With the commands shown above, the settings are only temporary. They are lost as soon as you restart the Raspberry Pi. The first two commands will also be overwritten when you connect to another NordVPN server.</p>



<p>Now there are several options to make the settings permanent. Of course, I want NordVPN to connect to the startup immediately. A <em>cronjob</em> via <strong>/etc/crontab</strong> is an option. For this, I first create a script file, which I simply call <em>nordvpn.sh</em>.</p>



<pre class="wp-block-code"><code>nano nordvpn.sh</code></pre>



<p>I put the following lines into it:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="912" height="219" src="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-script-start.jpg" alt="Start NordVPN with a delay on the VPN router" class="wp-image-67" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-script-start.jpg 912w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-script-start-300x72.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-script-start-768x184.jpg 768w" sizes="(max-width: 912px) 100vw, 912px" /><figcaption class="wp-element-caption">Start NordVPN with a delay on the VPN router</figcaption></figure></div>


<p>I need the line <em>sleep 30</em> because the NordVPN <em>daemon</em> needs a bit after the system starts and the command</p>



<pre class="wp-block-code"><code>nordvpn c UK</code></pre>



<p>would not be executed. As you can imagine, that command would connect me to a server in the UK. In this case you would be able to stream BBC iPlayer for example.</p>



<p>I tried with <em>sleep 20</em> and sometimes it worked — sometimes it didn&#8217;t. So, I opted in for a 30-second wait and that is OK. The file need to be executable as well.</p>



<pre class="wp-block-code"><code>chmod +x nordvpn.sh</code></pre>



<p>Now I put the following line at the end of the file <strong>/etc/crontab</strong>:</p>



<pre class="wp-block-code"><code>@reboot pi /home/pi/nordvpn.sh</code></pre>



<p>It looks like this now:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="457" src="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-crontab-1024x457.jpg" alt="As soon as the system starts the VPN connects and turns my Raspberry Pi into a VPN router" class="wp-image-66" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-crontab-1024x457.jpg 1024w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-crontab-300x134.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-crontab-768x342.jpg 768w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-crontab.jpg 1034w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">As soon as the system starts the VPN connects and turns my Raspberry Pi into a VPN router</figcaption></figure></div>


<p><strong>Tip:</strong> If you want to execute the script via <strong>/etc/rc.local</strong> be aware that the user <em>pi</em> has to run the command. The login data of NordVPN are stored per user and that is in this case <em>pi</em>. Per default the user <strong><em>root</em> will be in charge of the file rc.local!</strong></p>



<pre class="wp-block-code"><code>su pi -c '/path/to/script'</code></pre>



<p>The above command would execute the file as user <em>pi</em>.</p>



<h3 class="wp-block-heading">Connect automatically to the VPN – VPN router has to be reconfigured</h3>



<p>It is possible that the connection to the VPN fails – that happens once in a while. In this case, the data traffic of your device would no longer be routed through the VPN. We want the VPN to reconnect automatically in case of a connection failure. You can do this with the command:</p>



<pre class="wp-block-code"><code>nordvpn set autoconnect on</code></pre>



<p>This would also automatically connect the VPN client when the device is restarted. However, the <em>iptables</em> entries are missing and therefore I run my script once the system starts.</p>



<p>You can also specify a country with <em>autoconnect</em>:</p>



<pre class="wp-block-code"><code>nordvpn set autoconnect enabled UK</code></pre>



<p>The software would connect you automatically to the UK.</p>



<h3 class="wp-block-heading">What happens if the connection goes down?</h3>



<p>I disconnected the router from the Internet (pulled the cable) and waited a minute to see what happens. After plugging the cable back in, the DSL line first synchronized and shortly afterwards the Internet connection was restored.</p>



<p>My <strong>VPN router still worked as before</strong>. If you want to be on the safe side, you could run another mini script every minute as a <em>cronjob</em>. For example, call the <em>crontab</em> as user pi:</p>



<pre class="wp-block-code"><code>crontab -e</code></pre>



<p>and use a line like that:</p>



<pre class="wp-block-code"><code>* * * * * /home/pi/nordvpn-minute.sh &gt; /dev/null 2&gt;&amp;1</code></pre>



<p><strong>If everything is fine, the script has no effect</strong>. If the VPN connection is established, it will not be re-established. In case the <em>iptables</em> settings are correct, the system will not overwrite them. The output of the <em>cronjob</em> is transferred to <em>/dev/null</em> (digital black hole).</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="623" height="139" src="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-minute.jpg" alt="nordvpn-minute.sh as a cronjob every minute on the VPN router" class="wp-image-65" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-minute.jpg 623w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-minute-300x67.jpg 300w" sizes="(max-width: 623px) 100vw, 623px" /><figcaption class="wp-element-caption">nordvpn-minute.sh as a cronjob every minute on the VPN router</figcaption></figure></div>


<p>The reason for the script is clear. If the VPN daemon connects completely new, it sets <em>INPUT</em> and <em>OUTPUT</em> to <em>DROP</em> and our hotspot doesn&#8217;t work anymore.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="369" height="80" src="https://vpn-expert.info/wp-content/uploads/2020/01/drop.jpg" alt="DROP and not ACCEPT" class="wp-image-64" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/drop.jpg 369w, https://vpn-expert.info/wp-content/uploads/2020/01/drop-300x65.jpg 300w" sizes="(max-width: 369px) 100vw, 369px" /><figcaption class="wp-element-caption">DROP and not ACCEPT</figcaption></figure></div>


<p>Yeah, it&#8217;s not the most elegant method but it <strong>seems to work reliably. I have tried it</strong>. If you run the command via <em>cronjob</em>, you don&#8217;t have to worry about it at startup. At the latest one minute after the NordVPN daemon is available, a connection to the VPN is established.</p>



<p>You may even want the VPN router to stop working if it fails. This would also be a <strong>kind of kill switch</strong> and you can see what went wrong.</p>



<p>In the end, you&#8217;ll<strong> have to experiment a bit to see which solution works best for you</strong>. But with a little patience, trial and error, your VPN router will be up and running in no time.</p>



<p><strong>Tip: </strong>If your client cannot connect to the Wi-Fi hotspot with the VPN activated try to add ports 68 and 69 UDP (DHCP) to the whitelist.</p>



<pre class="wp-block-code"><code>nordvpn whitelist add ports 68 69 protocol UDP</code></pre>



<p>Then try again — maybe with a restart in between. As mentioned at the start you can also try to deactivate the firewall (from NordVPN Linux client 3.9.0 on:</p>



<pre class="wp-block-code"><code>nordvpn set firewall on/off</code></pre>



<h3 class="wp-block-heading">A few thoughts regarding the VPN router</h3>



<p>You may want to restart your VPN router once a day. You could also do that with a <em>cronjob</em>.</p>



<p>If you disconnect the VPN connection and then log in again, you might get a faster server assigned.</p>



<p>A web GUI where you can enter the country you want to connect to would be pretty fancy. Maybe that is a project you want to do afterwards. Shouldn&#8217;t be too complicated to be honest but you need a web server installed.</p>



<h2 class="wp-block-heading">OpenVPN – connect the VPN router via ovpn file</h2>



<p>Most good VPN providers provide <em>ovpn</em> files so you can set up an OpenVPN connection manually. Clients have the advantage that you can change the country more conveniently. The client of NordVPN has another advantage. You can use <strong>CyberSec</strong> and <strong>the obfuscated servers</strong>. CyberSec is a neat feature because it blocks ads, tracker, and malware. <strong>Every device that is connected to the VPN router will benefit from CyberSec!</strong> The obfuscated servers also known as stealth servers are nice in countries with strong censorship. They might help to beat geoblocking from streaming providers as well.</p>



<p>A connection via ovpn file has the advantage that the hotspot works as designed without any problems. The command does not add any new <em>iptables</em> rules at all.</p>



<h3 class="wp-block-heading">Install OpenVPN</h3>



<p>For this to work, you have to install OpenVPN on the Raspberry Pi:</p>



<pre class="wp-block-code"><code>sudo apt install openvpn</code></pre>



<p>Then get the <em>ovpn</em> file you want. To stick to the NordVPN example, you will find the OpenVPN configuration files for all servers <a href="https://nordvpn.com/ovpn/">on this page</a>. The list is quite long and if you&#8217;re looking for a particular server, the page <a href="https://nordvpn.com/servers/tools/">with all the servers</a> is more convenient.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="831" height="607" src="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-server.jpg" alt="Download the ovpn file for your VPN router" class="wp-image-63" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-server.jpg 831w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-server-300x219.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/01/nordvpn-server-768x561.jpg 768w" sizes="(max-width: 831px) 100vw, 831px" /><figcaption class="wp-element-caption">Download the ovpn file for your VPN router</figcaption></figure></div>


<p>Just with that file you already can establish a connection. If you installed the OpenVPN client for RaspAP you can use the backend to import your .ovpn file.</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="558" src="https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-client-en-1024x558.png" alt="Use you RaspAP to import the .ovpn file and establish your OpenVPN connection" class="wp-image-440" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-client-en-1024x558.png 1024w, https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-client-en-300x163.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-client-en-768x418.png 768w, https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-client-en.png 1074w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Use you RaspAP to import the .ovpn file and establish your OpenVPN connection</figcaption></figure>



<p>Of course, you can do this manually.</p>



<pre class="wp-block-code"><code>sudo openvpn uk1418.nordvpn.com.udp.ovpn &amp;</code></pre>



<p>Now you have to enter <em>Username</em> and <em>Password</em>. That should be the case with most VPN providers.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="687" height="113" src="https://vpn-expert.info/wp-content/uploads/2020/01/enter-password.jpg" alt="Please enter Username and Password" class="wp-image-62" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/enter-password.jpg 687w, https://vpn-expert.info/wp-content/uploads/2020/01/enter-password-300x49.jpg 300w" sizes="(max-width: 687px) 100vw, 687px" /><figcaption class="wp-element-caption">Please enter Username and Password</figcaption></figure></div>


<p>It&#8217;s OK for a test but you can&#8217;t connect automatically like that. If you want to do that, you need a file e.g. <strong>auth.txt</strong>. It hast to be in <strong>the same directory as the <em>ovpn</em> file</strong>.</p>



<p>The <strong>first line </strong> holds the <strong>Username</strong> and the <strong>second line </strong>is the <strong>Password</strong><strong>!</strong></p>



<p>Then enter or modify the following line in your <em>ovpn</em> file: <strong>auth-user-pass auth.txt</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="540" height="548" src="https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-file-auth.png" alt="auth-user-pass auth.txt on our VPN router" class="wp-image-61" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-file-auth.png 540w, https://vpn-expert.info/wp-content/uploads/2020/01/openvpn-file-auth-296x300.png 296w" sizes="(max-width: 540px) 100vw, 540px" /><figcaption class="wp-element-caption">auth-user-pass auth.txt on our VPN router</figcaption></figure></div>


<p>If you use the OpenVPN command from above again, your system automatically logs on to the VPN server. Now you can also automate the process.</p>



<h3 class="wp-block-heading">Be careful! DNS leak!</h3>



<p>However, you will continue to use the <strong>DNS servers of the hotspot</strong>. If you have not changed them, they are the <strong>1.1.1.1</strong> (Cloudflare) and <strong>8.8.8.8</strong> (Google) defined by RaspAP. You can find them in the file <strong>/etc/dhcpcd.conf</strong>. The static IP address of <em>wlan0</em> is stored there as well by the way.</p>



<p>This is <strong>basically a DNS leak</strong>. With my solution and the client of NordVPN I also use the DNS servers of the VPN provider and therefore <strong>my DNS queries are anonymous</strong>.</p>



<p>Of course, you can also solve this differently. Maybe you have a Pi-hole in the network anyway and use it as DNS server. There are many possibilities here, including FreeDNS. I just wanted to point out the potential DNS leak here.</p>



<p>In the DHCP configuration of your RaspAP you can also define what DNS servers the clients should get. Use the DNS servers of NordVPN to avoid leaks: 103.86.96.100 and 103.86.99.100</p>



<h2 class="wp-block-heading">Does that also work with NordLynx (WireGuard)?</h2>



<p>If you have installed a current client, NordLynx also has a uniform network interface. It is called <strong>nordlynx</strong>. Here is a screenshot:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="889" height="141" src="https://vpn-expert.info/wp-content/uploads/2020/04/nordlynx-network-interface.png" alt="Network interface is now called nordlynx" class="wp-image-318" srcset="https://vpn-expert.info/wp-content/uploads/2020/04/nordlynx-network-interface.png 889w, https://vpn-expert.info/wp-content/uploads/2020/04/nordlynx-network-interface-300x48.png 300w, https://vpn-expert.info/wp-content/uploads/2020/04/nordlynx-network-interface-768x122.png 768w" sizes="(max-width: 889px) 100vw, 889px" /><figcaption class="wp-element-caption">Network interface is now called nordlynx</figcaption></figure>



<p>Now I can make the corresponding routing entries. WireGuard is slightly faster than OpenVPN and it&#8217;s your decision what you want to use. The solution with OpenVPN as VPN router works very well and that is not a slow either.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="782" height="346" src="https://vpn-expert.info/wp-content/uploads/2020/01/speedtest-openvpn-nordvpn.png" alt="Speedtest with OpenVPN – it's fast enough for the VPN router" class="wp-image-59" srcset="https://vpn-expert.info/wp-content/uploads/2020/01/speedtest-openvpn-nordvpn.png 782w, https://vpn-expert.info/wp-content/uploads/2020/01/speedtest-openvpn-nordvpn-300x133.png 300w, https://vpn-expert.info/wp-content/uploads/2020/01/speedtest-openvpn-nordvpn-768x340.png 768w" sizes="(max-width: 782px) 100vw, 782px" /><figcaption class="wp-element-caption">Speedtest with OpenVPN – it&#8217;s fast enough for the VPN router</figcaption></figure></div>


<p>However, the solution for the network interface <em>nordlynx</em> for <em>iptables</em> looks like this:</p>



<pre class="wp-block-code"><code>sudo iptables -t nat -A POSTROUTING -o nordlynx -j MASQUERADE
sudo iptables -A FORWARD -i nordlynx -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o nordlynx -j ACCEPT</code></pre>



<p>Would you like to make your own VPN router now? It&#8217;s really not difficult and NordVPN is a good partner for it.</p>



<p><p style="text-align: center;"><span class="mainSpanButton"><strong><a href="https://vpn-expert.info/link/nordvpn-vpnrouter/">NordVPN for your router!</a>*</strong></span></p></p>



<p>As I said, most reputable VPN providers should provide the resources for your project. I like NordVPN because I can use the command line client under Linux. But the provider also provides a great Android client. It is one of the most user-friendly providers on the market.</p>



<p>With NordVPN you can use up to <strong>6 devices simultaneously</strong>. Because a VPN router is allowed, your <strong>Raspberry Pi counts as 1 device</strong>, no matter how many others are connected to it.</p>



<p>The VPN provider also allows torrent downloads and P2P connections / file sharing.</p>
<p>The post <a rel="nofollow" href="https://vpn-expert.info/vpn-router-raspberry-pi-raspap-and-nordvpn-wi-fi-hotspot-access-point/">VPN Router – Raspberry Pi, RaspAP and NordVPN (Wi-Fi Hotspot / Access Point)</a> appeared first on <a rel="nofollow" href="https://vpn-expert.info">VPN Expert</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://vpn-expert.info/vpn-router-raspberry-pi-raspap-and-nordvpn-wi-fi-hotspot-access-point/feed/</wfw:commentRss>
			<slash:comments>106</slash:comments>
		
		
			</item>
	</channel>
</rss>
