How to telnet to a computer which is sharing a single public ip? - ip

Suppose that I am sharing a public ip 56.162.XXX.XXX with some other users. Now I have a local ip that I see if I type ipconfig in the command prompt. That is 192.168.2.3. Now I have a program running on port 3630 listening to any incoming connection. I can call myself with the help of loop back ip ie. telnet 127.0.0.1 3630, and i see that two programs are getting connected and can exchange data. I can also telnet and get connected with my laptop from another laptop which is sharing same public ip as mine by the command telnet 192.168.4.20 3630. But how should I do the same from a remote computer? I mean a computer which has a different public ip.
Actually I want something like "telnet public ip(local ip) port no". The other computer is also sharing a public ip with some other users.

You will need to setup some kind of NAT (Network Address Translation) or PAT (Port Address Translation) that will forward the requests for port 3630 to your local IP.
The actual configuration to use will depend on your firewall/router. If you have a standard ADSL router, there is likely to be a configuration page in there that will allow you to do this.

You will need to read up on port forwarding and NAT.
http://en.wikipedia.org/w/index.php?title=Port_forwarding

Related

How we can access a localhost of a computer through its public IP if some other devices in the same network also have the same public IP?

I want to access localhost of a computer but other computers in the same network also has the same public IP. Can we access its localhost host by knowing both(public and private) IP address of that computer. I want to connect to it directly(not through any software like ngrok or VPN).
Thanks in advance.
You can only access localhost on the computer itself. Localhost refers to 'this node' by definition.
When communicating on an internal network you usually use the private IP addresses, not the public one(s). Connecting to a computer with a private IP behind a public IP requires reverse NAT aka destination NAT aka port mapping.
Connecting out from and right back into the same network through NAT may require a special firewall setup aka hairpinning. It's usually easier and faster to use split-brain DNS and resolve the public name to the private IP address of the device.

Failing to manage a Public Ip

Here is the scenario:
I have asked my ISP to give me public IP, which I can connect to my laptop and access from other outside network. They gave me following
IP : 103.51.2.198
subnet mask : 255.255.255.248
default Gateway : 103.51.2.193
preferred dns : 8.8.8.8
Alternate dns : 8.8.4.4
I have connected PPPoE connection in my laptop (not in router) and set these values at TCP/IP V4. My internet connection is fine.
But If I ping from other network by this IP (103.51.2.198), request is timed out.
Than I checked whatsmyrealip. and the IP is (103.51.2.102). this IP is a public IP of my ISP provider. And they are trying to give me an IP from that IP.
My ISP providers are not expert in networking nor am I. They are also not sure how they can give me a public IP.
I am not sure about what are they trying to do. and how will they give me another IP from a public IP. It will be very helpful, If anyone can explain the problem. and give a solution.
First of all, it's called public IP not "realIP".
Anyways, the answer for your question is:
You cannot access your home computer because it is behind NAT so it is unreachable from the outside of your network.
Quick example on how NAT works:
Scenario:
Private IP: 192.168.0.10
Public IP: 1.2.3.4
You are connecting to webserver on IP: 5.5.5.5
What happens:
You send data to your router, telling it that you want something from
5.5.5.5, your router assigns you a random port, let's say 11111,
sends the data with source IP 1.2.3.4 and port 11111. Stuff
happens on the webserver and the data comes back. Router reads it and
remembers that everything going to 1.2.3.4:11111 belongs to
192.168.0.10 so it sends you the data.
Here everything works because it's your computer the one starting the connection, otherwise, the webserver would never be able to connect to you.

Port forwarding with private IP

I use a static IP connection, Configured to TPLINK router.
I have a local server running which i can access from my network, but i want it to be accessed outside network.
So I did port forwarding. and its Successfully running.
Now the problem is :: The IP address of my WAN is also a private address like 10.10.X.X, so when am entering http://10.10.X.X, i can access my site, but not outside my network. Please guide me how to fix this?
If your WAN address is a private address, your ISP is using CGN. This is becoming more common since the RIRs have, or soon will, run out of public IP addresses to assign to ISPs. It sounds like your ISP has run out of public addresses and needs to use private addresses for its residential customers, reserving its remaining public addresses for its business customers which are willing to pay for public addresses.
Basically, your ISP is using NAT, too. You would need to have the ISP forward your port on its NAT router, but the odds of that are zero since it probably has a policy you agreed to to not host servers on your residential LAN (buried in the fine print of the ISP agreement). This situation will play out more and more over time.
You have to use the "Virtual Server" settings. Port triggering is used for.
Once the modem router is configured, the operation is as follows: 1. A local host makes an outgoing connection to an external host using a destination port number defined in the Trigger Port field. 2. The modem router records this connection, opens the incoming port or ports associated with this entry in the Port Triggering table, and associates them with the local host. 3. When necessary, the external host will be able to connect to the local host using one of the ports defined in the Incoming Ports field.
It is not used for incoming connections which are triggered from outside!
Of course, to have it working you have to have an application listening on that port not only having the firewall on Windows allowing the port.
After you set up the "Virtual Server" a port scanner should show you the port is open (even without having a running application listening) - it will try to port forward it. I use ShieldsUp for testing.

Cannot access machine via DNS in the private network

I have a machine in my private network with IP 192.168.1.10
I have a DNS name, "toto.mydns.com", a DNS client is running on the machine.
I configured the router for Port forwarding.
I can access the machine when i am outside my home, when using a pulic IP address it works but when i am at home and i get a dynamic IP address trough DHCP from my router, i cannot use toto.mydns.com anymore, i must use 192.168.1.10 to access.
I would like to know if i need to configure something on the router for that ?
Thank you !
toto.mydns.com will resolve to your external public IP
There will almost certainly be nothing routing that IP through to your router, and thus through NAT to your internal address.
The easiest way to resolve this (Pun very much intended) is to have a hosts file entry on your computers running inside your network so that they resolve the same DNS address to the internal address.
A much harder, but more fun, way would be to set up your own DNS server inside your network, have the DHCP dish it out as the primary DNS server for your network and put in an entry for your internal address :D
Have fun...
Toto.mydns.com is accessible from outside,this DNS is assigned on a machine with a static IP address(sorry not dynamic),so the IP of this machine is 192.168.1.10.
Whrn i am at home in my private network i need to enter 192.168.1.10 and toto.mydns.com does not work.Any help???

Cisco VPN IP address

I've some doubts about a VPN.
I've been given a Cisco VPN client to connect to the LAN of my society. I use this to connect to a local server. I don't understand how the VPN is working.
I'm at home now. In the VPN Client I see an IP. If I go to http://www.whatismyip.com/ I see another IP, which is the IP I've when I'm also without the VPN Client, while I expected to see the IP of the VPN Client. If I use $_SERVER['REMOTE_ADDR'] I see another (third!) IP, while I expected the IP I see in the VPN Client.
Can you clarify please?
I need this to know if I'm identifies always from the same IP from the local server.
If I'm not mistaken, this should be correct. Please correct me if I'm wrong.
By default you have 2 IP addresses.
Local IP: IP address used to identify yourself within your LAN.
Global IP: A public IP used to gain access to the internet. At home it will most likley be a public IP NATTED* by your ISP.
Because you're also using a VPN connection, you'll receive a third IP.
Local IP for VPN: IP address used to identify yourself on the other end of the VPN.
*NAT = Network Address Translation

Resources