Access Point, Bridge, and Switch Testing with CDRouter

Overview

CDRouter is often used to test edge routers and gateways that provide services such as NAT, a firewall, a DHCP server, etc. These devices also route packets between two or more networks, typically a single private network (the LAN) and a single public network (the WAN).

CDRouter can also be used to test devices such as wireless access points (APs) and Ethernet switches that bridge or switch packets between two interfaces rather than route packets between multiple networks.

CDRouter must be configured for routing mode to test any device or network that is routing. To test a device or network that is not routing, such as a wireless access point (AP) or Ethernet switch, CDRouter must be configured for bridge mode.

Enabling Bridge Mode

To enable bridge mode within CDRouter, the forwardingMode must be set to a value of bridge:

testvar forwardingMode bridge

Note that enabling bridge mode implicitly disables or modifies any test cases or functionality that may not compatible with or do not apply to bridging devices.

Test Setup

CDRouter’s connections to the DUT are typically the same whether the DUT is operating in bridge mode or routing mode. CDRouter’s LAN clients connect to the DUT via Ethernet and WiFi, and the DUT’s forwards their traffic through its WAN interface. The DUT’s WAN connection may be directly connected to CDRouter via Ethernet or WiFi, or it may use an intermediate service (eg. DSL, DOCSIS, LTE, GPON, etc.) that eventually maps WAN traffic to an Ethernet connection to reach CDRouter.

LAN Configuration

In bridge mode all IP traffic generated by CDRouter’s LAN clients will be forwarded by the DUT directly to the WAN. As a result, all DHCP requests from CDRouter’s LAN clients will be serviced by CDRouter’s DHCP server on the WAN rather than by the DUT’s DHCP server as is typical for a gateway type of device.

The testvar lanMode determines how CDRouter’s LAN clients will behave with respect to IPv4 address acquisition.

Set this testvar to a value of DHCP to force all of CDRouter’s LAN clients to use DHCP:

testvar lanMode DHCP

To have CDRouter automatically configure all LAN clients with a static IP address instead, set this testvar to a value of static:

testvar lanMode static

Addresses will be assigned by CDRouter from the configured DHCP pool, regardless of which LAN mode is enabled. See the DHCP pool configuration section below for more information.

Likewise, if IPv6 is enabled, the testvar ipv6LanMode determines how CDRouter’s LAN clients will obtain a global IPv6 address. Three modes are supported: DHCP, static, and autoconf.

If autoconf is enabled, CDRouter’s LAN clients will automatically assign addresses based on the prefix in Router Advertisements received from CDRouter’s WAN stack. For DHCP and static modes CDRouter will assign addresses to all LAN clients from the configured DHCPv6 pool.

Wireless LAN Configuration

Please see this Knowledge Base article for more information on how to configure CDRouter’s LAN for wireless.

WAN Configuration

The WAN network is defined by the testvars wanIspIp and wanIspMask, which have the following default values:

testvar wanIspIp            202.254.1.1
testvar wanMask             255.255.255.0

The testvar wanIspIp represents the address of CDRouter’s primary WAN stack, which is the default gateway for the DUT and CDRouter’s LAN client(s) in bridge mode. This is also the address of CDRouter’s WAN DHCP server.

If IPv6 is enabled, the corresponding testvars are ipv6WanIspIp and ipv6WanIspPrefixLen:

testvar ipv6WanIspIp          3001::1
testvar ipv6WanIspPrefixLen   64

DHCP/DHCPv6 Pool Configuration

The testvars dhcpClientStart and dhcpClientEnd define the DHCP pool range. In routing mode these testvars refer to the DUT’s DHCP server pool range on the LAN. However, in bridge mode these testvars are repurposed to define the pool range of CDRouter’s DHCP server on the WAN.

As a result, the constraints for these testvars have been modified in bridge mode to ensure that the DHCP pool resides within the WAN network rather than outside of it.

To satisfy the testvar constraints in bridge mode with an otherwise default config, the DHCP pool must be reconfigured. For example:

testvar dhcpClientStart  202.254.1.100
testvar dhcpClientEnd    202.254.1.200

The DHCPv6 pool is specified using the testvars ipv6DhcpClientStart and ipv6DhcpClientEnd. To satisfy the testvar constraints in bridge mode these testvars must be full IPv6 addresses located within the WAN IPv6 network. For example:

testvar ipv6DhcpClientStart  3001::100
testvar ipv6DhcpClientEnd    3001::1ff

Management Interface Configuration

In bridge mode, the DUT’s management interface address can be provisioned dynamically by CDRouter. If the DUT is configured to obtain an IPv4 management address via DHCP or PPPoE, the wanMode should be set to a value of DHCP or PPPoE, respectively. If the DUT’s management interface is configured with a static IPv4 address, the testvar wanMode should be set to a value of static.

Regardless of how the DUT’s management interface is configured, the testvar wanIspAssignIp must be configured. This testvar specifies the address that is configured on the DUT’s management interface or that CDRouter will assign to the DUT’s management interface via PPPoE or DHCP when a reservation is created. This address must reside within the WAN network.

testvar wanMode             DHCP (or PPPoE or static)
testvar wanIspAssignIp      202.254.1.2

Additionally, if PPPoE is in use the appropriate authentication credentials must be configured. The PPPoE credentials used by CDRouter’s PPPoE server can be configured using the following testvars:

testvar pppoeUser           qacafe
testvar pppoePassword       qacafe123

If the DUT does not have a management interface or does not support IPv4 on its management interface, wanMode should be set to a value of none:

testvar wanMode none

Likewise, CDRouter supports dynamic IPv6 provisioning of the DUT’s management interface via DHCP, PPPoE, and autoconf. Static IPv6 addresses can also be configured.

For DHCP, PPPoE, autoconf, and static modes, the testvars ipv6WanMode and ipv6WanIspAssignIp must be set appropriately. In the case of PPPoE, the ipv6PPPoEAddressMode testvar determines how the IPv6 address will be provisioned over the PPPoE link:

testvar ipv6WanMode             DHCP (or PPPoE or autoconf or static)
testvar ipv6PPPoEAddressMode    DHCP (or autoconf)
testvar ipv6WanIspAssignIp      3001::2

If the DUT does not have a management interface or does not support IPv6 on its management interface, the testvar ipv6WanMode should set to a value of none:

testvar ipv6WanMode none

The configuration file also contains a number of additional WAN configuration options for both IPv4 and IPv6 that can be used to modify CDRouter’s behavior.

DHCP/DHCPv6 Reservation for Management Interface

If the DUT’s management interface is using DHCP and/or DHCPv6 to obtain management addresses, reservations should be created to ensure that the DUT is always assigned the same address(es).

To configure an IPv4 reservation the testvar wanDutClientID should be enabled and configured with the Client Identifier of the DUT’s. If the DUT does not use a Client Identifier (option 61) in its DHCPREQUEST, then this value should be the chaddr field.

CDRouter’s DHCP server will then assign the address specified by the testvar wanIspAssignIp to the DUT’s management interface.

Likewise, to configure an IPv6 reservation the testvar ipv6WanDutDuid should be enabled and configured with the DUID value (in hex) of the DUT’s management interface. CDRouter’s DHCPv6 server will then assign the address specified by the testvar ipv6WanIspAssignIp to the DUT’s management interface.

CDRouter will generate a config error if these reservations are not set in a bridge mode configuration.