取代端口转发器(路由器) [英] Supersede Port-Forwarder (Router)

查看:116
本文介绍了取代端口转发器(路由器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google上研究了端口转发的用途.
我知道端口转发器的工作是在启动计算机和最终计算机之间建立连接,该计算机是该路由器上数十台本地计算机之一.为此,我们必须在路由器选项"的端口转发"下指定要与启动计算机连接的最终计算机.

现在,用户可以使用端口转发"选项,但是它有点不便",尤其是当路由器上的本地计算机经常更改其内部IP时.然后,我们必须手动更改设置.

我的问题是,有没有一种方法可以在我的VB.NET代码中预设本地计算机的内部IP,以自动检测要连接的本地计算机.
所以我不怎么做,而是这样的(LOL):TCPClient.Connect(外部IP,内部IP,端口)

我知道内部和外部IP以及端口是什么时,甚至可以在我的代码上对其进行预设.

因此,在一行中,通过代码绕过端口转发???
在此先感谢Begi

I researched on Google about what the use of Port-Forwarding is.
I came to know that the Job of the Port Forwarder is to set a Connection between the Start Computer and End-Computer, which is one of dozens of Local Computers on that Router. For that we must specify on the Router Options, under Port-Forwarding, the mentioned End-Computer which is meant to connect with the Start-Computer.

Now the Port-Forwarding Option is welcome to the Users but its a bit "inconvenient", even more when the Local Computers on the Router often change their Internal IPs. We then have to manually rechange the settings.

My Question is, is there a way to preset the Internal IP of the Local Computer in my VB.NET Code to automatically detect with which Local Computer to connect.
So i do not how, but something like this (LOL): TCPClient.Connect(EXTERNAL IP, INTERNAL IP, PORT)

Is it even possible to preset it on my code, while i know what the Internal and External IP is and also the Port.

So in a line, Bypass Port-Forwarding by Code???
Thanks in advance, Begi

推荐答案

您无需在代码中进行任何操作.

作为端口转发配置目标的内部计算机应该使用静态IP地址(明确输入),或者使用DHCP,并在DHCP服务器上进行配置,以在每次请求一个IP地址时向该计算机分配一个保留的IP地址. .这样,您根本不必更改端口转发配置.
You don''t do any of this in your code.

The internal machine that is the target of the port forwarding configuration should be using a static IP address (explicitly entered) OR use DHCP and on the DHCP server, configure it to give out a reserved IP address to that machine every time it asks for one. That way, you don''t have to change the port forwarding configuration at all.


我想您可能想看看^ ]

这是专用LAN上的设备/PC与路由器协商动态端口转发的公认方式

这就是Xbox和BitTorrent客户端(例如)可以全部接受传入连接而无需在路由器上进行任何设置的方式
I think you may want to look at the UPNP Protocol[^]

That''s the accepted way of devices/PCs on a private LAN negotiating dynamic port forwarding with the router

That''s how the Xbox and BitTorrent clients (for example) can all accept incoming connections without you setting anything up on your router


这篇关于取代端口转发器(路由器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆