when you connect to the internet you're not really using your imacs ip address you're assinged to one in the range of the top level ip addresses your isp have access to, you can give your imac a static ip or you can renew it from your routers dhcp Renew your IP address from the DHCP server on Mac - Apple Support
but that ip address will only have any meaning on your LAN (local area network) not on the internet
if you wish to alter your ip on the internet then you need to contact your isp some charge you for being allowed to have a fixed ip online.