<< Previous Contents Index Next >>

4. Topology and charging

4.1. Network topology

The ip, group and dynamic statements define the topology of the network.

4.1.1. Defining networks: the ip statement

Networks are defined using the ip statement, which takes the form ip name address ..., where name is the network name and address is the IP address and mask defining the network. Network names are emitted in the output of ipacc, typically used as customer IDs.

Multiple network addresses may be defined in multiple topology groups for a single name.

Addresses can be specified as dotted decimal numbers for a single IP address, or for blocks of IP addresses, in CIDR format (e.g. 192.168.1.0/24) or address/mask format (e.g. 192.168.1.0/255.255.255.0).

When mapping overlapping address ranges, the most specific is always mapped first, e.g. given:

that address 192.168.1.1 will match bar, since it is more specific (32 bits) than the 24 bit foo definition. 192.168.1.2 however will match foo.

Network addresses must be defined within a group.

4.1.2. Defining topology: the group and dynamic statements

Network addresses are grouped using the group name statement. Groups are used to select which areas of the topology to charge.

Groups may be nested, and an IP address in a nested group is considered to be in all the nested groups it is defined within, with the inner one taking priority.

Group blocks are ended with an end group statement.

Note that all IP addresses defined must be within a group.

The group any refers to all IP addresses not otherwise defined, and does not need to be defined.

The dynamic statement is identical to the group statement, except that the IP address ranges within the group define ranges from which dynamic assignments are made. The dynamic statement can take multiple group names; the first is the default, but subsequent ones may be defined in the dynamic IP address data. dynamic blocks can not contain subordinate dynamic or group statements. Dynamic blocks are ended with an end dynamic statement.

See the section on dynamic IP addressing for more information on use of the dynamic statement.


<< Previous Contents Index Next >>