IP DHCP Smart-Relay

Table 1. Feature History

Feature Name

Release Information

Feature Description

IP DHCP Smart-Relay

Cisco IOS XE Catalyst SD-WAN Release 17.13.1a

Cisco Catalyst SD-WAN Manager Release 20.13.1

With this feature, you can set the gateway address to the secondary IP address using the DHCP relay agent, when there is no IP address and DHCP service information from the DHCP server. A DHCP relay agent is any host or IP router that forwards DHCP packets between clients and servers.

This functionality is useful when the DHCP server cannot be configured to use secondary pools.

Information About the IP DHCP Smart-Relay

A Dynamic Host Configuration Protocol (DHCP) relay agent is any host that forwards DHCP packets between clients and servers. Relay agents are used to forward requests and replies between clients and servers when they are not on the same physical subnet. Relay-agent forwarding is distinct from the normal forwarding of an IP router, where IP datagrams are switched between networks transparently. Relay agents receive DHCP messages and then generate a new DHCP message to send out on another interface. The relay agent sets the gateway IP address and, if configured, adds the relay agent information option (option 82) in the packet and forwards it to the DHCP server. The reply from the server is forwarded back to the client after removing option 82.

The Cisco IOS XE DHCP relay agent supports the use of unnumbered interfaces. An unnumbered interface can borrow the IP address of another interface already configured on the router, which conserves network and address space. For DHCP clients connected though the unnumbered interfaces, the DHCP relay agent automatically adds a static host route once the DHCP client obtains an address, specifying the unnumbered interface as the outbound interface. The route is automatically removed once the lease time expires or when the client releases the address.

Benefits of IP DHCP Smart-Relay

  • Using automatic IP address assignment at each remote site substantially reduces the internet access cost. Static IP addresses are considerably more expensive to purchase than are automatically allocated IP addresses.

  • Enables easier configuration and minimizes operational overhead and costs associated with device configuration tasks and eases deployment by nontechnical users.

  • DHCP server maintains configurations for several subnets. An administrator only needs to update a single, central server when configuration parameters change.

Prerequisites for IP DHCP Smart-Relay

  • To configure the IP DHCP smart-relay feature, configure the IP helper address on desired interfaces using ip helper-address command. You can use the service dhcp command to enable the DHCP service and no service dhcp command, if the service is disabled depending on the requirement.

  • The Cisco DHCP relay agent is enabled on an interface only when the ip helper-address command is configured. This command enables the DHCP broadcast to be forwarded to the configured DHCP server.

Configure IP DHCP Smart-Relay Agent Using a CLI Template

To forward UDP broadcasts to the DHCP server, configure helper addresses on the interface. If you have configured the secondary addresses on that interface and you want the router to step through each IP network when forwarding DHCP requests, use the ip dhcp smart-relay command. If smart relay agent forwarding is not configured, all requests are forwarded using the primary IP address on the interface. If smart relay agent forwarding is not configured, all requests are forwarded using only the primary IP address on the interface.

If the ip dhcp smart-relay command is configured, the relay agent counts the number of times that the client retries sending a request to the DHCP server when there is no DHCPOFFER message from the DHCP server. After three retries, the relay agent sets the gateway address to the secondary address. If the DHCP server still does not respond after three more retries, then the next secondary address is used as the gateway address.

For more information about using CLI templates, see CLI Add-On Feature Templates and CLI Templates.

  1. Enter SD-WAN configuration mode.
    sdwan
  2. Enable DHCP server.

    service dhcp
  3. In the SD-WAN configuration mode, configure an interface type such as, Gigabit Ethernet.

    interface Gigabitethernet0/0
    
  4. Enable the DHCP broadcast to be forwarded to the configured DHCP server.

     ip helper-address
  5. Configure the DHCP relay agent to switch the gateway address to a secondary address when there is no DHCPOFFER message from a DHCP server.

    ip dhcp smart-relay 

The following is a DHCP smart-relay CLI configuration. In the following example, the device forwards the DHCP broadcast received on Gigabitethernet interface 0/0 to the DHCP server (10.0.0.1), by inserting 192.168.255.254 in the gateway address field of the DHCP packet.


service dhcp
ip address 172.16.0.1 255.255.0.0 
secondary ip address 192.168.255.254 255.255.0.0

interface GigabitEthernet0/0
ip helper-address 10.0.0.1
ip dhcp smart-relay
end