Cfengine configuration directory

Unusual subnet masks and defaultroute

Relevant classes: any

For many of us, the most common netmask is 255.255.255.0. This means that the last byte of an IP address is the host number and the first three are a network plus possible subnet. Then the default route for the network is usually address number 1, i.e. the router/gateway.

Some sites group neighbouring IP series into larger or smaller subnets however, then it is not as straightforward to find address nnumber 1 on each subnet. For instance, in the example below, we use a different subnet mask to combined the IP numbers 128.39.74 and 128.38.75 into a single subnet. It would be wrong to configure hosts with addresses 128.39.75 with default route 128.38.75.1, since that is not the first address on that subnet anymore. The first address is 128.39.74.1. Here's how we get around this problem.


control:

   128_39_89::

     netmask = ( 255.255.254.0 )

   128_39_74|128_39_75:: 

     netmask = ( 255.255.255.0 )

defaultroute:

   128_39_74|128_39_75::   # netmask 255.255.254.0

      128.39.74.1

   128_39_89::             # netmask 255.255.255.0

      128.39.89.1

Back to documentation