- -- - - - - - - - - - - - - - - - - - TrB.jpg Margaret.png Jkb.jpg JoeD.jpg Edbatchelor.jpg JimB.png DAD-TINT.JPG C03515.jpg

Difference between revisions of "Port forwarding"

From Batchelor-s
Jump to navigationJump to search
Line 5: Line 5:
 
check on [[Fail2ban]]  
 
check on [[Fail2ban]]  
  
set [[rpi]] static IP
+
set [[rpi]] static [[IP]]
 +
 
 +
 
 +
 
 +
router
  
 
192.168.1.1
 
192.168.1.1
  
router
+
 
  
 
Service Port: This is the external port.
 
Service Port: This is the external port.
  
IP Address: This is the IP of the Pi.
+
[[IP]] Address: This is the [[IP]] of the [[rpi]]
  
Internal Port: Set this to Pi’s application port. (A web server runs on port 80 for example)
+
Internal Port: Set this to [[rpi]]’s application port.  
  
 
Protocol: Set this to ALL unless specified.
 
Protocol: Set this to ALL unless specified.
 +
 +
Probably need to change this
 +
 +
80 web
 +
 +
22 [[SSH]]
 +
 +
  
 
Status: Set this to enabled.
 
Status: Set this to enabled.
Line 23: Line 35:
  
  
install the [[DDclient]] to update dynamic DNS
+
install the [[ddclient]] to update dynamic [[DNS]]
 +
 
 +
 
  
 
sudo apt-get update  
 
sudo apt-get update  
Line 46: Line 60:
  
  
 +
[[NO-IP]] offers free subdomains
 +
 +
[[CloudFlare]] you need to own a domain name
 +
 +
[[Cloudflare]] also offers more protection such as free [[SSL]]
 +
[[anonymized IP]]  [[DDOS]] protection
  
CloudFlare and No-IP is that you need to own a domain name to make use of CloudFlare. No-IP However offers free subdomains, meaning it’s a costless service to use.
 
  
[[Cloudflare]] also offers more protection such as free SSL, anonymized IP, DDOS protection
 
  
  
Line 105: Line 123:
  
 
sudo ddclient -daemon=0 -debug -verbose -noquiet
 
sudo ddclient -daemon=0 -debug -verbose -noquiet
 
 
 
 
 
 
 
 
 
 
[[--]]
 
 
 
 
 
 
 
 
  
  
 
[[--]]
 
[[--]]

Revision as of 16:41, 17 July 2020


gufw firewall

check on Fail2ban

set rpi static IP


router

192.168.1.1


Service Port: This is the external port.

IP Address: This is the IP of the rpi

Internal Port: Set this to rpi’s application port.

Protocol: Set this to ALL unless specified.

Probably need to change this

80 web

22 SSH


Status: Set this to enabled.


install the ddclient to update dynamic DNS


sudo apt-get update

sudo apt-get install ddclient libjson-any-perl libdata-validate-ip-perl

wget https://files.pimylifeup.com/portforwarding/ddclient-3.9.0.tar.gz tar -zxvf ddclient-3.9.0.tar.gz

sudo cp -f ddclient-3.9.0/ddclient /usr/sbin/ddclient

sudo mkdir /etc/ddclient

sudo mv /etc/ddclient.conf /etc/ddclient

sudo nano /etc/ddclient/ddclient.conf

Add the following to below the commented header in the file, also remove anything else in the file. We will add more to the file later on with our guides on using No-IP or Cloudflare.

use=web, web=checkip.dyndns.com/, web-skip='IP Address' ssl=yes


NO-IP offers free subdomains

CloudFlare you need to own a domain name

Cloudflare also offers more protection such as free SSL anonymized IP DDOS protection



protocol=cloudflare

server=api.cloudflare.com/client/v4

login=your_email

password=your_api-key

zone=your_domain.com


anything.your_domain.com


sudo /etc/init.d/ddclient restart

You may need to turn off the Cloudflare proxy


Running ddclient as a Daemon


sudo nano /etc/default/ddclient

run_daemon="true"

run_dhclient="false"

run_ipup="false"


sudo service ddclient start


sudo service ddclient status

sudo nano /etc/cron.weekly/ddclient

  1. !/bin/sh

/usr/sbin/ddclient -force


sudo chmod +x /etc/cron.weekly/ddclient


debug

sudo ddclient -daemon=0 -debug -verbose -noquiet


--