Access localhost from another computer not on network - networking

Before you say that it is a dupe, this is not the same as this, this, this or this.
My question is how do you do it globally.
For instance, consider this. I have EasyPHP running in my computer. At present my ip address (global) is 223.231.178.118
Now, let's say there is someone else (maybe in a different country altogether) who wants to access my ip (223.231.178.118). I do know how to access 192.168.x.x from the same network. I just want to know how you can do this globally, if possible.
P.S 1 : The computer running EasyPHP is behind a router.
P.S 2 : My IP (local IP is, but global one is not) is not static. But let us assume the person who wants to access my localhost does know my Dynamic IP. For example, let us assume I tell the person who wants to access my localhost is my friend and I tell him over phone what my IP is.

You can use tools just like ngrok or Forward
more tools are in this post Accessing localhost From Anywhere

Your local IP address "192.168.x.x" is only known to your router and unknown to everyone outside your LAN. The global IP address (223.231.178.118 in your example) is the global address of your router.
To be able to access the EasyPHP server on your local computer you need to forward the corresponding port (for http webservers the default is 80 but it might be different for EasyPHP) from your router to your local IP. You need to check your routers manual on how to do this.
After you have done that you can just tell the person who wants to access your local computer the global ip address of your router and he will see your EasyPHP response by browsing to that global address.

Related

How to port forward for DynDNS without touching the NAT router

I got a bit of a problem lately. I want to access my home network from the internet using a VPN and DynDNS.
For DynDNS I registered a free domain name at TwoDNS. My router is also setup to tell the DNS server its current IP address once in a while.
But then I realized that the address shown at TwoDNS doesn't match the address my router has. This is due to the fact that I am living at a student residence that is connected to the network of our university.
So my local network probably lies behind multiple NAT-routers. Usually this would require a port forward but how if I am not in control of the routers.
Maybe an external server with a constant connection to my home network will do the trick. What do you think?
Is there some kind of dynamic NAT?
Thanks in advance for any help
The solution is simple and there is one specific service to enable just what I described: LogMeIn Hamachi

Why does the user's IP is a local one when accessing the page using the global URL?

I am logging every user's IP when they access the company's page.
There are two ways to access the page from inside the local network:
http://company/webpage
and
https://webpage.company.com
What bugs me is that even when the users use the https global IP, their accesses are still recorded on database with their IP as 10.50.1.12 or 10.50.1.100.
Does that means that the browser or something else is redirecting the https://webpage.company.com to company/webpage? Or does that mean that I'm using a flawed method to log the users IP?
Another way to ask my question (just to make sure I'm being clear): if I'm accessing my Internet web page from inside the LAN network, am I effectively going outside my network and then back? If not, where am I going wrong with my logging?
Code used to log user's IP:
user.LastIP = HttpContext.Current.Request.UserHostAddress;
I'm curious about this because I want to make sure the users inside the company will access the page using exclusively the LAN Network. The goal is to save bandwidth usage, which is scarce.
Edit:
Pinging the https://webpage.company.com from inside the LAN network will result in a reply from a global IP address like 194.xxx.xxx.xxx. So I'm clearly getting the user's IP wrongly. What would be the ideal way of retrieving the IP from the page accessing entity?
Access to http://company/webpage will result in a DNS lookup of the host name "company". To resolve this, DNS will need a fully qualified domain name (fqdn), so it will add a top level domain (according to the configured search list in the client). In this example, it seems fair to assume that the fqdn will be "company.com". This, in turn, may very well resolve to the same IP address as the "webpage.company.com". You can check this by using dns lookup utilities like 'nslookup' and 'dig', or simply by using 'ping company' and 'ping webpage.company.com'.
The users IP addresses you mention, 10.50.1.12 and 10.50.1.100, seems to be the local IP addresses of the client hosts. I base this assumption on the fact that these IP addresses come from the RFC-1918 address range which is used for internal addresses. My guess is that these are the correct IP addresses, and that your logging works fine.
The users IP address you will log from accessing 'http://company/webpage' and 'https://webpage.company.com' should in most cases be the same. You can see it this way: it doesn't matter what the target URL is, traffic is still coming from the same host, the same IP address.
In any case, you most probably don't need to worry about any traffic leaving your local network.

How to Find My Proper Ip Address to Connect to Another Computer Remotely

My friend wanted to connect to my computer using Remote Desktop Connection. But the problem is I am confused what my Ip address is.
My computer is connected to the internet via router via broadband internet network. My ip address is dynamic.
Here, my main purpose is not only the remote connection but also learning how dynamic ip connect to another pc.
I searched for ip address on Google. They show me an ip address. But I think it is not mine, it's related with the router or broadband network. I also find a WAN ip (it is different from that i found on google) on router settings. It did't work.
I used Team Viewer. It worked perfectly. But I want to do that manually because I am going to make a multiplayer game on GM8.
It will helpful if someone explain about ip and port forwarding.
Teamviewer is a great tool, but uses different techniques than what you plan to do. Teamviewer always uses an outgoing connection and use a mediator on the Internet to connect you and the other PC.
You should ask your Internet provider if he technically enables you to be reachable from the outside Internet. Often this is not possible at all, even if you configure your router the correct way.
When you ask this you can ask him if you have a static IP.
It seems you are not aware of basics of IP networking, so I'd strongly advise against trying this on your router as wrong settings would render it useless. But here's for your information how port forwarding and IP Address and dynamic DNS can be used to solve your problem.
Basically your ISP is likely to give you a router having an IP address. If this IP address is a global IP address, it is possible to connect to this IP from outside. How do you find out whether your IP address is global? Look for your WAN IP address setting. If it is in 10.x.x.x or 192.168.x.x range, it's unlikely to be global and in that case it might not be possible to connect to your computer from outside - without help of a third server (some kind of a registration server, where you connect and register your application). The Registration server would determine your globally visible IP address and then convey it to another Application who is interested in connecting to it. This is somewhat complicated to make it work (but if you intend to make a game - this is something you'd have to do regardless). This is mostly how software like TeamViewer would work.
If you have a global IP address - it means it can technically be reached from anywhere in the world. In that case you could use port forwarding to make things work for you. Port forwarding works basically as follows - You expose a certain port (on TCP) to external world - say 8000 and then you make a setting like following on your router.
<TCP>-<RouterIP>-8000 --> <TCP>-<Your LAN IP><Your application Port>
(You can find you lan ip using ipconfig on windows or ifconfig on Linux).
Now all connections coming to port 8000 would be directed to your application. You might want to do it on UDP as well and the protocol above would change. That is how you 'open' a few ports to be accessible from outside, configure them on your router and then run corresponding applications on your network.
There's another thing called dynamic DNS, where the IP address you use if it is dynamic (and global) can be registered with a Dynamic DNS server so that you don't have to know and remember the current WAN IP Address. But that can be for later.
Hope that helps.

Possible ways to keep track of dynamic ip address?

So for those who knows what bitcoin miner is I got one, for those who don't know what it is they can search to see what i mean.
Anyway as far as I have seen, machine is running and configurable through mikrotik installed on raspberry pi.
And I got it working.
The problem is that machine is located on my friend's house, and I need access to the machine from time to time. So far I have made redirect on router so machine is accessible to outside world.
But I can access it only if I know what is ip address of my friend internet. But as he have dynamic ip address, the address is changing from time to time, and I can't access the machine unless he tells me the new address.
What are the possible ways to track dynamic ip address and know what is the address when it's changed so I can access machine any time?
You can access your external ip address formatted as simple text from http://wtfismyip.com/text. You can write a shell script to 'wget' the address and 'mail' it to you. The 'crond' on your raspberry pi can then regularly execute the script.

Domain Name Split to Subnet DD-WRT

I an trying to setup a server system at home because I recently switched ISP's.
I own the vrakiver.net domain name through the register.com registrar.
My ISP provides a static IP to my DD-WRT router.
I have 2 computers setup with static IP's:
1st: "server" with IP 192.168.1.102
2nd: "g5" with IP 192.168.1.100
I from within the LAN I can connect to either with server.local or g5.local or at their respective IP's.
I Would Like to set up the system so that I can use g5.vrakiver.net from anywhere in the world to access "g5" and server.vrakiver.net to access "server"
Port forwarding isn't going to cut it, because I need access to all the ports of both devices. (But not necessarily at the same time)
I read something somewhere about some systems asking what domain the user was directed from and then deciding where to route based on that.
* I Think this should be physically posible, beacuse it would be so easy on IPv6, just set the domain record to each hosts publicly accessible IP.*
Thanks in advance for any advice on this you can give.
I'm afraid what you're trying to achieve is not possible.
Your clients will first resolve server.vrakiver.net or g5.vrakiver.net before contacting your router.
As the resolution yields the same IP adress, your router has no way to know which name has been used.

Resources