Open In App

Port Forwarding on Router and Why do we need It

Last Updated : 18 Jan, 2021
Like Article

Router port forwarding is used to allow the remote computers to connect to a specific service or computer on a Local Area Network. Now the question is why do we need it. And we will discuss all of these things one by one.

Use Cases :

  1. Suppose you are at the office and want to connect to your computer which is present in your house, the computer present at the house is connected to the WiFi of house which is a LAN(Local Area Network) one of the ways to connect to your house computer is port forward ssh(port 22) in your Router to your computers IP address and open ssh port on your computer. Now, who so ever will try to ssh to your public IP address will be forwarded to your computer present at your house.
  2. Suppose you want to host a website on your computer and you want everyone on the internet can access your website, this can be achieved by port forwarding. What you have to do is that port forward HTTP (port 80) or HTTPS(port 443) from your router to your computer on which your website is deployed. Hurray Knows anyone with your public IP address can access your website.

These are only two used cases that explain what is the need for Port forwarding, you can do much more like accessing the camera connecting to your LAN, accessing the printer connected on your LAN from anywhere in the world, you can also host a Minecraft server on your machine and invite friends to connect with it.

How To Implement Port Forwarding On Your Router :

Before starting with how to implement port forwarding two basic things are needed :

  1. Your Public IP address must be static because most of the normal internet connections have dynamic public addresses i.e the IP address changes after few hours or few days, so each time you have to connect to the machine present at your LAN you have to get your public IP address. Though for some users dynamic IP address will not be a big issue but in case you don’t want to know the IP again and again then you can ask your ISP to provide you a static IP.
  2. The 1st requirement was not that necessary the second requirement is very much necessary. You have to assign your machine(To whom you want to connect remotely) a static private IP address and this can be done very easily through your router and from your machine itself. This requirement is necessary because during port forwarding on the router we have to mention the IP address of the machine to which we want to forward the port so if the private IP address of the machine will be dynamic we have to configure port forwarding on the router again and again which is feasible.

Procedure : 

Step-1 : 

Open the default gateway of your WiFi router usually the IP address of the default gateway for most of the routers is find your router’s gateway address and open it in your browser this will open the routers setting page login into this page.

Step-2 : 

After login search for NAT, Virtual Server, and after that enter the port or service you want to forward, after that enter the IP address of the machine to which you want to. forward that port(Please note that this is the general procedure for every router, for your router it may vary slightly)

Step-3 : 

Now you can easily access your machine with your public IP address remotely

Note –

Please note that if your machine(to whom you want to connect remotely) have a firewall installed then you have to manage that firewall to allow the remote requests


Similar Reads

Difference Between SSH Local and Remote Port Forwarding
SSH stands for "Secure Shell" or "Secure Socket Shell". It is a cryptographic network protocol that allows two computers to communicate and share the data over on insecure network such as Internet. SSH protocols protects the network from various attacks. 1. Local Port Forwarding :Local Port Forwarding is the common type of port forwarding. It is us
5 min read
SSH Port Forwarding
SSH Port forwarding is a method used for securing TCP/IP connections. The TCP/IP packets can be tunneled through a SSH link making the data obscure thus protecting the link from attacks. SSH Port forwarding can be also seen as a form of Virtual Private Network(VPN). Types of Port Forwarding: There are 2 main types of port forwarding: Local Port For
2 min read
Difference between Root Port and Designated Port
Root Port: A Root Port is a single selected port that has the lowest Path Cost to the Root Bridge. The Root Port on the Bridge (Switch) is the port with the lowest Spanning Tree Path Cost from the switch to the Root Bridge. The root port is a direct link to the single root bridge or we can say it has the shortest path to the root bridge.If more tha
4 min read
Difference Between Trunk Port and Access Port
When it comes to networking, two terms that are “access port” and “trunk port" arises in our mind. They both sound familiar but both of these types have different functions. Trunk Port and Access Port, both terms are related to CISCO. Access Port is a port that is assigned to a single VLAN whereas Trunk Port is a port in which it is assigned to mul
3 min read
How to Add Port in Router in CISCO Packet Tracer?
Cisco Packet Tracer is a tool built by Cisco and it provides network simulation to practice simple and complex networks. The main purpose of the Cisco Packet Tracer is to help students learn the principles of networking and demonstrate the networking concepts. Router is a networking device that works in the network layer and can connect two differe
2 min read
Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy Protocol (VRRP)
Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol used to provide redundancy in a network. Only one router is the active router while others will be in standby state i.e the standby router will be responsible for forwarding the traffic when the active router fails. Virtual Router Redundancy Protocol (VRRP) is an open standard proto
3 min read
Network Layer Services- Packetizing, Routing and Forwarding
Pre-Requisite: OSI Model The network Layer is the third layer in the OSI model of computer networks. Its main function is to transfer network packets from the source to the destination. It is involved both the source host and the destination host. At the source, it accepts a packet from the transport layer, encapsulates it in a datagram, and then d
5 min read
Selective forwarding Attack in wireless Sensor Network
A selective forwarding attack is a type of security attack that can occur in wireless sensor networks (WSNs). In this attack, a malicious node in the network selectively forwards some data packets to the base station while dropping others, with the goal of compromising the integrity and availability of the network. The attacker can use various tech
8 min read
Internal/External Forwarding Rule in GCP
In Cloud Computing and specifically focusing on Google Cloud Platform, a forwarding rule is set up to allow incoming traffic and direct it from individual ports within a specific range to particular ports on user VM's on Google Cloud Platform. This range of ports can be opened on the public IP Address by using firewall rules. A Forwarding Rule reso
3 min read
Frame forwarding methods on Switches
There are 2 methods that all switch use for forwarding the frames (switching data) between the network ports: Store and forward switching Cut-through switching These are explained as following below. 1. Store and forward switching : In this switching technique, when the switch receives the frame, it stores the frame data in buffers until the full f
3 min read
Article Tags :