Files
infix/test/case/dhcp/client_routes

=== DHCP Option 121 vs Option 3

ifdef::topdoc[:imagesdir: {topdoc}../../test/case/dhcp/client_routes]

==== Description

Verify that DHCP option 121 (classless static routes) is used over the
older option 3 (default gateway) in the DHCP client, when both are sent
by the server, see RFC3442.  Use the routing RIB in the operational
datastore to verify.

Installing routes from a DHCP server should not affect already existing
(static) routes.  To verify this, a static canary route (20.0.0.0/24 via
192.168.0.2) is installed before starting the DHCP client.  As a twist,
this canary route has a next-hop (192.168.0.2) which is not reachable
until a DHCP lease has been acquired.

The DHCP server is set up to hand out both a default router (option 3)
via 192.168.0.1 and a default route (option 121) via 192.168.0.254.

==== Topology

image::topology.svg[DHCP Option 121 vs Option 3 topology, align=center, scaledwidth=75%]

==== Sequence

. Setting up canary route, 20.0.0.0/24 via 192.168.0.2
. Enabling DHCP client, allow option 3 and 121
. Verify client has route 10.0.0.0/24 via 192.168.0.254 (option 121)
. Verify client has default route via 192.168.0.254 (not use option 3)
. Verify client still has canary route to 20.0.0.0/24 via 192.168.0.2