Sometimes instead of the real customer IP address, you can see 127.0.0.1 or some other wrong customer IP in your Magento 2 Admin panel. It can be due to proxies, like Varnish, Cloudflare, Sucuri.net, that may be enabled for your Magento 2 store.

To solve the wrong IP address issue you need to:

1. Create a new file in M2 directory:

app/etc/XIP/di.xml

2. Paste the code:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
<arguments>
<argument name="alternativeHeaders" xsi:type="array">
<item name="x-client-ip" xsi:type="string">HTTP_X_REAL_IP</item>
                <item name="x-cf-connecting-ip" xsi:type="string">HTTP_CF_CONNECTING_IP</item>
                <!-- <item name="x-cf-mfcustom-ip" xsi:type="string">SOME_CUSTOM_SERVER_KEY</item> -->
</argument>
</arguments>
</type>
</config>

3. Save the file, and run dependency injection compilation, use CLI command:

php bin/magento setup:di:compile

4. If this does not help, then you need to use other values instead of "SOME_CUSTOM_SERVER_KEY" and uncomment line. To get a proper value you need to create test.php file in your Magento folder with the code:

<?php
echo '<pre>';
var_dump($_SERVER);

and execute this script in a browser (URL: https://mydomain.com/test.php). The purpose is to define the right key, that stores customer IP, you need to look for your IP.