Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

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.

share|improve this answer
    
Interesting! Thanks! –  Dan the Man Aug 18 '11 at 14:49
    
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 Aug 18 '11 at 15:05
    
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 Aug 18 '11 at 16:39

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.