Exim how to format to catch a list of IPs

Operating System & Version
CenOS 7.9
cPanel & WHM Version
102

martin MHC

Well-Known Member
Sep 14, 2016
317
71
78
UK
cPanel Access Level
Root Administrator
On the Exim ByPass IP addresses for Sender Verify Callout there is an ability to list IPs to be except from the check.

The list states in its documentation:

You can use the following formats:
  • Single IP addresses — Example: 192.168.0.1
  • A range of IP addresses — Example: 192.168.0.0/24
But I don't understand this formatting -- I need to exempt a whole block of IPs that begin with 123.456.***.*** so any IP that starts with 123.456. should be exempted. How can I put this into the IP List in Exim using the above formatting?

Exim Version 4.95


For example;

I need to permit;

123.456.123.45
123.456.987.65
123.456.76.543
...
...
123.456.12.456

How can I construct this rule with one line on the above?
 
Last edited:

martin MHC

Well-Known Member
Sep 14, 2016
317
71
78
UK
cPanel Access Level
Root Administrator
About Slash Notation

Many things use slash notation, also known as CIDR (Classless Inter-Domain Routing) notation, for many purposes, such as policy configuration. You use slash notation differently for IPv4 and IPv6 addresses.

IPv4

Slash notation is a compact way to show or write an IPv4 subnet mask. When you use slash notation, you write the IP address, a forward slash (/), and the subnet mask number.


To find the subnet mask number:

Convert the decimal representation of the subnet mask to a binary representation.
Count each “1” in the subnet mask. The total is the subnet mask number.


For example, to write the IPv4 address 192.168.42.23 with a subnet mask of 255.255.255.0 in slash notation:


Convert the subnet mask to binary.<br>
In this example, the binary representation of 255.255.255.0 is:<Br>
11111111.11111111.11111111.00000000.<Br>
Count each 1 in the subnet mask.<br>
In this example, there are twenty-four (24).<br>
Write the original IP address, a forward slash (/), and then the number from Step 2.<br>
The result is 192.168.42.23/24.<br>
This table shows common network masks and their equivalents in slash notation.

Network Mask Slash Equivalent
255.0.0.0 /8
255.255.0.0 /16
255.255.255.0 /24
255.255.255.128 /25
255.255.255.192 /26
255.255.255.224 /27
255.255.255.240 /28
255.255.255.248 /29
255.255.255.252 /30
255.255.255.254 /31
255.255.255.255 /32