If you want to get the IP addresses then use
Magento 2 GeoIP Plugin. You first need to install and configure the plugin in your Magento 2 store. Once the plugin is set up, it will automatically capture the IP addresses of visitors accessing your website. You can then access this information through the plugin's interface or by querying the plugin's database directly.