仅 IP 地址不足以将任何信息传递到计算机。计算机网络如何知道如何处理这些信息?这是由信息包发送到的端口号决定的。这篇文章告诉你什么是端口转发(Port forwarding);以及如何转发端口。
什么是端口转发?
在正常语言中,港口是船舶停泊/停靠和飞机降落的地方。然后他们按照计划继续他们的旅程。在信息技术(Information Technology)术语中,端口是硬件和软件(称为逻辑端口),它们对计算机所做的一切都有帮助。您在计算机上看到的用于连接外围设备的不同点称为硬件端口。他们的工作是将收到的信息发送到正确的流程。
逻辑端口不是硬件构建的。你看不到它们,但它们就在那里——任何一台正常工作的计算机都有超过 6000 个端口。虽然它们都没有被使用,但有些是常见的(例如端口 80 保留用于与HTTP交互)。另一个例子:端口 25 用于发送电子邮件(SMTP)。
一旦数据包到达任何IP 地址(IP Address)(即计算机和物联网(IoT)设备),端口会将数据包转发到设备的相应部分,以便对其进行正确处理。那么计算机如何知道将数据转发到哪里呢?端口(ports)使这成为可能。接收数据的计算机将其中继到用于不同目的的指定端口。
你知道互联网(Internet)上的一切都有一个 IP(互联网协议(Internet Protocol))地址。除了 IP 地址,发送方网络还发送一个端口地址。例如,如果您通过任何Internet浏览器访问 Web 上的某些内容,则端口地址将类似于 192.168.1.13:80,其中 80 是计算机或任何IP 地址为 192.168.1.13的物联网设备上的端口号。(IoT)类似风格的端口地址用于打印和扫描东西,向/从Internet上传和下载东西,以及计算机所做的许多其他事情。
如果您想知道 PC 上打开了哪些端口,请在CMD中键入以下命令,然后按Enter键。
netstat -a
第三方端口扫描仪应用程序也可以为您提供计算机上端口的详细信息。
端口(Port)转发也称为端口(Port)映射。尝试从网络防火墙或路由器外部访问计算机网络时需要它。在线(Online)游戏玩家经常需要做端口转发。
如何转发端口?
虽然您可以通过netsh命令使用(netsh)PowerShell转发端口,但很难找出该命令附带的参数值。
有一些免费的第三方软件,如FwdPortForwardingApp ( Link ) 可以帮助您进行端口转发,这样您就不必尝试不同的命令行参数值(要提供给命令的值)。
您可以从路由器或防火墙配置端口转发。路由器方法更简单,所以我们将讨论它。
- 启动你的浏览器
- 在浏览器地址栏中输入 192.168.1.1
- 出现您的路由器的欢迎页面
- 填写(Fill)您尝试连接的路由器的 ID 和密码
- 大多数情况下,ID 是admin,密码是密码;(password; )一些路由器将admin作为 ID 和密码;如果找不到,请致电路由器制造商的服务中心以了解 ID 和密码
- 在路由器页面中,在高级设置下查找端口转发(Advanced Settings)
- 填写(Fill)您要将项目转发到的端口号
- 保存(Save)并退出路由器;重新启动路由器以应用更改
请注意,使用此方法将要求您在接收转发的端口上有一个静态 IP 地址。您可以使用控制面板(Control Panel)中计算机网络故障排除选项中的IPv4或IPv6选项(IPv6)设置静态 IP 地址(set up your static IP address)。
您还可以使用简单端口转发(Simple Port Forwarding)应用程序等第三方工具配置路由器防火墙(Configure Router Firewall)。您可以从此处下载(here.)简单端口转发(Simple Port Forwarding)应用程序。
What is Port Forwarding? How do you forward Ports?
Τhe IP addresѕ alone іs not is sufficient to deliver any information to a computer. How does the computer network know what is to be done with the information? This is determined by the port number to which the informаtion packet iѕ sent. This post tells you what’s Port forwarding; and how do you forward Ports.
What is Port Forwarding?
In normal language, a port is where ships anchor/dock and planes land. They then proceed with their journey as per schedule. In Information Technology lingo, ports are hardware and software (called logical ports) and they help with everything the computer does. The different points you see on your computer for attaching peripherals are called hardware ports. Their work is to send the information received to the correct process(es).
Logical ports are not hardware built. You can’t see them, but they are there – more than 6000 ports in any working computer. Though all of them are not used, some are common (for example port 80 is reserved for interacting with HTTP). Another example: Port 25 is used to send an email (SMTP).
Once a data packet reaches any IP Address (i.e. computers and IoT devices), the port forwards the data packet to the respective part of the device so that it can be processed properly. So how does the computer know where exactly to forward the data? This is made possible by ports. The computer, which is receiving data, relays it to the indicated ports that serve different purposes.
You know that everything on the Internet has an IP (Internet Protocol) address. Along with the IP address, the sender network also sends a port address. For example, if you are accessing something on the web through any Internet browser, the port address would be like 192.168.1.13:80 where 80 is the port number on the computer or any IoT device having IP address 192.168.1.13. A similar style of port addresses is used to print and scan things, upload and download stuff to/from the Internet, and many other things that a computer does.
If you wish to know what all ports are open on your PC, type the following command in an CMD and press Enter key.
netstat -a
Third-party port scanner apps are also available to give you details of the ports on your computer.
Port forwarding is also known as Port mapping. It is required when trying to access a computer network from the outside of the network firewall or router. Online gamers often need to do port forwarding.
How to forward Ports?
Though you can forward ports using the PowerShell through the netsh command, it is hard to find out the values of parameters that come with the command.
There are some free third-party software like FwdPortForwardingApp (Link) that help you in port forwarding so that you do not have to experiment with different values of command-line parameters (values to be provided to the command).
You can configure port forwarding from your router or firewall. The router method is easier, so we’ll talk about it.
- Fire up your browser
- Enter 192.168.1.1 in the browser address bar
- Your router’s welcome page appears
- Fill in your ID and password for the router you are trying to connect to
- ID in most cases is admin and password is password; some routers have admin as both ID and password; if you can’t find it, call your router manufacturer’s service center to know the ID and password
- In the router page, look for port forwarding under Advanced Settings
- Fill in the port number to which you want items forwarded
- Save and exit the router; restart router for changes to be applied
Note that using this method would require you to have a static IP address on the port receiving the forward. You can set up your static IP address using IPv4 or IPv6 option in your computer’s network troubleshooting option in Control Panel.
You can also Configure Router Firewall using third-party tools like Simple Port Forwarding app. You can download the Simple Port Forwarding app from here.