Practical Home Networking
 Using a Linux Router

Tony Bemus
Penguicon 2015
What I'm going to talk about 
  • Internet Interactions
  • Inside the Home Network
  • Replace the Commercial Router
  • Physical Design of the Network
  • Logical Design of the Network
  • Configure the new Router
  • Addressing Devices
  • Port Forwarding
  • Public IP address
  • Dynamic DNS (DDNS)
Home/Coffee Shop
Web Server
You / /
Typical Internet  interactions
Home/Coffee Shop
Home Network
You / Remote User
Home Server
Inside the Home Network
  • Modem / 
ISP Router

  • WIFI Router

  • Switch

  • Server / PC
Replace the
Commercial Router
  • PC / laptop
  • Download software
  • /
  • PF Sense
What you need:
Computer Requirements
  • 1000 Mhz
  • 128 MB Ram
  • 2 GB HD
  • 2.4 Ghz Pentium 4
  • 1 GB + Ram
  • 20 GB + Hard drive
Required - 2 Network Cards (NIC)
  • wired and wired
  • wired and wireless
  • wireless and wireless
Physical Design
ISP Modem
Linux Router
PC / Home Server
Wireless AP
Logical Design
Common ISP Modem networks to avoid
  • 192.168.0.x
  • 192.168.1.x
  • 10.0.0.x
RFC1918 name     IP address range     number of addresses
24-bit block -     16,777,216  
20-bit block -     1,048,576  
16-bit block -     65,536  
Safe Networks To Use
I suggest to stay close to your ISP modem
and just change the third number:
ISP - 192.168.1.x        Yours - 192.168.2.x
Initial Router Config
Red NIC goes to Modem = DHCP
Green NIC goes to Switch = Static IP
Blue NIC goes for Wireless  = Static IP
   (optional static -
Orange NIC is for DMZ = Static IP
   (optional static -
Gets address from the ISP Modem
first or last in your range:
Initial Router Config cont...
Enable DHCP server
Set DNS as the router green IP
If you are reusing your wireless router:
  • Turn off DHCP server 
  • Set IP address on the inside of your green
DHCP Pool range about 100 addresses: -
This will leave room for static address devices
Addressing Devices
Static Assignment
DHCP reservation
Manualy assign and configure device
Configure DHCP to give the same address
to a single device.
No device configuration needed (leave as DHCP)
Usually inside DHCP pool
***  Static address are ALLWAYS
         outside of the DHCP pool
ABC Network - Router (Static) - Wireless AP (Static) - Home Server (DHCP) - Printer (DHCP)
Use both static and DHCP reservations!
Client PC are handled by DHCP
Port Forwarding
Only  forward ports needed!!!
Shut off port not currently being used
Common TCP ports to forward:
  • 22 - SSH / SSHFS / FTPS
  • 80 - HTTP
  • 443 - HTTPS
  • 3389 - RDP
Port Forwarding cont...
Source Port is from the internet
Destination port is on your server
Open SSH to server
Source port 22 to destination port 22
  on IP address
This model allows for changing the source
port without having to configure the server
Thus Security through Obscurity 
*** Not Really Secure
Public IP address
ISP supplied DHCP
ISP supplied Static IP
Static IP is better for hosting servers
**  Monthly charges apply
*The Most Common
Not conducive to hosting servers
Dynamic DNS Needed
Client software needed to report current Public IP address
two options - do not use both
  • Linux Routers have it built in
  • ddclient on one of the servers

Dynamic DNS (DDNS)
Best Free Dynamic DNS Services
  • * Domain Registrar 
                                                              *** Free Dynamic DNS
  • (Beta)
* - This is what I use
Private IP ranges
Presentation by Tony Bemus is licensed under a Creative Commons
Attribution-ShareAlike 4.0 International License.
Based on a work at
Best Free Dynamic DNS Services