
Appendix D: Understanding port forwarding
46
two web servers running on your home network and you want one to be readily and obviously
accessible (e.g. it’s a weather server you want people to be able to easily find) and the other web
server is for a personal project.
When you access your home network from the public-facing port 80, you can tell your router to
send it to port 80 on the weather server at 192.168.1.150, where it will be listening at port 80. But,
you can tell your router that when you access it via port 10,000, that it should go to port 80 on your
personal server, 192.168.1.250. This way, the second computer doesn’t have to be reconfigured to
use a different port, but you can still manage traffic effectively—and at the same time by leaving the
first web server linked to port 80 you make it easier for people accessing your aforementioned
weather server project.
Now that we know what port forwarding is and why we might want to use it, lets’ take a look at
some small considerations regarding port forwarding before diving into actually configuring it.
Considerations before configuring your router
There are a few things to keep in mind before sitting down to configure your router and running
through them in advance is guaranteed to cut down on frustration.
Set Static IP address for your devices
First and foremost, all your port forwarding rules will fall apart if you’re assigning them to devices
with dynamic IP addresses assigned by your router’s DHCP service.
Your router has a pool of addresses that it reserves just for handing out to devices as they join and
leave the network. Think of it like getting a number at a diner when you arrive—your laptop joins,
boom, it gets IP address 192.168.1.98. Your iPhone joins, boom, it gets address 192.168.1.99. If you
take those devices offline for a period of time or the router is rebooted, then the whole IP address
lottery happens all over again.