连接到私人IP [英] connecting to a private ip

查看:100
本文介绍了连接到私人IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想连接到位于路由器后面的系统.我知道路由器的公共地址以及系统的专用ip(始终固定).如何与专用ip建立套接字连接?

I want to connect to a system which is behind a router. I know the public address of the router as well as the private ip (fixed always) of the system. How do i establish socket connection with the private ip?

推荐答案

这就是为什么有人说他们在路由器后面时说他们在防火墙"后面的原因. Internet的邪恶病毒无法利用路由器后面的计算机上的任何软件(前提是路由器管理员未以有趣的方式配置它,例如,通过启用

This is why some people say that they are behind a "firewall", when they are behind a router. The Evil Viruses Of The Internet are not able to exploit any software on a computer behind a router (provided that the router admin didn't configure it in the funny way, for example by enabling DMZ).

您仍然有一些选择:

  • Talk to the router admin and make him forward a port for You
  • Take the router out and put Your "target" computer where Your router was, or enable DMZ (this only makes sense if there was only one computer behind the router). Warrning: install a firewall on the target computer first!
  • Turn the socket 180 degrees. Make the computer behind a router establish the connection to the server that has a public IP address
  • Use something like UPnP, if Your router supports it
  • Get a dedicated IP address for Your computer and configure router to switch all traffic to this IP address to Your computer (this is similar to DMZ, but would work if You have more than one computer behind the router). Warrning: install a firewall on the target computer first!
  • Use NAT traversal. There is a very good article on the subject here. Simplified version is that client establishes connection to some remote server. The server can see the opened port number on the client's router and this port is assigned to the client's machine, so it (or some another computer sharing this information) may establish connection to that port and reach the client's application. Warrning: this doesn't work with all routers. Some routers just won't let this happen.

这篇关于连接到私人IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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