For blocking it only for specific IP addresses:
- Create an IP range location first by going to Conditional Access > Named Locations > click on +IP ranges location.
- Provide the Name of the location and under that add all the IPs you want to Allow.
Now, Create a Conditional Access Policy on the Entra admin center to apply that kind of block.
- Sign in to Entra.microsoft.com
- On the left-hand side find Protection > Conditional Access.
- Create a new Conditional access policy.
- Under Target Resources, click on Select Apps and Select Microsoft Admin Portals. (Please note that this will also block other admin portals as well like Exchange Online, Intune admin center, etc.)
- Under Conditions > Locations > Toggle Configure to Yes > Under Exclude Selected locations > Select that Named location created earlier.
- Under Grant Control, Select Block Access.
Hope the above information can help
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".