CDRouter Support

How do I configure additional DHCP options in CDRouter?

knowledge-base version 13.5

CDRouter has the capability to simulate both a DHCP server and multiple DHCP clients simultaneously on different physical interfaces within the Linux host PC. On one interface CDRouter may act as a DHCP server, terminating the WAN connection of the device under test (DUT). CDRouter’s DHCP server is used to test the DUT’s DHCP client functionality.

On a second physical interface, CDRouter will act as a DHCP client (or multiple DHCP clients) terminating one or more LAN connections on the DUT. CDRouter’s DHCP client(s) are used to test the DUT’s DHCP server functionality.

Many of the DHCP options defined in RFC 2132 are not included in the default CDRouter configuration file. As a result, the dhcp-c.tcl (client/WAN side) and dhcp-s.tcl (server/LAN side) DHCP test modules include validation of a limited number of DHCP options (only those that are included by default). CDRouter’s DHCP server and client(s) however, may be configured to explicitly request or provide any of the DHCP options defined in IETF RFC 2132.

Overview of CDRouter’s built-in DHCP server functionality

In a typical test setup, CDRouter’s DHCP server communicates directly with the DHCP client on the WAN interface of the DUT. Three testvars control the behavior of CDRouter’s DHCP server (enabled when the testvar wanMode is set to DHCP):

  1. dhcpLeaseTime: defines the duration of the lease provided by CDRouter’s DHCP server to the DUT’s DHCP client
  2. dhcpServerBroadcast: defines whether or not responses to DHCP broadcast packets are sent to the broadcast address 255.255.255.255; when set to no, responses are sent to the unicast address being assigned (note that this behavior will be overridden if the if the flags field of the preceding DHCP message has been set to BROADCAST by the client)
  3. dhcpConnectOnDemand: specifies the behavior of the DUT’s DHCP client; if set to yes the DUT’s DHCP client is configured to connect when traffic is forwarded to one of its LAN interfaces; if set to no the DUT’s DHCP client is configured to connect after reboot

There are also a number of additional testvars that define the IP address-related information assigned by CDRouter’s DHCP server to the DUT’s DHCP client. Specifically:

  1. wanIspAssignIp: defines the IP address assigned by CDRouter to the DUT
  2. wanIspMask: defines the subnet mask assigned by CDRouter to the DUT
  3. wanDomainName: defines the domain name assigned by CDRouter to the DUT
  4. wanDnsServer: defines the primary DNS server assigned by CDRouter to the DUT
  5. wanBackupDnsServer: defines the secondary or backup DNS assigned by CDRouter to the DUT

Configuring CDRouter’s DHCP server for additional DHCP options

CDRouter’s DHCP server can also be configured to provide additional DHCP options to the DUT’s DHCP client. These options are configured using the testvars dhcpServerOptionCode and dhcpServerOptionData. Up to 255 pairs may be specified. The option data must be specified in raw hex format, and should not include the option length, which will be calculated and included automatically by CDRouter.

Example:

The code below configures CDRouter’s DHCP server to provide DHCP options 69 and 70 to the DUT’s DHCP client.

testvar dhcpServerOptionCode1  69
testvar dhcpServerOptionData1  04040404
testvar dhcpServerOptionCode2  70
testvar dhcpServerOptionData2  0404040504040406

Overview of CDRouter’s built-in DHCP client functionality

CDRouter will typically create multiple DHCP clients which communicate directly with the DUT’s DHCP server via one or more LAN interface(s). This is the default behavior for CDRouter on its LAN interface(s) or when lanMode is explicitly set to ‘DHCP’.

*The testvar lanMode was introduced in CDRouter 9.2. For more information on disabling DHCP on the LAN. Please see this Knowledge Base article.*

When DHCP is enabled, the following testvars define the configuration of the DUT’s DHCP server or control the behavior of CDRouter’s DHCP client(s):

  1. dhcpClientTimeout: defines the timeout period (in seconds) of CDRouter’s DHCP client(s)
  2. dhcpInform: defines whether or not the DUT’s DHCP server supports the DHCPINFORM message
  3. dhcpClientStart: the first address in the DHCP address pool configured on the DUT’s DHCP server
  4. dhcpClientEnd: the last address in the DHCP address pool configured on the DUT’s DHCP server; the number of addresses in the DHCP pool determines the number of DHCP clients created by CDRouter for certain tests
  5. dhcpClientExclude: defines addresses that should be excluded from the DUT’s DHCP server address pool (the address pool is defined by the dhcpClientStart and dhcpClientEnd testvars)
  6. dhcpCreateDelay: defines the delay between creation of each CDRouter DHCP client; typically this value is zero, but can be increased to simulate different scenarios
  7. dhcpReleaseDelay: similar to the testvar dhcpCreateDelay; defines the delay between the release of each CDRouter DHCP client
  8. winsServer1: if the DUT is configured to provide a primary WINS server to DHCP clients on the LAN side, this testvar should be configured to match the primary specified WINS server configured on the DUT
  9. winsServer2: if the DUT is configured to provide a secondary/backup WINS server to DHCP clients on the LAN side, this testvar should be configured to match the secondary/backup specified WINS server configured on the DUT
  10. dhcpClientVendorClass: defines the Vendor Class Identifier used by all DHCP clients
  11. DNStoDHCP: specifies the behavior of the DUT’s DHCP server; if set to ‘yes’ the DUT’s DHCP server forwards the DNS information learned on its WAN interface directly to the DHCP clients on its LAN interface(s); if set to no the DUT provides its LAN address as the DNS address for all DHCP clients on its LAN interface(s); if set to no all DNS traffic from the LAN side is forwarded to the DNS server on the WAN side

When a DHCP client is created by CDRouter, the initial DHCPDISCOVER message includes only options 53 (DHCP Message Type), 12 (Host Name), 61 (Client Identifier), and 55 (Parameter Request List). Option 60 (Vendor Class Identifier) may be included if the testvar dhcpClientVendorClass is enabled.

The default Parameter Request List transmitted by CDRouter’s DHCP clients in the initial DHCPDISCOVER message includes only options 1 (Subnet Mask), 2 (Router), 6 (Domain Name Server), and 15 (Domain Name). DHCP options 44 (NetBIOS over TCP/IP Name Server), 45 (NetBIOS over TCP/IP Node Type), and 47 (NetBIOS over TCP/IP Scope) may also be enabled and requested in the initial Parameter Request List if the winsServer1 / winsServer2 testvars are enabled. CDRouter’s dhcp-s.tcl modules validates that all of the above requested values are received.

CDRouter also has the ability to include additional DHCP options, as shown in the next section. Note that additional options not explicitly included in the default configuration will not be validated by CDRouter.

Configuring CDRouter’s DHCP client(s) for additional DHCP options

CDRouter’s DHCP clients can be configured to both provide and request additional DHCP options when communicating with the DUT’s DHCP server. Additional DHCP options may be provided directly or requested from the server using DHCP option 55 (Parameter Request List).

Providing additional DHCP options

CDRouter’s DHCP clients can be configured to provide additional DHCP options when communicating with the DUT’s DHCP server. These options are configured using the testvars dhcpClientOptionCode and dhcpClientOptionData. Up to 10 pairs may be specified. The option data must be specified in raw hex format, and should not include the option length, which will be calculated and included automatically by CDRouter.

Example:

The code below configures CDRouter’s DHCP clients to provide DHCP options 124 and 125.

testvar dhcpClientOptionCode1  124
testvar dhcpClientOptionData1  000000000401020304
testvar dhcpClientOptionCode2  125
testvar dhcpClientOptionData2  000000000401020304

Requesting additional DHCP options in the parameter request list

The testvar dhcpExtraClientParams can be used to request additional DHCP options from the DUT’s DHCP server. These options are communicated to the DUT as additional fields in DHCP option 55 (Parameter Request List).

Example:

The code below configures CDRouter’s DHCP clients to request DHCP options 69 and 70 in the Parameter Request List (option 55).

testvar dhcpExtraClientParams "69 70"

Contents

×

About CDRouter

QA Cafe CDRouter is a comprehensive and powerful test automation solution focused on feature, security, and performance testing for broadband and enterprise edge gateways, Wi-Fi and mesh systems, and other CPE.

Get in touch via our Contact page or by following us on your favorite service: