IP DHCP Smart-Relay

Feature history for IP DHCP smart-relay

Table 1. Feature History Table

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.

IP DHCP smart-relay

A Dynamic Host Configuration Protocol (DHCP) relay agent is a network host that

  • forwards DHCP packets between clients and servers on different physical subnets,

  • generates new DHCP messages on another interface, setting the gateway IP address and optionally adding relay agent information (option 82), and

  • supports unnumbered interfaces by automatically managing static host routes for DHCP clients.

Relay-agent forwarding differs from standard IP routing; instead of transparent packet switching, the relay agent receives DHCP messages, creates new messages with updated information, and forwards these between interfaces.

When a DHCP reply is received from the server, the relay agent removes option 82 (if present) before forwarding it to the client. With unnumbered interfaces, the relay agent borrows an IP address from another configured interface and dynamically adds or removes static host routes for DHCP clients as leases are assigned and released.

Supporting reference information

  • DHCP relay agents are essential when DHCP clients and servers are not on the same subnet, as they enable message forwarding across networks.

  • Relay agents specifically set the gateway IP address and can insert option 82 for added information in packets sent to the DHCP server.

  • The Cisco IOS XE DHCP relay agent supports unnumbered interfaces, which helps conserve address space and network resources. Static host routes for DHCP clients on unnumbered interfaces are created and removed automatically based on the DHCP lease status.

Benefits of IP DHCP smart-relay

  • Automatically assigning IP addresses at each remote site substantially reduces internet access costs. Purchasing static IP addresses is considerably more expensive than using automatically allocated IP addresses.

  • Simplifies configuration, reduces operational overhead and costs related to device configuration, and makes deployment easier for nontechnical users.

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

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 the 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.

Before you begin

  • 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 or the no service dhcp command to disable it, 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.

Procedure


Step 1

Enter SD-WAN configuration mode.

Example:

sdwan

Step 2

Enable DHCP server.

Example:

service dhcp

Step 3

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

Example:

interface Gigabitethernet0/0

Step 4

Enable the DHCP broadcast to be forwarded to the configured DHCP server.

Example:

 ip helper-address

Step 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.

Example:

ip dhcp smart-relay 

This is a DHCP smart-relay CLI configuration. In the 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