What exactly is the difference between 172.0.0.1 and 192.168.0.1? - networking

What's the difference between these 2 local ip addresses? In terms of pro's , con's and usage?

Those a simply two separate IPv4 addresses.
The 172.0.0.1 address is a public address which should not be used unless you have been assigned the address block containing it by an RIR or your ISP (which was assigned the address block containing it).
The 192.168.0.1 address is a private address which anyone may use in a private network. This address cannot be routed on the public Internet.

I suppose you are talking about 172.16.0.0 because it makes no sense to compare 172.0.0.0 with 192.168.0.0 because 172.0.0.0 is a public IP address.
If you are talking about 172.16.0.0 instead of 172.0.0.0, then... both are private IP address. They are defined in the RFC1918
There is a good overview at the Wikipedia page but the main difference is the size of the segment.

The address 172.0.0.1 is not a local address, it is a web address.
If you instead meant 127.0.0.1 this is what is refereed to as the "Loop back" IP, and is often referred to as localhost. Connections to this IP target the computer of origin, and are intercepted by the network card in your computer and fed back into the same computer.
192.168.0.1 is an IP on your local network, this may or may not be your computer. This address is assigned by your DHCP server on your local network (usualy running on the router) and is subject to change unless you have configured your DHCP server to make it static
Which to use?
172.0.0.1 Use when you are trying to connect to a website/remote computer at that IP (most likely not you)
192.168.0.1 Use when you are trying to connect a computer/device on your local network that you know will be at 192.168.0.1
127.0.0.1 or localhost Use when you are trying to connect to a port on the same computer you are already on

Related

local area IP Routing

I am using fiber internet service that company give me a device which assign me local ip like 192.168.0.1 ,2,3 and so on to my computer/ Laptop . but I want to change my local area ip like 172.15.15.1 etc. how to route my Ip
Thanks
Well since the ip is assigned by the service provider they are probably using DHCP server to assign you ip. So you are getting those segment ip's, these are basically private class c ip address. In order to get different range of IP's you can put your intermediate router and configure it to provide private class B IP address.You might need a cross cable to connect both the routers.

Tcp spoofing with a trusted ip

I am facing a very strange problem. I have a task to establish a TCP connection to a server who has a trusted IP. And I have to run the code in a host with private IP address. The trusted IP is 10.10.10.15, which is also a private IP. And the question arises that the IP address of my host and the trusted IP is not on the same network. To be specific, my IP address is 10.0.35.1/24. Please let me know if there is any solution to this problem
Presumably these subnets, i.e. 10.10.10.0/24 (?) and 10.0.35.0/24, are part of your local network. You will need a Layer 3 device to perform inter-VLAN routing.
This will be a router with Layer 3 VLAN interfaces, in the Cisco world they would be SVIs, that would be acting as the default gateway of the subnets in your network. What happens is all traffic that needs to go between two hosts between different networks, has to go through their default gateway and it will be routed to the destination network/VLAN.
As long as the network devices between the two clients are able to route packets between these networks, the hosts will be able to reach each other. In your code, you simply need to specify that these packets need to go to the private IP address of the other host.

where to get address like 10.0.2.0 in android?

I am trying to get IP address of Android Phone and it shows something like 192.168.0.0.But i need some thing like 10.0.2.0.Are both same?.Can anyone tell me what is the difference and How to get that address?
Thank you
Are you using AVD?
The AVD receives its network address and configuration on the private network from a DHCP server that is integrated into Virtual. The address which the virtual Device receives is usually on a completely different network to the host. As more than one card of a virtual device can be set up to use NAT networking, the first card is connected to the private network 10.0.2.0, the second card to the network 10.0.3.0 and so on.
It is highly unlikely that you have an IP with a 0 at the end because they are mostly used as the Network ID, especially with the 192.168.0.0 adress. The 10.0.2.0 and the 192.168.0.0 Adress are both IP Adresses that are in the private Range, so they are not public. I assume that you get your IP via DHCP so it depends on that DHCP Server what IP you will get. In the end of the day it doesn't really matter if you have an 10.0.xx.xx or a 192.168.0.xx Adress. Maybe I could help you a little more if you tell me why you need a 10.0.2.0 adress?
10.0.0.2 is an IP address found on many local computer networks, particularly business networks.Internet Protocol (IP) version 4 defines certain sets of IP addresses as restricted for private use (not available to be assigned to Web servers or other Internet hosts).

Why the IP address on 2 machines on the same router having different subnet?

I have 2 machine. One's IP is 169.254.41.172 and the other is 169.254.72.175. They are both connected to the same router. Why is the 'subnet?' different? I'm referring to the 3rd number between 41 and 72.
These are linklocal addresses, they use 255.255.0.0 as subnet mask, so both addresses are in the same subnet.
These addresses are generated automatically, if you want more control over them you will either need a DHCP server, or configure static IP addresses.
Your router is not acting as a DHCP server it seems.
169.254 is a special range usually for Windows machines when they can't obtain an IP address automatically.
From: http://packetlife.net/blog/2008/sep/24/169-254-0-0-addresses-explained/
Occasionally you may encounter a host which has somehow assigned
itself an IP address in the 169.254.0.0/16 range. This is a
particularly common symptom of Windows machines which have been
configured for DHCP but for whatever reason are unable to contact a
DHCP server. When a host fails to dynamically acquire an address, it
can optionally assign itself a link-local IPv4 address in accordance
with RFC 3927. Microsoft's term for this is Automatic Private Internet
Protocol Addressing (APIPA).
These machines are not getting an IP address. The beginning octets of "169.254" identify these addresses as "link-local".
http://en.wikipedia.org/wiki/Link-local_address
For what it's worth, the addresses are not on different subnets as the full link-local definition is 169.254.0.0/16, or a "Class B" subnet. That being said though, there's no way you'll be getting these computers to communicate any time soon. Is the router powered on, are the cables connected and are there uplink lights on the actual RJ45 jacks on both the router and computers? Is DHCP enabled on the router?

Different values for my IP address?

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

Resources