35.3. DHCP Server Mode

A DHCP server is an Internet host that returns configuration parameters to DHCP clients.

[09:56:36] ABILIS_CPX:s dhcp lan:1 mode:server

COMMAND EXECUTED

[09:56:45] ABILIS_CPX:d dhcp lan:1

- Not Saved (SAVE CONF), Not Refreshed (INIT) ---------------------------------
Parameter:   | Value:
-------------+-----------------------------------------------------------------
LAN:           1
NAME:          
NET:           192.168.029.000/24
MASK:          255.255.255.000
MAC-FILTER:    #
MODE:          SERVER
POOL1:         192.168.029.008:192.168.029.130
POOL2:         #              
POOL3:         #              
POOL4:         #              
POOL5:         #              
PROF:          1
DEF-LEASE:     36000
MAX-LEASE:     36000
ARPCHK:        YES
-------------------------------------------------------------------------------
[Caution]Caution

To activate the changes made on the lowercase parameters a save conf and an Abilis restart are required (i.e. With warm start command).

35.3.1. DHCP Server tables

The configuration of DHCP server mode is based on three tables:

  • DHCP Profiles table: table containing all the parameters to be distributed to clients (i.e. IP Address, Gateway, WINS, DSN, Domain, etc.);

  • DHCP Subnets: table containing the network IP address of the DHCP subnet, the subnet mask, the pools of addresses to distribute and the “lease” time of the IP addresses;

  • DHCP Hosts: allows to define a static association between a specific MAC-ADDRESS of a client and an IP address.

35.3.1.1. DHCP Profiles table

The DHCP Profiles table can hold up to 129 definitions, indexed from 0 up to 128.

The user can arbitrarily add/delete the definitions from the index 1 to 128. The profile with index 0 can't be deleted because it's a default profile.

Changes made on the table can be activated by executing the initialization command init res:dhcp.

The commands for the DHCP Profiles table management are:

  • d dhcp prof:xxx[,yyy,...] : display DHCP profile;

  • a dhcp prof:xxx [par:val] : add DHCP profile;

  • c dhcp prof:xxx[,yyy,...] :clears DHCP profile;

  • s dhcp prof:xxx[,yyy,...] par:val [par:val]: set DHCP profile parameters.

A complete list of available configuration parameters is available by typing d dhcp prof: ?.

[09:24:57] ABILIS_CPX:d dhcp prof: ?

D DHCP PROF:xxx[,yyy,...]        Display DHCP profile [0..128, A]

DHCP Profile parameter(s):

NAME:      Profile name.
           Max 32 ASCII characters. Space not allowed.
TTL:       IP time-to-live [0, 1..255]
KEEPALIVE: TCP keepalive interval [0, 15..65535 s]
NB-SCOPE-ID: Netbios scope identifier.
           Max 32 ASCII characters. Space not allowed.
NB-NODE-TYPE: Netbios node type [UNK, B, P, M, H]
DOMAIN:    IP domain name.
           Max 32 ASCII characters. Space not allowed.
GW1:       First gateway [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1, 128-223.x.x.x]
           or IP resource [Ip-1..Ip-250]
GW2:       Second (backup) gateway [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
GW3:       Third (backup) gateway [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
DNS1:      Primary Domain Name server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
DNS2:      Secondary Domain Name server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
SMTP:      Simple Mail Transport Protocol (SMTP) server [# or 0.0.0.0,
           1-126.x.x.x, 127.0.0.1, 128-223.x.x.x] or IP resource [Ip-1..Ip-250]
POP3:      Post Office Protocol (POP3) server [# or 0.0.0.0, 1-126.x.x.x,
           127.0.0.1, 128-223.x.x.x] or IP resource [Ip-1..Ip-250]
NNTP:      Network News Transport Protocol (NNTP) server [# or 0.0.0.0,
           1-126.x.x.x, 127.0.0.1, 128-223.x.x.x] or IP resource [Ip-1..Ip-250]
WWW:       World Wide Web (WWW) server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
FINGER:    Finger server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1, 128-223.x.x.x]
           or IP resource [Ip-1..Ip-250]
IRC:       Internet Relay Chat server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
NTP:       NTP/SNTP server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
TIME:      TIME server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1, 128-223.x.x.x]
           or IP resource [Ip-1..Ip-250]
WINS1:     First WINS server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
WINS2:     Second WINS server [# or 0.0.0.0, 1-126.x.x.x, 127.0.0.1,
           128-223.x.x.x] or IP resource [Ip-1..Ip-250]
TFTP:      TFTP server name.
           Max 64 ASCII characters. Space not allowed.
BOOTFILE:  Bootfile name.
           Max 128 ASCII characters. Space not allowed.

35.3.1.2. DHCP Subnets table

The DHCP Subnets table can hold up to 128 definitions.

Changes made on the table can be activated by executing the initialization command init res:dhcp.

The commands for the DHCP Subnets table management are:

  • d dhcp lan:xxx[,yyy,...] : display DHCP subnet;

  • a dhcp lan:xxx [par:val] : add DHCP subnet;

  • c dhcp lan:xxx[,yyy,...] :clears DHCP subnet;

  • s dhcp lan:xxx[,yyy,...] par:val [par:val]: set DHCP subnet parameters.

A complete list of available configuration parameters is available by typing d dhcp lan: ?.

[09:27:06] ABILIS_CPX:d dhcp lan:1

Parameter:   | Value:
-------------+-----------------------------------------------------------------
LAN:           1
NAME:          
NET:           192.168.029.000/24
MASK:          255.255.255.000
MAC-FILTER:    #
MODE:          SERVER
POOL1:         192.168.029.008:192.168.029.130
POOL2:         #              
POOL3:         #              
POOL4:         #              
POOL5:         #              
PROF:          1
DEF-LEASE:     36000
MAX-LEASE:     36000
ARPCHK:        YES
-------------------------------------------------------------------------------

The most important parameters:

MODE

Select SERVER or RELAY service for this lan [SERVER, RELAY].

NET

Network address in DDN or network address and mask in Slash Notation [0.0.0.0, 1-126.x.x.x, 127.0.0.1, 128-223.x.x.x]/[0..32] or IP resource [Ip-1..Ip-999].

MASK

Network mask in DDN [0.0.0.0, 128.0.0.0-255.255.255.252]. <Only if NET: is not equal to an IP resource>

MAC-FILTER

Enables/disables the selection of serviceable clients based on their MAC address. When it is set to YES, MAC filtering is enabled. When DHCP receives an incoming request and before processing it, the DHCP verifies that the sender's MAC address is allowed by using MAC-LIST and MAC-RULE parameters current setting (MAC-LIST and MAC-RULE appear when MAC-FILTER is set to YES).

Parameters for mode:RELAY only:

SERVER

DHCP Server to which requests must be forwarded: IP address or IP list name [#, ListName, 1-126.x.x.x, 127.0.0.1, 128-223.x.x.x].

MAX-HOPS

Maximum allowed DHCP Relay Agent hops in forwarded requests [1..16].

LOCIPADD

Source IP address used for the requests relayed to the server(s) [R-ID, OUT-IP, 1-126.x.x.x, 127.0.0.1, 128-223.x.x.x].

Parameters for mode:SERVER only:

POOL1..5

Enables ICMP checking of IP address. When it is set to YES, ICMP checking is enabled. Before sending the DHCPOFFER message, the server sends two ICMP ping requests to check the IP address which was allocated. If both timeouts expire, the server will send the DHCP offer message, otherwise it will mark this IP address as abandoned and will not send response.

PROF

Profile [NONE, 1..128].

DEF-LEASE

Default lease time of the IP address [60..1000000 s]

MAX-LEASE

Maximum lease time of the IP address [60..1000000 s]

ARPCHK

Enable/disable ARP check before assigning an IP address [NO, YES]. When it is set to YES, ARP checking is enabled. Before sending the DHCPOFFER message, the server sends two ARP requests to check the IP address which was allocated. If both timeouts expire, the server will send the DHCP offer message, otherwise it will mark this IP address as abandoned and will not send response.

35.3.1.3. DHCP Hosts table

The DHCP Hosts table can hold up to 500 definitions, indexed from 1 up to 500.

Changes made on the table can be activated by executing the initialization command init res:dhcp.

The commands for the DHCP Hosts table management are:

  • d dhcp host:xxx[,yyy,...] : display DHCP host;

  • a dhcp host:xxx [par:val] : add DHCP host;

  • c dhcp host:xxx[,yyy,...] :clears DHCP host;

  • s dhcp host:xxx[,yyy,...] par:val [par:val]: set DHCP host parameters.

A complete list of available configuration parameters is available by typing d dhcp host: ?

[09:27:33] ABILIS_CPX:d dhcp host: ?

D DHCP HOST:xx                   Display DHCP host [1..500, A]

DHCP Host parameter(s):

MAC:       MAC address [00-00-00-00-00-01..FF-FF-FF-FF-FF-FF]
IP:        IP address [0.0.0.0, 1-126.x.x.x, 127.0.0.1, 128-223.x.x.x]
PROF:      Profile [LAN, 1..128]
NAME:      Host name. From 0 up to 32 ASCII characters.
           Spaces are not allowed. Case is preserved.

35.3.2. Example of configuration of DHCP in Server mode

In this example the DHCP Server is configured to distribute the following parameters:

  • Network address: 192.168.0.0/24

  • IP pool of addresses: from 192.168.0.131 to 192.168.0.179

  • DNS server 1:192.168.0.232

  • DNS server 2:192.168.0.251

  • Default Gateway: 192.168.0.232

  • WINS server: 192.168.0.50

  • SMTP server: 192.168.0.250

  • POP3 server: 192.168.0.250

  • No static association between MAC-ADDRESS and any leased IP

  • ICMP checking of IP address

  • No MAC Filtering

First, set the DHCP resource active.

[15:20:37] ABILIS_CPX:s p dhcp act:yes

COMMAND EXECUTED

[15:40:56] ABILIS_CPX:d p dhcp

RES:Dhcp - Not Saved (SAVE CONF), Not Refreshed (INIT) ------------------------
       ------------------------------------------------------------------------
       DESCR:Dynamic_Host_Configuration_Protocol
       LOG:DS           ACT:YES       srv-udp-locport:67   cli-udp-locport:68
       msg-len:1472     TOS:0-N
       WDIR:C:\APP\DHCP\
       - Server ---------------------------------------------------------------
       max-clients:300      

Configure the DHCP Profiles table.

[15:54:54] ABILIS_CPX:a dhcp prof:1 name:Private_LAN gw1:192.168.0.232 dns1:192.168.0.232 dns2:192.168.0.251 smtp:192.168.0.250 pop3:192.168.0.250 wins1:192.168.0.50

COMMAND EXECUTED

[15:55:11] ABILIS_CPX:d dhcp prof

- Not Saved (SAVE CONF), Not Refreshed (INIT) ---------------------------------

PROF: |NAME:
-------------------------------------------------------------------------------
  0    Default_profile
  1    Private_LAN

[15:55:27] ABILIS_CPX:d dhcp prof:1

- Not Saved (SAVE CONF), Not Refreshed (INIT) ---------------------------------

Parameter:   | Value:
-------------+-----------------------------------------------------------------
PROF:          1
NAME:          Private_LAN
TTL:           0
KEEPALIVE:     0
NB-SCOPE-ID:   
NB-NODE-TYPE:  UNK
DOMAIN:        
GW1:           192.168.000.232
GW2:           #              
GW3:           #              
DNS1:          192.168.000.232
DNS2:          192.168.000.251
SMTP:          192.168.000.250
POP3:          192.168.000.250
NNTP:          #              
WWW:           #              
FINGER:        #              
IRC:           #              
NTP:           #              
TIME:          #              
WINS1:         192.168.000.050
WINS2:         #              
TFTP:          
BOOTFILE:      
-------------------------------------------------------------------------------

Configure the DHCP Subnets table setting the network address, the pool and the identifier of DHCP Profile.

[16:02:17] ABILIS_CPX:a dhcp lan:1 mode:server name:Private_Lan net:192.168.0.0/24 pool1:192.168.0.131:192.168.0.179 prof:1 

COMMAND EXECUTED

[16:03:22] ABILIS_CPX:d dhcp lan

- Not Saved (SAVE CONF), Not Refreshed (INIT) ---------------------------------

LAN: |NET:            |MASK:
-------------------------------------------------------------------------------
  1   192.168.000.000  255.255.255.000

[16:03:26] ABILIS_CPX:d dhcp lan:1

- Not Saved (SAVE CONF), Not Refreshed (INIT) ---------------------------------

Parameter:   | Value:
-------------+-----------------------------------------------------------------
LAN:           1
NAME:          Private_Lan
NET:           192.168.000.000/24
MASK:          255.255.255.000
MAC-FILTER:    #
MODE:          SERVER
POOL1:         192.168.000.131:192.168.000.179
POOL2:         #              
POOL3:         #              
POOL4:         #              
POOL5:         #              
PROF:          1
DEF-LEASE:     36000
MAX-LEASE:     36000
ARPCHK:        YES
-------------------------------------------------------------------------------

Configuration of DHCP Hosts table isn't required.

Now the configuration is complete.

[Caution]Caution

To initialize the resource, use command init res:dhcp (to set act the changes made on uppercase parameters and in the tables) and save the configuration with save conf command to make the changes permanent.

[Caution]Caution

To set act changes made on lowercase parameters a save conf and an Abilis restart are needed (i.e. With warm start command).

35.3.3. DHCP bindings table

The DHCP bindings table is the memory database which stores bindings allocated for DHCP clients.

A binding record includes the information about the allocated IP address, the start time and the end time of lease, the profile which is currently used by a DHCP client and some other information.

The Table of DHCP bindings is used in server mode only.

[Tip]Tip

Refer to Section 35.3.3.1, “Appendix - how DHCP bindings table works” to have more information about DHCP bindings tables functioning.

Commands for handling DHCP bindings table are:

  • d dhcp bind: it displays DHCP bindings summary;

  • d dhcp binde: it display DHCP bindings detailst;

  • c dhcp bind: this command allows to remove a DHCP binding entry from the DHCP bindings table identified by the specified IP address.

Some examples follow.

[11:34:14] ABILIS_CPX:d dhcp bind

------------------+----------------+------+-----------------+------------------
MAC:              |IP:             |PROF: |Last request(UTC)|Expiry on(UTC)
------------------+----------------+------+-----------------+------------------
A0-F3-C1-C8-5B-0B  192.168.020.050      1  04/06/2015 16:49  07/02/2036 06:28
20-C9-D0-96-05-A1  192.168.020.102      1  09/06/2015 06:30  09/06/2015 16:30
00-19-99-52-CB-A0  192.168.020.104      1  09/06/2015 05:09  09/06/2015 15:09
08-00-27-16-7D-01  192.168.020.107      1  09/06/2015 05:21  09/06/2015 15:21
C4-6E-1F-19-E0-4D  192.168.020.118      1  09/06/2015 07:01  09/06/2015 17:01

[11:34:21] ABILIS_CPX:d dhcp binde

----+-----+-------------------+-----------------+-------+----------------------
 O: | ST: | MAC:              | IP:             | PROF: | Last request(UTC)
                                                        | Expiry on(UTC)
----+-----+-------------------+-----------------+-------+----------------------
  H   ACT   A0-F3-C1-C8-5B-0B   192.168.020.050       1   04/06/2015 16:49:15
                                                          07/02/2036 06:28:15
-------------------------------------------------------------------------------
  P   INV   38-0B-40-C6-82-53   192.168.020.071       1   31/03/2015 13:33:41
                                                          31/03/2015 23:33:41
-------------------------------------------------------------------------------
  P   EXP   00-26-E8-7B-31-7F   192.168.020.100       1   01/06/2015 09:27:07
                                                          01/06/2015 19:27:07
-------------------------------------------------------------------------------
  P   EXP   34-31-11-DF-46-79   192.168.020.101       1   05/06/2015 08:21:55
                                                          05/06/2015 18:21:55
-------------------------------------------------------------------------------
  P   ACT   20-C9-D0-96-05-A1   192.168.020.102       1   09/06/2015 06:30:52
                                                          09/06/2015 16:30:52
-------------------------------------------------------------------------------
  P   EXP   18-20-32-A0-B7-3B   192.168.020.103       1   01/06/2015 09:27:12
                                                          01/06/2015 19:27:12
-------------------------------------------------------------------------------
  P   ACT   00-19-99-52-CB-A0   192.168.020.104       1   09/06/2015 05:09:09
                                                          09/06/2015 15:09:09
-------------------------------------------------------------------------------
  P   EXP   14-7D-C5-3B-CB-16   192.168.020.105       1   25/05/2015 11:42:53
                                                          25/05/2015 21:42:53
-------------------------------------------------------------------------------
  P   EXP   38-0B-40-C6-82-53   192.168.020.106       1   05/06/2015 08:23:37
                                                          05/06/2015 18:23:37
-------------------------------------------------------------------------------
  P   ACT   08-00-27-16-7D-01   192.168.020.107       1   09/06/2015 05:21:24
                                                          09/06/2015 15:21:24
-------------------------------------------------------------------------------
  P   EXP   00-0C-E7-A2-98-E2   192.168.020.108       1   08/06/2015 14:36:38
                                                          09/06/2015 00:36:38
-------------------------------------------------------------------------------
  P   EXP   E4-D5-3D-84-ED-98   192.168.020.109       1   09/04/2015 12:05:28
                                                          09/04/2015 22:05:28
-------------------------------------------------------------------------------
  P   EXP   84-7A-88-B0-1A-A8   192.168.020.110       1   28/05/2015 07:25:08
                                                          28/05/2015 17:25:08
-------------------------------------------------------------------------------
  P   EXP   74-2F-68-76-1E-2B   192.168.020.111       1   21/05/2015 13:33:20
                                                          21/05/2015 23:33:20
-------------------------------------------------------------------------------
  P   EXP   5C-FF-35-2C-12-E2   192.168.020.112       1   21/05/2015 12:49:34
                                                          21/05/2015 22:49:34
-------------------------------------------------------------------------------
  P   REL   C4-6E-1F-19-E0-E2   192.168.020.117       1   08/06/2015 09:04:36
                                                          08/06/2015 09:05:32
-------------------------------------------------------------------------------
  P   ACT   C4-6E-1F-19-E0-4D   192.168.020.118       1   09/06/2015 07:01:23
                                                          09/06/2015 17:01:23
------------------------------------------------------------------------------

Meaning of the most important parameters:

O

Origin of the binding [H: allocated from host tables; P: allocated from IP pools of one of subnets from subnets table;].

ST

State of the binding [REL: released; ACT:active, EXP: expired, AB: abandoned, INC: incomplete, INV: invalid].

MAC

The binded MAC address of the DHCP client.

IP

The IP address assigned to the DHCP client with the MAC address.

PROF

The identifier of DHCP profile from profiles table.

Last request(GMT)

The GMT date and time value when the lease was assigned/renewed the last time.

Expiry on(GMT)

The GMT date and time value when the lease will expire.

Here are few samples of bindings clear commands:

[15:00:45] ABILIS_CPX:c dhcp bind ip:192.168.0.161

YOU ARE GOING TO DELETE THE SPECIFIED DHCP BINDING ENTRY FROM THE DATA BASE IN MEMORY.
DO YOU WANT TO PROCEES (Y/N)? Y

COMMAND EXECUTED
[15:00:45] ABILIS_CPX:c dhcp bind ip:a

YOU ARE GOING TO DELETE THE WHOLE CONTENT OF THE DHCP BINDINGS DATA BASE IN MEMORY.
DO YOU WANT TO PROCEES (Y/N)? Y

COMMAND EXECUTED

35.3.3.1. Appendix - how DHCP bindings table works

DHCP bindings table is stored in the DHCP.BND file in the location defined by the WDIR parameter.

It allows storage of up to max-clients bindings, one per each record.

Every one minute the DHCP server checks the bindings table and saves all bindings to the file, if the table was changed since the last time it was updated.

During Abilis CPX DHCP resource start-up, the DHCP driver executes the following operations:

  • If the file DHCP.BND exists:

    • Reads the bindings table from the CF;

    • Updates the file, making a write operation try;

      • Writing attempt successful: the DHCP server goes to the ACTIVE state;

      • Writing attempt unsuccessful: the DHCP server goes to the STOP state; it writes a warning message into the System Log (i.e. “W: DHCP STOPPED”) and it doesn't load the bindings DHCP.BND file content.

  • If the file doesn't exist:

    • It tries to create it. If it can't, the server goes to the STOP state and it writes a warning message into the System Log (i.e. “W: DHCP STOPPED”).

After loading the DHCP.BND file, the DHCP server checks the bindings according to the current configuration of the DHCP driver. The records which don't conform to the current configuration will be marked as “not valid” and they will not be used by the DHCP server.

The DHCP server makes the next checks when loading bindings and marks the binding as “invalid” in all the following cases:

  • The subnet record which is corresponding to the IP address from the binding isn't found in the subnets table.

  • The profile identifier from the binding isn't found in the profiles table.

If the binding is static (i.e. Allocated from the hosts):

  • The host record with the IP and MAC addresses which are corresponding to the IP and MAC addresses from the loading binding isn't found in the hosts table.

  • The IP address from the binding is found in one of the pools of the subnet record (i.e. If the corresponding subnet record was found).

if the binding is dynamic (i.e. Allocated from the pools):

  • The host record with the IP and MAC addresses which are corresponding to the IP and MAC addresses from the loading binding is found in the hosts table;

  • The IP address from the binding isn't found in one of the pools of the subnet record (i.e. If the corresponding subnet record was found).