networking - How to find my computer's IP Address?

06
2014-04
  • Cengiz Frostclaw

    This question already has an answer here:

  • Answers
  • grawity

    Strictly speaking, your computer doesn't have an IP address that's reachable from outside. It only has a private IP address somewhere in the 192.168.0.0/16 range. It doesn't matter if it's assigned statically or by DHCP.

    (The 255.255.x.x thing is probably a netmask, used to determine which IP addresses belong to the same LAN.)

    Only the router has a public IP address, and it's the same one that Google and various other websites tell you. When your computer sends any packets to the Internet, the router changes the sender's address from the internal one to the router's public one (performs NAT). When receiving packets, it searches its NAT table for matching addresses and TCP/UDP ports, and changes the recipient's address back to the internal one.

    However, if there are no matches – for example, if someone outside is trying to create a new connection – then the router doesn't know which internal address to use, and usually just drops the packet. This is what I meant by "doesn't have an address that's reachable from outside". Of course, it's possible to create static forward rules, e.g. "connections to TCP port 22 → internal address 192.168.42.1".

  • Hennes

    Usually one would find his or her own IP address by looking at the configuration on the computer. E.g. on windows type ipconfig. On OSx, BSD, Linuxes, ... use ifconfig.

    As to you getting just one IP. I strongly suspect that:

    1. Your IP is 192.168.1.100 or similar (which is the default DHCP range for IPs in most SoHo devices)
    2. That you only have one non RFC 1918 IP (aka one real public routable IP) and that your home setup is using a terrible kludge called NAT to work around this.

    [Post edits]

    Yes, of course. But that's the side question, really. I need the basics first. How do I know what my reachable-from-outside IP is?"

    There are at least three ways to do that:

    1. Go to another computer and ask it where your are coming from. (The wehatis myIP website makes it easy by putting that information in a webpage. That 88.225.x.x IP is your public IP.
    2. Check your providers modem. It will list wich IP it is using (even if it got the IP via DHCP from your ISP).

  • Related Question

    networking - How can I add a wireless router to a wired router?
  • Tester101

    The Setup:

    • wired D-link (EBR-2310) router connected to my cable modem.
    • Wireless NetGear N300 (WNR2000v3) router connected to a LAN port on the wired router.

    What I'm trying to do:

    I'm trying to setup the wireless router to be a separate network, that only accesses the internet through the wired router.

    What I've done so far.

    I setup the wireless router's WAN port to get an address from ISP (which should be coming from my wired router running DHCP), and the LAN as a subnet (192.168.1). Wired router's LAN is 192.168.0.

    The problem:

    I'm not able to connect to the internet from the wireless router. At one point my wired router showed that it was handing out an IP to the wireless router, but that is not happening anymore.

    The question:

    Is what I'm trying to do possible? Am I not thinking about this properly? Do I need to buy a better wired router, with 2 WAN ports? How can I configure these routers to work together?


  • Related Answers
  • Ярослав Рахматуллин
    ,--------.
    |     wan+------- (ISP)
    | Wired  |
    |   lan  |
    `---++++-'  ,------.
           `----+wan   |
                | Wifi |
                |  lan |
                `--++++'
                   ||||
    
    1. Connect like shown above.
    2. Configure the Wifi router to receive the WAN address via dhcp.
    3. Profit
  • TheCompWiz

    Although I'm not 100% sure on the options inside each router specifically, on the surface yes, this seems very feasible.

    Make sure the WAN port on the 2nd router is connected to the LAN port on the 1st router.

    Most routers allow some basic firewall rules to be applied. In the 2nd router simply add a firewall rule to reject all traffic to the subnet on the 1st router... (excluding the ip of the IP of the 1st router itself). Once that's done... you'll be able to connect to the internet but not the private network.

    There are much more elegant ways of doing this, but with home-grade equipment and factory-stock firmware... your options are limited.

  • Tester101

    Finally got it working.

    Physical Connections:

    I connected one of the LAN ports on the wired router, to the WAN port of the wireless router.

    Configuration

    I set up the wireless router to obtain an address from the ISP, so it would be assigned an address from the wired routers address pool. Next I set the wireless routers internal IP address to 192.168.1.1. Next I turned on DHCP on the wireless router, so it would hand out addresses to devices connecting to the 192.168.1.x network. Finally I waited, and waited.

    Poor communication is bad for networking

    Turns out the problem I was having was that the routers were not sharing information fast enough, and there was no way (that I could find) to force them to speak to each other. The wired router knew where the 192.168.0.x and the external (Internet) networks were, and the wireless router knew where the 192.168.1.x network was. But neither of them wanted to tell the other what they knew. Once they became friends and started talking, the problem resolved itself and everything worked fine.