Results 1 to 18 of 18

Thread: How to ping computer behind home router?

  1. #1

    Thread Starter
    Hyperactive Member capsulecorpjx's Avatar
    Join Date
    May 2005
    Location
    Renton, WA
    Posts
    288

    How to ping computer behind home router?

    What IP address would i use to ping a PC connected behind a home router (with one public IP address shared among multiple PCs)?

    Would it be:

    <global IP address>:<port num>?

    How would I find out the port num?

    I'm confused at how servers can distinguish between the different computers that share a single public ip behind a router.
    "I like to run on treadmills, because at least I know I'm getting nowhere."
    - Me

  2. #2
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: How to ping computer behind home router?

    Ok, if you want to ping yourself, the router would be the acctual thing that answers (or at least thats how linksys routers work, personal experiences...).

    If you want to ping yourself just enable anonymous requests.
    There is no port number, just open the command prompt and type:
    ping xxx.xxx.xxx.xxx (where xxx is your IP, or domain (subdomain even)).

    The router handles the requests. Like, say you had port 80 open on Comp A, and a request comes in from a webbrowser (becuase a webserver normally runs on port 80) the router looks at the port forward table and see which comp has port 80 open and forwards the request to that comp. Otherwise, itll deny the connection.

    Does that help any, or are just confused even more? :P.
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  3. #3
    Addicted Member
    Join Date
    Mar 2005
    Posts
    158

    Re: How to ping computer behind home router?

    ok i try my best to explain
    if i am wrong, somebody plez correct

    let say u got 3 network pc and 1 d-link ADSL router.
    since we use the ADSL router to connect to the ADSL broadband, so the ADSL would receive a so called WAN IP (wide area network) or something like public IP.
    this ip might be dynamic or static, dynamic means, everytime you turn off your router and turn it back on, the public IP would be different. while static means, the ip would remain same, even you turn off and on your router hundred times.

    the WAN IP is the IP that identified you in the internet. so, when your router is connected to your ISP, you could try visit www.myipaddress.com and you would see your WAN IP in that page.

    let say, you got 3 pcs and you want every pc to be able to connect to the internet.
    so what we do is, we build a small internet or (LAN - Local Area Network) on our own. we use private IP address to uniquely identified each pc in our own small internet.

    10.0.0.0 - 10.255.255.255
    172.16.0.0 - 172.31.255.255
    192.168.0.0 - 192.168.255.255

    http://www.duxcw.com/faq/network/privip.htm

    so, we have a picture like below (we set the ip address manually on those pc)
    [PC 1] - ip - 10.0.0.20
    [PC 2] - ip - 10.0.0.30
    [PC 3] - ip - 10.0.0.40
    [the D-Link ADSL router] - ip - 10.0.0.1 {manufacturer set this IP, but we can change it}

    usually, when you buy a ADSL router, it would already assign itself a private IP, some use 10.0.0.1 and some (AZTECH) use 10.0.0.2.

    now you should learn that, the ADSL would contained 2 ip address. one is public IP (given by the ISP) and one is private IP (which the manufacturer assign itself)

    some how if you feel that to set those private IP manually on our 3 pcs is troublesome (when you have 100 pcs), you could use the DHCP server on the ADSL router.

    and select the obtained IP addres automatically and obtained DSN server IP address automatically.

    the gateway IP is the private IP address of your ADSL router private IP. consider gateway as the ip address to which the packet (ur network request) is forwarded.

    =========================================================
    [PC 1] - ip - 10.0.0.20
    [PC 2] - ip - 10.0.0.30
    [PC 3] - ip - 10.0.0.40
    [the D-Link ADSL router] - ip - 10.0.0.1 {manufacturer set this IP, but we can change it}

    so, let say u use PC1, if you start ping 10.0.0.30 from PC1 and it replies, this mean the PC1 and PC2 are able to connected.

    and if you ping 10.0.0.1 and able to received replies, this mean, the connection of PC1 and your D-LINK ADSL router is Ok.

    now, when you ping 207.46.19.30, since "207.46.19.30" is not in our small LAN, so it would be forwarded to our gateway "10.0.0.1", and the router would then forward it into its gateway ip (which it received from ISP) and keep forwarding until it reaches "207.46.19.30".

    now let say, the LAN we talk above is at your home, and you have set up something similiar like this in your office.

    ------------[office]------------
    router B
    public ip : 207.46.19.30
    private ip : 10.0.0.1

    web server pc
    private ip : 10.0.0.60

    ------------[home]------------
    router A
    public ip : 60.57.35.4
    private ip : 10.0.0.1

    PC 1
    private ip : 10.0.0.20

    so let say, you open your web browser (IE or firefox) and you type http://207.46.19.30 in the address. what is actually it reffers is http://207.46.19.30:80 , the :80 here is port 80 which usually be set as web server port.

    try key in the following -> http://207.46.198.60:80 , you would still reach microsoft website.

    since the router is a small operating system and it doesn't host our webpage files, so what it did is port forwarding the request to specific pc if no, it just deny it and show you some error.

    all these rules you set it on your router.
    you could set something like, whenever there is request for port 20 in router WAN ip, plez direct the packet or request to 10.0.0.60 port 50. so what appear to people as port 20 is actually located inside internal network and serviced by web server pc 10.0.0.60 which uses port 50.

    so, if you want to ping from PC 1 to [web server pc], well, u see, the web server pc ip is private and not visible from internet, what you could see is just the ip address of the router B.

    so, if you hack the router B, then you might could gain some way to make your pc be treated as a pc of router B network.

    k, plez rate my post lol

    ======================
    reference:
    IP Routing
    http://www.microsoft.com/technet/com...uy/cg1201.mspx
    if u felt my post make u happy ,
    then u could make me happy too by rating my post

  4. #4
    Junior Member
    Join Date
    Aug 2005
    Posts
    18

    Re: How to ping computer behind home router?

    pinging yourself is 127.0.0.1

    and there is no port in ping

  5. #5
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: How to ping computer behind home router?

    Quote Originally Posted by capsulecorpjx
    What IP address would i use to ping a PC connected behind a home router (with one public IP address shared among multiple PCs)?

    Would it be:

    <global IP address>:<port num>?

    How would I find out the port num?

    I'm confused at how servers can distinguish between the different computers that share a single public ip behind a router.
    I just had a wild thought, you could set up a client/server application.

    Client sends "Ping"
    Server sends "Pong"
    Client sends "Ping"
    Server sends "Pong"
    ...
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  6. #6
    Lively Member
    Join Date
    May 2005
    Posts
    90

    Re: How to ping computer behind home router?

    It is impossible to directly ping systems behind a router, although misconfigured routers map forward pings to EVERY host on the network - but for security reasons that's not really existant any more. At most, the router replies.

    The remote host need not distinguish between clients behind a router, since it only cares about the IP and port communicating with it... The router handles forwarding these connections and ferrying data back and forth to the correct hosts both in and out of the network.
    ^_^

  7. #7
    Lively Member
    Join Date
    Feb 2006
    Posts
    64

    Re: How to ping computer behind home router?

    Can you please describe in steps how to setup port forwarding at my router?

  8. #8
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: How to ping computer behind home router?

    Quote Originally Posted by chthong
    Can you please describe in steps how to setup port forwarding at my router?
    There is no universal way to set up port forwarding, every router manufacturer is different. Your router will have some sort of control panel which you can set iy up, usually if you navigate to http://192.168.1.1 it will be there. If not take a look in the instruction manual of the router. If you have no manual, search google for your the make and model + portforwarding for your router.

    PS: please dont drag up old threads and ask different questions, instead make a new thread with your question
    Chris

  9. #9
    New Member
    Join Date
    Feb 2006
    Posts
    3

    Re: How to ping computer behind home router?

    Start --> Run --> Cmd
    ipconfig
    look for your default gateway address...

    go into your web browser: http://{Gateway addy}

    Your router control panel will come up (You will need a user name and PW which the router manufacturer will give ya). Within the control panel you'll see a column for port forwarding (or its a sub heading)

  10. #10
    Lively Member
    Join Date
    Feb 2006
    Posts
    64

    Re: How to ping computer behind home router?

    I can access to router already. I add my LAN ip in the LAN clients list. and i have also add a rules in the port forwarding with port start, port end, port maps all 8080. but still its look like something missing. I can't access to my web server using WAN ip with port 8080. Or am i having a wrong concept?


    Code:
    PS: please dont drag up old threads and ask different questions, instead make a new thread with your question
    Sorry for that. I am trying to search for the whole forum to see is that the similar question asked before or not. I thought its not vice to open new thread always... Next time i will open a new thread.

  11. #11

    Thread Starter
    Hyperactive Member capsulecorpjx's Avatar
    Join Date
    May 2005
    Location
    Renton, WA
    Posts
    288

    Re: How to ping computer behind home router?

    I understand port forwarding.

    But I'm still confused.

    Lets say there are two computers behind a router, one public IP address all that stuff.

    Both computers are accessing the same website, www.cnn.com

    Does CNN think there is only one computer trying to get data since they are sharing the same public IP?

    I mean if CNN sends a packet to the public IP address, how would the router know who that packet is for?

    I'm guessing the ethernet physical address is included in the IP Packet, and that physical address is used by the router to distinguish between the two computers behind the network.
    "I like to run on treadmills, because at least I know I'm getting nowhere."
    - Me

  12. #12
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: How to ping computer behind home router?

    both computers connect to the site, there is two seperate connections even though they are both coming from the same router IP address, therefore two seperate sockets all the data going to and from one socket is for one of the network hosts, and the other socket is for the other host
    Chris

  13. #13
    New Member
    Join Date
    Apr 2010
    Posts
    1

    Re: How to ping computer behind home router?

    I had the same problem. If you're using windows XP, go to control panel/ click on advanced tab/ click the settings button under ICMP/ Enable Allow incoming echo request/ click OK. Do this on all the computers on the network. If you allow File Sharing, ICMP would be automatically allowed.

    Hope this help!

    &#220;

  14. #14
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,748

    Re: How to ping computer behind home router?

    Quote Originally Posted by capsulecorpjx View Post
    I understand port forwarding.

    But I'm still confused.

    Lets say there are two computers behind a router, one public IP address all that stuff.

    Both computers are accessing the same website, www.cnn.com

    Does CNN think there is only one computer trying to get data since they are sharing the same public IP?

    I mean if CNN sends a packet to the public IP address, how would the router know who that packet is for?

    I'm guessing the ethernet physical address is included in the IP Packet, and that physical address is used by the router to distinguish between the two computers behind the network.
    Ports! You connect by a local port / address to a distant port / address. Here is my connection to vbforums at this instant in time.
    192.168.3.5:3627 10.239.99.158:3627 63.236.73.220:80

    It says my pc 192.168.3.5 on port 3627, via my isp 10.239.99.158 port 3267, is connected to vbforums (63.236.73.220) port 80.

    ICMP (ping) does NOT use a port, so the only way to ping an IP on your net from the internet is for it to have a public IP, or for your router to have a public IP with a filter that re-directs ICMP traffic to a particular PC on your net.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  15. #15
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: How to ping computer behind home router?

    I guess you didn't notice this thread is 5 YEARS OLD.

  16. #16
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,748

    Re: How to ping computer behind home router?

    I was responding to jur... I C
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  17. #17
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: How to ping computer behind home router?

    Quote Originally Posted by dbasnett View Post
    ICMP (ping) does NOT use a port
    Well I never knew that! Learn something every day
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  18. #18
    New Member
    Join Date
    May 2015
    Posts
    1

    Re: How to ping computer behind home router?

    This is a great post and a great thread! Going strong for 10 years now! Nice to know that 10 year old IT info is still valid. I'm a network administrator and funny enough, I don't know how a VPN works. You mentioned in your post about "hacking" into a remote router [and setting it up] to treat your PC as a PC in its local network. Is this what a VPN is?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width