Everywhere I search some people say 'a computer has a permanent IP address' and some people say 'it doesn't but has only when it is connected to the internet through a router'.

So my understanding is that a computer, since it doesn't have any SIM card, doesn't have any IP address but when it is connected to a router it is assigned a local IP address which changes every time we connect to the router but the IP address of the router/modem is the public IP and doesn't change. We have MAC address which is used only for communicating with other computers through wire and isn't used in the process of getting data packets from the internet through a router.

Pls correct me if I'm wrong.


Actually, both statements are wrong.

It is not correct to say that a computer has an IP address, permanent or not. An IP address is a property of a network interface. But many computers have only one network interface other than loopback, so that is shorthand for saying the network interface on the computer has that address.

A network interface on a computer can have an IP address, permanent or not, whether it is connected to the internet or not. It is possible to have IP networks that are not meant to be connected to the internet, or that are temporarily offline.

SIM cards are not related to this, smartphones have SIM cards, but normally don't have permanent IP addresses.

The local address may be dynamic or static (permanent). The router's public address may be dynamic or static.

MAC addresses are used for LAN and WLAN and belong to layer 2, IP belongs to layer 3. MAC addresses may or may not be used to get packets from the internet to the router. But they are not used to get packets through a router.