Does every computer have a public IP address?

4

1

Does every computer have a public IP address? Or does a computer only have a private IP and the internet router that the computer is connected to has the public IP?

Daniel says Reinstate Monica

Posted 2011-08-18T14:19:15.883

Reputation: 393

Answers

9

This depends entirely on the setup of the network.

It is common in most locations to give one IP Address to a router that sits on the edge of the network, and then all the computers behind the router have private IP addresses. When any of the machines require a connection to the internet, they share the same single IP address.

If the machines need to host any services, typically on the router, you enable port forwarding which will send that information on to a specific computer. This technology is known as NAT (Network Address Translation).

All this being said, in environments where there are a lot of servers or services being hosted, it isn't uncommon to directly forward an IP address to a server. In these situations, a router simply routes all traffic on an IP address to a target machine.

It isn't too uncommon to see large offices that have a few public facing servers to have a small block of IP addresses and route each one to a server and then have one forwarded to another router which provides NAT to all regular devices that do not require their own IP.

There is no one rule fits all. A single IP to a NAT router is by far the most common scenario, but, it can be anything.

William Hilsum

Posted 2011-08-18T14:19:15.883

Reputation: 111 572

There are also many setups where a large routed block (ie a /25) is handed to a company and the company will route that block to use with all their desktops. In cases like this, all of the public IPs can still be firewalled and can be handed out with DHCP, but there is no NAT. This is not the standard anymore, but it still does happen. – MaQleod – 2011-08-18T15:05:49.477

Some smaller ISP's do issue private IP addresses rather than public, I had to pay extra for a public IP address from one of my providers a few years ago. – Moab – 2011-08-18T16:39:33.863

1

In ipv4 the latter is typical, called "nat". In ipv6 the former is typical (due to the vast numbers of public addresses).

So really, it depends which version of ip you mean. IPv4 is the one in widespread usage currently.

Sirex

Posted 2011-08-18T14:19:15.883

Reputation: 10 321

0

Only your router has a public IP, to get any traffic from the outside world to a particular PC you have to forward a port to the appropriate private IP, or at least that's the case for most small/home networks.

Col

Posted 2011-08-18T14:19:15.883

Reputation: 6 995