public ip/ private ip, i want remote access !

Posted:
in Genius Bar edited January 2014
Hello...



I was wondering if someone could clear this up for me, Ive looked all over the internet and these forums and I cant seem to get my head around the whole public ip/private ip thing, and applying it to remote access.



Basically I want to ssh into my computer from across town or whatever internet connection I have available at the time.



My router (dsl modem, whatever you want to call it) assigns my computer a dynamic ip somthing like 200.200.200.10 (not real numbers). And i can access the internet. So I browse over to whatsmyip.org (or similar service) and it shows something like 200.50.150.30, obviously different.



What I assume is happening here is that my router assigned ip comes is further routed to some kind of gateway that is handling traffic for my isp. I think.



So assuming I want to access my computer in a relativley short period of time after leaving it turned on with sshd running can I ssh to the ip that I was provided with by the whatsmyip site ? or do I have to use the ip provided by dhcp ? if so... how is my computer differentiated from the other computers on the internet that might have the same ip assigned to them from a dhcp server.



When I searched the boards I noticed some people mentioned services that can handle this kind of thing for you. Looks neat and I might sign up for it one day but Im really hoping to do it manually and maybe get a little insight into how this all works.



Any networking gurus out there... please help...

Comments

  • Reply 1 of 3
    torifiletorifile Posts: 4,024member
    Port mapping/forwarding is what you need to enable on your router. There should be some documentation available for you on the manufacturer's website.



    Basically, what happens with port mapping is that you tell your router (which is the only computer that can have your real IP address because only one computer can have an IP address at a time - a router is a computer), "I want you to map all traffic coming in on this port (22 for ssh) to go to the computer you're calling xxx.xxx.xxx.xxx" This is cool for a number of reasons, not the least of which is the automatic protection from incoming packets. It also means that you have the ability to have multiple computers doing the serving duties behind the scenes and to the outside world it looks like it's all one big server.



    Keep in mind that with port mapping enabled, you've got to give your computer a specific IP address within your router's range. Again, it's not rocket science to get working, but you've got to know where to look.... Good luck.
  • Reply 2 of 3
    aslan^aslan^ Posts: 599member
    Okay... I dont have access to my router, my ISP provided it and I cant log into it to change any settings. (I would call them but I cant speak Korean). So... I could set up a portforwarding rule on my boxen, I assume you're tlaking about forwarding a port higher than 1024 to port 22. But I still dont understand which IP to use, interestingly enough, I just went to scan.sygate.com and it could see my computers ip ! which the others didnt do...



    My router is a strange beast, it assigns me an ip via dhcp and as far as I can tell it uses the same ip for itself ! not sure how it does that but... it always sets the ip address of the computer its connectd too and the gateway is the same. It may well not be a "router" and just some weird kind of dsl modem... im not sure and I couldnt find any white papers or other information on it, on the internet.



    EDIT: after using traceroute... i can see the first stop is 192.168.1.1, the usual address for a router... so I nmap 192.168.1.1 and i can see ftp, http and telnet ports open.. must be an actual router (computer) and not just a fancy dsl modem. So is it just fowarding all incoming packets that it receives on its "public ip" to the computer I have connected to it and using its "private ip" to maintain a connection with my computer ?



    If thats the case then I suppose I want to try sshing to the public address... which I would get from whatsmyip.org (question phrased as a statement) ?
  • Reply 3 of 3
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by AsLan^

    Okay... I dont have access to my router, my ISP provided it and I cant log into it to change any settings. (I would call them but I cant speak Korean). So... I could set up a portforwarding rule on my boxen, I assume you're tlaking about forwarding a port higher than 1024 to port 22. But I still dont understand which IP to use, interestingly enough, I just went to scan.sygate.com and it could see my computers ip ! which the others didnt do...



    My router is a strange beast, it assigns me an ip via dhcp and as far as I can tell it uses the same ip for itself ! not sure how it does that but... it always sets the ip address of the computer its connectd too and the gateway is the same. It may well not be a "router" and just some weird kind of dsl modem... im not sure and I couldnt find any white papers or other information on it, on the internet.



    EDIT: after using traceroute... i can see the first stop is 192.168.1.1, the usual address for a router... so I nmap 192.168.1.1 and i can see ftp, http and telnet ports open.. must be an actual router (computer) and not just a fancy dsl modem. So is it just fowarding all incoming packets that it receives on its "public ip" to the computer I have connected to it and using its "private ip" to maintain a connection with my computer ?



    If thats the case then I suppose I want to try sshing to the public address... which I would get from whatsmyip.org (question phrased as a statement) ?




    You would access your computer by using the public ip address of your connection, and, yes, that's the ip address you'd get from looking at whatismyip.org. As for the rest, I don't really understand your setup...
Sign In or Register to comment.