Different values for my IP address? - networking

Was just wondering why I seem to get different values for my IP address from different sources. If I go to one of the many different 'what's my ip' sites on the net I get a completely different value from when I use ipconfig (on win7)
And no, it's not the subnet mask I'm looking at, these are the actual ipv4 addresses, why would they be resolving to different addresses? Are these 'what's my IP' sites only able to hit an exchange and not determine the IPs of my actual box itself?

If your PC is on a network and not directly connected to your ISP via a modem, there will be at least one router between your machine and the internet. That router will almost certainly be doing NAT (Network Address Translation) and possibly DHCP (Dynamic Host Configuration Protocol) too.
The router will have been assigned an address by the ISP when it established the connection. This address might be static (unchanging) or, more commonly, dynamic (changes periodically as the ISP sees fit). So your 'public' address - the one the router has been assigned and which is visible to the internet - may change from time to time.
Your PC will be connected to the router, and will either have a fixed IP address assigned to it (typically in the 192.168.x.x range) through your OS networking config, or will be given one by the router each time it connects (when you switch on or reboot) via DHCP. In this case, the address will be in whatever range the DHCP service has been told to use (again, the default is likely to be in the 192.168.x.x range).
So your PC has its' own internal address, and your router has its' public address. When you exchange internet traffic, the machine at the other end of the connection will see your public address, not your internal address - the router takes care of forwarding data to the right internal address automatically.
Depending on what IP-checker service you're using, it might display your public address (from the router, which may change if the ISP assigns dynamic addresses) or your internal address (typically when a script runs inside the browser and asks the machine directly).

The answer won't clarify anything, but I'll tell you anyway.
They're both right.
No, your machine doesn't really have two IP addresses, but the IP it shows as depends on who's looking, and from where.
•
What you're seeing is the result of what's called a NAT router. NAT stands for "Network Address Translation". The router manages the IP addresses on a LAN, or Local Area Network, and then translates to the appropriate IP address it was assigned on the external network, usually the internet.
details

Related

How does a computer know other computer's IP address on a local network?

I'm currently learning about ARP and L2/L3 networking - would someone be able to help out? If I use an ethernet cable to connect my laptop (A) to another laptop (B), it could use ARP to find out B's MAC address based on B's IP address. Then, any ethernet frames could be sent and accepted by B.
But how does A know B's IP address in the first place? What if there is a switch (L2 device) in between A and B? Does this change the answer? What if there was a router in between (an L3 device)?
Usually, a switch/Router will assign an IP.
The question is unclear -
find out B's MAC address based on B's IP address.
B's MAC address is not based on B's IP.
A MAC is associated to the hardware (but somewhat assignable/cloneable) where as an IP is assigned. Either by DHCP or statically by an admin.
Effectively, you need a switch/router to make what you're defining work.
EDIT:
you can connect two computers direct, but you still need to give each a static IP address so they can find each other - this would likely not be ona network so the IP sub-network doesn't matter.
It still has very little to do with MAC.
If two PC's hand-shake, they'll see each others MAC.
It sends out a broadcast packet to the broadcast MAC address asking "who has the IP address x.x.x.x" which goes to all computers on that broadcast domain. If a computer sees that packet that owns the IP address "x.x.x.x" it will send a unicast reply back to the MAC address of the original requestor with its MAC address which will then be cached for further communication.
It doesn't know the IP unless you tell it. You say "the default gateway is 192.168.1.1" and it will start trying to talk to 192.168.1.1 etc.
If there is a router in between, all traffic to the remote device would go to the MAC of the router and your computer wouldn't be doing any ARP lookups other than that router.
Switches wouldn't matter for this, all they do is make the broadcast domain bigger. With a cable the broadcast domain is just you and the remote device. With a switch, it expands that to all devices connected to the same switch (or VLAN in the switch)
But how does A know B's IP address in the first place?
It doesn't know. At least there's no general method to find out.
The IP address of any resource needs to be supplied by "something else". You need to either provide the address yourself, resolve it from a (also provided) DNS name, read it from a file, ... Alternatively, you need to provide some kind of auto discovery between the nodes (broadcast, multicast, LLDP, ...) or provide a commonly known discovery service, registration server or similar.
What if there is a switch (L2 device) in between A and B?
That changes nothing but excludes link-level discovery (unless it's a "dumb" switch that simply forwards those frames).
What if there was a router in between (an L3 device)?
That eliminates broadcast and multicast from the picture. (Multicast could be routed but that is unlikely for discovery and I won't dive into that.)

How does Network Address Translation affect computers on the network?

(I’m asking the question here because most of the other similar questions on StackExchange seem to be here — please let me know if there is a more appropriate community).
I have a number of computers on a network with a Linux Server running iptables, which is using Network Address Translation.
Not being an expert, I understand that the role of NAT is to take the internal 198 IP addresses, forward them to the external host under a common external IP address, and, when the response arrives, reverse the process.
If a number of internal machines make requests to the same external host, does this mean that host thinks they’re all coming from the same machine? What implications would that have for security or if the host wants to blacklist a machine?
"The router knows where packets belong because The router saves ... an address translation table. It remembers what inside-outside address translations it has made. As such, one inside address equals one outside address, and the out-on-the-internet destination is irrelevant. This, of course, ignores the firewall present in practically every NAT router, which tracks full connections:"
How NAT Port forwarding works

Weird IP appears on local network

I've logged in to my router's console to check a small internet problem.
And accidently noticed a strange ip connected to the wireless network which is 169.254.70.177 (the rest were all on the 192.168.1.0/24),
I looked that ip up on whois and got nothing, result was that 'this ip is unroutable'.
What does that mean ? and why possibly would be seeing this strange ip on my local network ?
This ip was appearing as connected to the router via wireless network, a few seconds later it appeared as connected via ethernet.
Can someone please explain what could this possibly happen ?
The 169.254.0.0/16 address range is the "zeroconf" range that many devices fall back to when no local address is configured and DHCP fails.
It's a link-local address, meaning that devices can only communicate within the local layer 2 segment. These addresses are not routed.
The device in question is probably set up for DHCP but failing that (filtered, exhausted pool, ...) has fallen back to zeroconf. Another possibility is a stray packet that the device has sent out on the wrong interface.
Using packet capturing, you should be able to find out the device's MAC address and be able to locate it.
The 192.168.X.X Ip's are the ones being assigned by your router, they are private network reserved addresses. The other address you see is probably your router's connection to the WAN

2 routers and want windows to not use a network

Gonna use 'ROUTER ONE' and 'ROUTER TWO', for my examples.
I have two routers, one on wireless one on ethernet. Both have different names. I want windows to just use the internet connection on ROUTER ONE and not use the connection on ROUTER TWO, but I still want to access ROUTER TWO's IP. At the moment to use the network I have to unplug the cable, as I get on the site I want, then the OTHER router takes me too another network saying that the connection is unavailable.
So then, what do I do?
The router names are irrelevant, all that matters is their IP addresses. You can tell a computer which router to use by setting it gateway address to that router's internal IP address. You can do that in the DHCP settings if you want it applied network wide.
As far as accessing both routers it all depends on how your network is set up both physically and its IP scheme. If both routers are on the same physical network and IP scheme you should be able to access them. If they are on the same physical network but on different IP schemes you can assign a second IP address to a computer that is compatible with the second scheme so you will be able to access the second router.

IP Comparison between 2 Locations

can one location have more than 1 IP address? I have 2 IP addresses and need to know if they originate from the same source. Thanks
You're missing clear definitions of "location" and "source" in your question but lets go with the assumption that you mean "physical machine" for both (as it's obvious that multiple machines will have different addresses and that a single machine can change its IP address over time).
In that case, the answer is yes. The operating system may bind as many IP addresses to a physical network port (and a single MAC -- the physical addressing used by Ethernet) as it wishes.
Binding multiple IP addresses was the standard way of doing "virtual web hosting" before HTTP/1.1 arrived with the "Host" header. The provider would use DNS to map different host names to different IPs on the same network (usually the same subnet as well) and then assign all of them to the same interface. The webserver would get address information from an incoming connection and based on the local IP address would know which virtual host was being accessed.
This led to a higher-than-typical use of public IP addresses but the practice is now gone with the proliferation of HTTP/1.1.
I'm not sure how Windows presents it, but Linux will present a physical interface with multiple IP addresses as multiple logical interfaces such as "eth0", "eth0:1", "eth0:2", etc. Each logical interface has a unique IP address even though they share the same physical interface.
This is hard to tell. Especially it is hard to tell if these IP addresses are from different times. Today I may have a different IP address than tomorrow.
Even they are from the same time, a load balancer im my internal equipment might send my packets over the fail-over line if the 1st one is overloaded or broken down.
One network adapter normally has only one IP address at once and a typical end user only has one network connection active, but even then the IP address can change. The user could switch from wireless to wired and back or a power outage might reset the ISP's DHCP server (assigning everyone a new IP address).
If you want to identify the user even if his IP address changes, you need to identify the user by his session id, stored in cookies. As two users can have the same IP address (a whole company could be behind a NAT), you should never rely on IP addresses for identification.

Resources