http - Why do I have different IP addresses on different websites?

06
2014-04
  • saltycookie

    My wireless router shows the IP address is 113.46.75.*, which some websites like ip138.com, www.ip.cn show as my IP.

    But other websites, like googling for "what is my ip", www.whatismyip.com, www.whatsmyip.org, show that my IP is 121.18.126.*.

    I am very curious why this happens and how is it possible.

    So, why do different websites show that I have different IPs?

    Thanks all!

    Plus: I changed my IP address several times (restarting the modem) and all addresses is like 113.46.*.*, but my IP address does not change when googling for "what is my ip".

    My ISP is a small company, so I think it is true that when visiting some websites, I am NATted or proxied to some IP addresses which have access to those websites -- not to avoid firewall though, since I am still blocked from some websites.

    But I still want some more information or resources to support our guess. Thank you!

  • Answers
  • Mokubai

    Chances are that what you are seeing as this "wrong" IP address is a transparent proxy between you and your Internet service providers connection to the internet.

    This is basically what paxdiablo was trying to get across, with NAT you don't necessarily get local addresses assigned and it is actually possible that you have a fully accessible "normal" IP address (so you can run servers and voip clients that require incoming connections) but your actual data connection is through a transparent proxy that catches and caches a good number of websites so that they can do things like caching common websites and reduce overall bandwidth used for those sites.

    What this means is that depending on how the site resolves your IP or whether the transparent proxy kicked in your address may appear differently to the site that is trying to trace you.

    I have found this a couple of times with my isps in the past. If you try to do a 'whois' lookup on this odd ip address then you may well find that it belongs to either your isp or their upstream provider.

    An alternative is a 'hostname' lookup which may resolve to something useful like proxy.somelocation.myisp.com as it has done for me in the past when I have encountered this seemingly odd situation.

  • techie007

    ip138.com, www.ip.cn appear to be Chinese, the other sites are not.

    If you are also in China, then perhaps you are being proxied to sites outside of China to avoid government firewalls (or alike)?

  • Moab

    Welcome to the wonderful world of NATting, firewalls, routers and other associated network infrastructure.

    Your local IP address is rarely what the outside world sees you as simply because of NAT (network address translation).

    Your ISP or local router will generally do this translation for you in such a way that many different people can share the same IP address (local ones like 10.x.x.x or 192.168.x.x, for example, and from memory so don't take the actual values as gospel). These local addresses are ... well ... local, so they don't get "published" to the real Internet.

    That way, we didn't run out of IPv4 addresses back in 1986 :-)


  • Related Question

    networking - IP address classes, networks and hosts
  • Questioner

    This may seem like a basic question but I need to understand IP addresses.

    I don't understand why IP addresses are split into network (wires) and nodes (hosts | device).

    For example Class A has 8 bits of network and 24 bits of host, where does this fit into the actual IP address.

    I am quite stuck on this as I look at examples around the net and they state mainly that the IP is split into network and hosts then each class has different values. But I'm not sure exactly what this means.

    would be great if someone could spend a little time to explain.


  • Related Answers
  • Spiff

    There are two main reasons a host needs to know which portion of its address is the network number and which portion is the host number.

    The first reason is so it knows what data link layer (e.g. Ethernet MAC layer) destination address to put on an outgoing packet. If the destination IP address's network section matches the source IP address's network section, then the destination host is directly reachable on the local data link (e.g. it's on the same Ethernet LAN), so the sender can find the destination machine's link-layer address (perhaps via ARP) and put that host's link-layer address in the destination field of the link layer header of the packet. If the network sections of the source and destination IP addresses doesn't match, then the sending host has to send the packet to a router. In that case, the sending host puts the router's link-layer address in the link-layer header.

    The second reason is so the host can determine the local network's broadcast address. It does this by filling in all the bits in the host section with ones. So in the case of 192.168.1.0/24, the broadcast address is 192.168.1.255.

    The idea of network "classes" (a.k.a. "classful networking") only really mattered from the invention of IPv4 in 1981 until the invention of subnetting and Classless Inter-Domain Routing (CIDR) in 1993. From 1981 to 1993, if the first bit of your IP address was a zero, you knew you were on a Class A network, so the first 8 bits of your address was your network number, and the other 24 were your host number. But this meant sites with Class A networks would have 16.8 million hosts on a single flat network, which was impractical. Even though it's been almost two decades since "Class A", "Class B", and "Class C" really mattered, the names still get kicked around to refer to /8's (16.8 million host networks), /16's (65 thousand host networks), and /24's (~256 host networks), respectively.

  • ultrasawblade

    The reason for the split is that it's rare that you have a direct connection to the computer you want to send something to. The data you send usually goes to a router, which then forwards it to other routers, and so forth until a final router in the chain delivers it to your system.

    For this to work, there must be a way of knowing which IP addresses can be reached just by dumping data out of the network card, and which IP addresses can only be reached "behind" a router. The network part of the IP address, determined by the network mask, makes this distinction.

    So, if my IP is 10.1.1.42, and my netmask is 24 bits from the left (255.255.255.0), then that means I can reach any IP address from 10.1.1.1 to 10.1.1.254 just by sending data out of my network card. I'll use my IP as the source address, the end machine as the destination address, and just throw the traffic on the wire. It should get there if say, the other machine is connected via a switch or hub, without any further help.

    Let's say I want to talk to 10.1.2.50. Well, I can't reach that just by spitting the bits out of my NIC. It has to go through a router. The simplest situation is where there is a default gateway given by DHCP. Let's say the default gateway given to us through DHCP is 10.1.1.254. I'll then send my traffic that I want to go to 10.1.2.50 to 10.1.1.254, putting my IP (10.1.1.42) as a source address and 10.1.2.50 as a destination address. The default gateway is not the ultimate destination, but I'm really expecting 10.1.1.254 to forward the traffic to 10.1.2.50 on my behalf. Hopefully the machine at 10.1.1.254 has a connection to the 10.1.2.0/24 network, and will be able to do that.

    I hope this is helpful.

  • maks

    Example: 10.0.0.1 /8
    where /8 - means network mask. This means that first 8 bits of 32(the adress consists of 32 bits divided by dots and this bits are represented as decimal numbers) identify the network and others - the host

  • Sathya

    Perhaps this article from Cisco will help.