If you mean for SharePoint Online, follow the instructions here: https://learn.microsoft.com/en-us/sharepoint/control-access-based-on-network-location#set-a-location-based-policy-in-the-new-sharepoint-admin-center
Limit access based on user ip
lilyvalley-8419
140
Reputation points
How can I limit user access to SharePoint sites by their ip address?