Home > Tag Archives: CIDR IP range

Tag Archives: CIDR IP range

Get Client Remote Address from ServerExchange in Spring WebFlux and whitelist IP

reactive spring

Below is the Spring WebFlux code to fetch the client Remote Address from the ServerExchange object. Say, we have a scenario wherein we have to check if the API request is coming from the authorized IP address list, in the web filter we will fetch the IP address of the client and will match with the set of given IP’s ... Read More »

Check if IP is in CIDR Range

Java

Java class to find if the given IP is in range of CIDR provided, this utility will help in cases mostly like whitelisting the features in any application. Features like we have to restrict any endpoint from getting called outside of the given CIDR IP range. This is the core java library class, no other jar is required. CIDR (Classless ... Read More »

Convert CIDR notation to IP Range in Java

Java

What is CIDR? CIDR stands for – Classless Inter-Domain Routing (CIDR), also called supernetting. It is a way to allocate Internet Protocol (IP) addresses by creating unique and more granular identifiers for networks and devices. The objective of CIDR was to address scalability issues with classful IP addresses based on three classes –– Class A – capacity is 16,581,375 IP ... Read More »