VPN stands for Virtual Private Network.
Advantages are that, you no longer need to have many opened ports. The key file of VPN is safer than a typical password.
curl -L https://install.pivpn.io | bash
Are you Using DHCP Reservation on your Router? Yes
Choose a User: pi
Choose a VPN: OpenVPN
Customization: Yes
Choose a Protocol: UDP
Modify a port for OpenVPN: 1194
Select the DNS Provider for your VPN Clients: OpenDNS
Add a Custom Domain: Yes
Enter Custom Domain: random.ddns.net
Will clients use a Public IP or DNS Name to connect to your server? DNS Entry
What is the public DNS name of this Server? random.ddns.net
Choose the desired size of your certificate: 256
Do you want to enable unattended upgrades of security patches to this server? Yes
Reboot now? Yes
pivpn add
###
Enter a Name for the Client: Name
How many days should the certificate last? 1080
Password and Reconfirm: ....
### /home/pi/ovpns
cd /usr/local/src/
wget http://www.noip.com/client/linux/noip-duc-linux.tar.gz
tar xf noip-duc-linux.tar.gz
cd noip-2.1.9-1/
sudo make install
###
- etho0
- email: noip email
- password: noip pwd
- update interval: 60 (mins)
- run sth at successful update: n
ps ax | grep noip2 # noip2 not running
sudo noip2 # running but not enable
sudo vim /etc/systemd/system/noip2.service # edit systemd file
###
[Unit]
Description=No-ip.com dynamic IP address updater
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
Alias=noip.service
[Service]
ExecStart=/usr/local/bin/noip2
Restart=always
Type=forking
###
sudo systemctl enable noip2
sudo systemctl start noip2
sudo ufw allow 1194
# Then port forwarding and firewall 1194 on router #############
sudo reboot
curl -sSL https://install.pi-hole.net | bash
Choose an Interface: eth0
Select Upstream DNS Provider: OpenDNS
Suggested list: StevenBlack yes
Select Protocols: IPv4 IPv6 OK
Do you want to use your current network settings as a static ip address? Yes
Do you wish to install the web admin interface? On
lighttpd? On
log queries? On
Select a privacy mode of FTL. : 0 Show Everything
sudo vim /etc/openvpn/server.conf
###
delete all push "dhcp-options"
add 'push "dhcp-option DNS 10.8.0.1"'
sudo vim /etc/pihole/setupVars.conf
Add "PIHOLE_INTERFACE=tun0" below the eth0 line
sudo vim /etc/dnsmasq.d/02-ovpn.conf
add "interface=tun0"
sudo nmcli connection import type openvpn file Leo.ovpn
ssh pi@192.168.0.x