How the Public IP is assigned when we connect to the Internet

Guide to understand how different devices connect to the internet and how public and private IP addresses are assigned

How we connect to the Internet
Like most people around the world, we all connect to the Internet using a public IP address (Internet Protocol or TCP/IP), which is provided to all network devices via a modem or router (which use IPs instead interiors to regulate traffic).

If your ISP were to assign a unique public IP address for every device in your home that connects to the internet, you would need an additional free address every time you buy a new computer, tablet, smartphone, game console, or anything else. which of course is impossible.

In the following guide we will show you how an IP is assigned when we connect to the Internetshowing you the various differences between providers, between the devices we use to connect and what are the differences with the IP addresses assigned by the router or modem.

READ ALSO -> Find the IP address of a computer or smartphone

1) Internet connection from your phone

When we connect to the Internet with the cellular data network (both 4G and 5G) the phone receives a public IP address freely assigned by the operator: it is in fact our gateway to the Internet and, for as long as we stay connected to the Internet, makes our mobile device reachable at that address.

Many operators try to reduce the number of IPs assigned to mobile devices by operating with a “NAT network”: the phones are connected to a single internal network which in turn use a single network device (a router of the provider called Gateway), so as to exploit a single public IP for hundreds or thousands of different devices.

This NAT is the reason why mobile devices are often not accessible directly from the Internet, since they are masked in a NAT network that is not remotely accessible via IP address (we can obviously use remote control programs that operate on different protocols, such as for example TeamViewer).

To quickly change the public IP on your phone, simply turn on airplane mode for 2 minutes and turn it off: the next time you reconnect we will get a new public IP addresstotally different from the one previously assigned.

2) Internet connection from home network

The devices connected to our modem or home router (connected via Wi-Fi or via Ethernet cable) actually receive two IPs: the private IP address and the public IP address.

The private IP address is managed directly by the modem or router (via DHCP) and allows devices to see each other within the same home network, as well as ensuring that no device receives an IP equal to that of another device (conflict issue that can make it impossible to navigate).

All network devices get the same public IP address from the modemwhich also works in this case from Gateway: it communicates with the Internet provider with the connection cable (optical fiber or telephone cable) and receives a single public IP addresswhich is sorted and managed on all PCs, phones and tablets connected via Wi-Fi, Smart TVs and all connected home automation devices.

Since in the vast majority of cases the provider will assign us public IP addresses randomly, the best way to Quickly change IP address plan to turn off the modem for two minutes and reconnect it.

3) Internet connection from public network (hotspot)

If we are connected to a public network we will get a public IP and a private IP exactly as seen on home modems, with the difference that the connected devices cannot see each other (for security reasons).

This security can be obtained both by acting on the hotspot settings (the connection provider must proceed) and by setting Windows to recognize the new network as a public network, thus avoiding providing access to shared folders and files; to learn more we can read our article on how to setup network in windows 10 and 11.

On the security of hotspots we can read the guide on How to surf safe on public Wi-Fi network.

4) Special case: the Fastweb NAT network

Users who have a landline contract with Fastweb can run into a “nattata” network problem, just as if they were on a mobile network: many users are connected to an internal NAT network and “exit” to the Internet from a single hidden Gateway, which prevents the doors from opening and the use of a private server.

This does not affect browsing on Internet sites and social networks but, if we have a personal server or a NAS to keep datawe will have to ask the switch to a public and static IP on Fastwebas we will see in the final chapter of the guide.

5) How to get public and static IP address

If we have a contract with Fastweb or have personal servers, a NAS with our data or a data disk connected to the modem we can access it only if we have a static public IP address: if it changes at each restart or shutdown of the modem we will totally lose access.

Fastweb users they can fix the problem asking the operator for a public and static IP address for freeas seen in our articles on Fastweb port mapping come on how to ask Fastweb for a static IP address.

All users of other providers can get a personal address synchronized with the assigned IP address using a service such as NO-IPwhich also provides a client (to be installed on a PC) to always provide the new IP to our access domain.

For more information, we recommend that you read our article on how to get a static ip with TIM or other connections.


Unfortunately, when the Internet was created, it had not been imagined for so many connected devices and it is only thanks to home routers and NAT technologies that today we can connect with so many devices without having to migrate en masse to IPv6 internet protocolwhich is however catching on and is increasingly used for both home and business connections.

Always on the subject of IP addresses and network connections we can read our guides on how to release and renew IP address on PC, Mac and mobiles come on how to fix connection problems between PCs.

Leave a Reply

Your email address will not be published. Required fields are marked *