We have a requirement to restrict login for users of a specific partner account to a portal by IP addresses. All the other partners should be unaffected. I know I can use SourceIp from User Sessions to restrict it by Apex, but I wonder if it's possible to do with OOTB functionality?
If you can assign the users of this specific partner to a unique profile, then you can use the OOTB profile feature that allows restricting login by IP. Without a profile to use as your decision point, your fallback option is a custom login flow. The Conditional Two–Factor login flow sample provided by Salesforce shows how you can make a decision based on an IP address; here's another example.
Last but not least if your org is licensed for Shield or Event Monitoring you can define transaction security policies. Doing so does require Apex but it's still worth a mention for the sake of completeness. Salesforce docs have a ready-made example that shows IP-based login restriction.