Description:

The DHCP option 121 (classless static route) allows network clients to transmit not only information such as the DHCP client address, gateway and DNS server, but additionally one or more static routes that the clients can enter into their local routing table and use.

This document describes how you configure the DHCP option 121 on LANCOM routers.


Requirements:


1) Procedure:

1.1) The DHCP option 121 is configured in the menu IPv4 → DHCPv4 → DHCP options.

Start by clicking on Add.

1.2) Set the following values:

Look on the Internet for online tools for calculating hex values.

Multiple routing entries can be added by entering them in sequence.

Example:
0x10,0x0A,0x00,0xC0,0xA8,0x02,0x01,0x18,0x0A,0x00,0x12,0xAC,0x10,0x05,0x01 
1. Route: Netmask: 255.255.0.0 Network: 10.0.0.0 Gateway: 192.168.2.1
2. Route: Netmask: 255.255.255.0 Network: 10.0.18.0 Gateway: 172.16.5.1










1.3) Save your entries with OK and write the configuration back to the LANCOM router.


2) Function check:

2.1) If DHCP option 121 was configured correctly, a DHCP trace carried out on the LANCOM router will display a correct DHCP acknowledged (DHCPACK) from the DHCP client (marked in green):

[DHCP] 2020/02/13 17:26:24,929 [info] : DHCP Client Rx (LAN, INTRANET)
DHCP Server Message (reply): DHCPACK
  Op    = 02       | HType = 01   | HLen  = 06   | Hops  = 00
  XId   = 4bf7f83a | Secs  = 1e39 | Flags = 0000
  CIAdr = 0.0.0.0          | YIAdr = 172.16.30.224
  SIAdr = 0.0.0.0          | GIAdr = 0.0.0.0
  CHAdr = f4 8e 38 c4 19 9c 00 00 00 00 00 00 00 00 00 00
Message-Type (53):     ack (5)
Server-ID (54):        172.16.30.1
Client-ID (61):        ETH:f4:8e:38:c4:19:9c
Netmask (1):           255.255.255.0
Gateway (3):           172.16.30.1
DNS-Server (6):        172.16.30.1
DNS-Domain (15):       work
Broadcast (28):        172.16.30.255
LeaseTime (51):        30000
Classless Static Route (121):
                       Length: 7
                         10.0.0.0/16-192.168.2.1


2.2) Use the CLI to access the current routing table in the LANCOM router (command: ls /Status/IP-Router/Act.-IP-Routing-Tab.) and you will also find a correct entry there:

ls /Status/IP-Router/Act.-IP-Routing-Tab.

IP-Address        IP-Netmask        Rtg-tag  Next-Hop          Target-Interface            Type(Distance)           Masquerade
=============================================-----------------------------------------------------------------------------------
10.0.0.0          255.255.0.0       0        192.168.2.1       INTRANET                    DHCP (15)                No
127.0.0.0         255.0.0.0         0        0.0.0.0           #Loopback                   Loopback (0)             No
172.16.30.0       255.255.255.0     0        0.0.0.0           INTRANET                    Connected LAN (2)        No
172.16.30.72      255.255.255.255   0        0.0.0.0           #Loopback                   Local LAN (0)            No