使用c#启用端口转发
我使用一个基本应用程序,使我能够通过互联网上的 TCP 连接将文件发送到另一台计算机。我设法做到这一点的方法是配置我家和办公室的路由器,将所有传入流量从端口 X 转发到相应的计算机。我现在在一个新办公室,这里的工作方式有所不同。
所有办公室都可以连接到一个主路由器。我将我的路由器连接到该路由器,以便拥有自己的专用网络。我仍然希望能够使用我创建的小应用程序来同步家庭计算机和办公室计算机中的文件。唯一的问题是我无法访问主路由器,因此我可能无法打开任何端口以使我的程序运行。我是网络新手,因此如果有人能为我指出如何解决此问题的正确方向,那就太好了。我想我必须让路由器知道将所有流量从端口 x 发送到我的计算机。而且有几个路由器所以我不知道是否可能。我认为这应该是可能的,因为我可以通过例如登录来连接到我的办公室计算机。
如果我仍然可以使用 TCP 协议而不是 p2p,那就太好了,因为我已经拥有了所有功能。
I use a basic application that enables me to send a file over a tcp connection over the internet to a different computer. The way I managed to do that was to configure the router at my house and office to port forward all incoming traffic from port X to the corresponding computer. I am in a new office now and things work different in here.
There is a main router where all the offices may connect to. I connect my router to that router in order to have my own private network. I still want to be able to use my small application that I created in order to sync the files from my home computer and office computer. The only problem is that I dont have access to the main router therefore I may not open any ports in order to make my program work. I am new to networking so it will be nice if someone can point me to the right direction of how can I solve this. I think I have to let the router know to send all the traffic from port x to my computer. Moreover there are several routers so I dont know if it is possible. I think it should be possible because I am able to connect to my office computer via log me in for example.
It sill be nice if I can still use TCP protocols instead of a p2p since I already have all the functionality.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从办公室连接到家庭计算机会更容易。在这种情况下,您必须在个人路由器上设置端口转发(您已经完成了!)。如果您从家连接到办公室,则需要配置每个中间办公室路由器(您的老板可能不喜欢)。
为了连接到您的家庭网络,我会考虑通过 DynDNS 之类的人设置 DDNS。这将允许您从任何地方连接到 me.example.com 并使其解析为您的家庭地址,即使它更改了 IP 地址。
It would be much easier to connect from your office to your home computer. In this scenario, you have to setup port forwarding on your personal router (which you have already done!). If you connect from your home to the office, you will need to configure every intermediate office router (which your boss probably won't like).
In order to connect to your home network, I would look into setting up DDNS through someone like DynDNS. This will allow you to connect to me.example.com from wherever and have it resolve to your home address even when it changes IP addresses.
我发现一个很好的页面在 这里。我会努力解决它...我不确定它是否适用于 tcp 协议。
I found a nice page that talks about this in here. I will work on it... I am not sure if it works with the tcp protocol.