Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

for instance, I could run a web server on my computer with is connect to router which suggest it doesn't have a public ip address. How can I send data to it from other client or server?

Web socket seems promising, but what I want is a well support solution in command line, and doesn't require change the setting on the router, such as port-forward.

share|improve this question
2  
You can look at en.wikipedia.org/wiki/NAT_traversal for a list of techniques for connecting through NAT routers, but you are probably expecting something that doesn't exist. To have a regular web server responding on port 80, port forwarding in the router is the way to go - it is as simple as that (and port forwarding is simple). The computer on the outside can not initiate contact with the internal computers without going through the NAT router, and there is no way to individually address internal computers without explicitly instructing the router. Hence port forwarding. –  Daniel Andersson Apr 13 '12 at 7:35
    
It really depends what router is doing (NAT?), what the router supports (UPnP?), and what you want to do once you're connected. –  David Schwartz Apr 13 '12 at 7:59
add comment

2 Answers 2

up vote 1 down vote accepted

Port Forwarding

Port forwarding is by far the easiest solution.

Reverse SSH Tunnel

Another way would be to involve a third-party publicly accessible server as a relay. You'd have to initiate a connection to this third-party server from the web-server (since your router blocks inbound connections) and then use that connection to relay HTTP traffic via the third-party server..

This can almost certainly be done using SSH tunnelling

I frequently need to get access to a machine behind a firewall to do some web development, but I don’t have a VPN available. Not a problem – just use a reverse SSH tunnel. By the end of this tutorial, we’ll be able to SSH to the remote server, as well as view any web pages that server has access to.

(my emphasis)

share|improve this answer
    
Both of you guys' answer looks promising. I would try it now. thanks –  mko Apr 13 '12 at 10:47
add comment

As an alternate to ssh tunneling, you might want to consider ipv6 tunneling. I use gogo6/freenet6 as a ipv6 provider (though there's other providers). On windows, the client generally just works. On linux, you'll need to compile the client. Once this is done though, you can access the system through any system that supports ipv6.

The advantage of setting up an ipv6 tunnel is you can then do things as if it was a regular, public ip address cause it is.

share|improve this answer
    
gogo6 is radical new for me. Does this mean I would have a permeant ipv6 address regardless whatever machine I use? –  mko Apr 13 '12 at 10:55
    
Well, you can set it up per system to have an ip address for each. If you run the client with a username and password, its a permanant, static ipv6 address, otherwise its dynamic. –  Journeyman Geek Apr 13 '12 at 11:13
    
SU has some good Qs/As on IPv6 but I'd love to see a good blog article on setting up and using IPv6 in a home or SOHO setting. Just a thought :-) –  RedGrittyBrick Apr 13 '12 at 11:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.