Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly is the difference between 172.0.0.1 and 192.168.0.1?

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

like image 859
Bierbeest Avatar asked Oct 18 '25 11:10

Bierbeest


2 Answers

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.

like image 126
Álex Sáez Avatar answered Oct 22 '25 06:10

Álex Sáez


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 reffered 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 (usually 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

like image 40
Jesse McDonald Avatar answered Oct 22 '25 07:10

Jesse McDonald