Step 1: Log in to your O365 admin account by using the URL ‘https://portal.office.com’
Step 2: Click the Admin.

Step 3: In the lower-left navigation, select Show All.

Step 4: Under the Admin Centers, click Security admin.

Step 5: In the Microsoft Defender portal, navigate to ‘Email & Collaboration’ and then select ‘Policies & Rules’.

Step 6: Select Threat Policies.

Step 7: Select Anti-Spam Policies.

Step 8: Select the Connection Filter Policy (Default).

Step 9: Click Edit Connection Filter Policy.

Step 10: Under, Always block messages from the following IP addresses or address range, enter the IP address or range to be blacklist.

Step 11: Click Save.
