Configuring IP addresses and masks in Ingate Firewall

IP address

IP addresses are written as four groups of numbers with dots between them. The numbers must be between 0 and 255 (inclusive); for example, 192.168.129.17.

Mask/Bits

The binary system uses the numbers 0 and 1 to represent numbers. A binary digit is called a bit. Eight bits in the binary system can represent numbers from 0 to 255.

The mask indicates how much of the IP address is used for the network address and the computers' individual addresses, respecitvely. A mask consists of 8+8+8+8 = 32 bits. Below is a mask with 26 bits set to 1, which means that 26 bits of the IP address is locked to the network address and can't be changed within the network.

Bits11111111111111111111111111000000
No.255255255192

In the Ingate Firewall, a mask is written either as the number of bits that are 1 or as four numbers (0-255) with dots between the numbers.

Sometimes it can be convenient to give a group of computers a network name, such as Administration, or specify that only a handful of computers can change the firewall configuration.

You can form a group of computers with a network name, if the computers have consecutive IP addresses. In order to do this, you must set the mask to indicate that the network group consists of those computers only. The lowest IP address for these computers tells the network number of the group.

This is easiest to explain with a simple example. You have 7 computers that will make up a group called Administration.

Take the nearest power of two above the number of computers you want to include: 2, 4, 8, 16, 32, 64, 128 or 256. Since you have 7 computers, 8 is the nearest. In this example, one IP address is free for future use.

Give the computers consecutive IP addresses. Make the first IP address a multiple of the power of two number you selected, but under 255. In the above example, this means 0, 8, 16, 24, 32, 40, 48 and so on, up to 248. You might choose to start with 136 (17 x 8). This would give the computers the IP addresses 196.176.1.136, 196.176.1.137, 196.176.1.138, 196.176.1.139, 196.176.1.140, 196.176.1.141, 196.176.1.142 and 196.176.1.143.

One of the IP addresses is free and can be used for an eighth computer in the future. You must enter the first IP address in the series, 196.176.1.136, in the Network/IP address field.

Now you must set the mask so that only the computers with these eight IP addresses are included in this network. Take 256 and subtract the number of IP addresses in the named network. In the example, we would have 256-8 = 248. The complete mask is 255.255.255.248.

Now you have created a group of computers (IP addresses) that you can give a single name, such as Administration.

Table of netmasks.

No. of computersMaskBits
1255.255.255.25532
2255.255.255.25431
4255.255.255.25230
8255.255.255.24829
16255.255.255.24028
32255.255.255.22427
64255.255.255.19226
128255.255.255.12825
256255.255.255.024

See appendix G, Lists of reserved ports, ICMP types and codes, and Internet protocols, for more information on netmasks.