DHCP Relay Agent Information Options
When forwarding local UDP broadcasts from a local client, the DHCP relay agent needs to include information about itself in order for the DHCP server to determine which pool of client addresses to pull the lease from. Including Option 82 and its sub-options in the DHCP relay information provides the required DHCP relay information.
Several commands are available to configure which DHCP relay agent information options are used by the switch to affect the selection of a lease when it is operating as a DHCP relay agent.
- Use the ip dhcp relay information option command, in either global or interface configuration mode, to insert the circuit-id (1) and remote-id (2) sub-options of the Relay Agent Information option (82) into the relay agent DHCP packets. Refer to RFC 3046 for detailed descriptions of these sub-options.
- The default circuit-id sub-option value inserted into the relay agent DHCP packet is the interface name of the interface receiving the request from the client, in the form of vlan.0.x where x is the VLAN id between 1 and 4094. This default value can be over-ridden at the interface level by using the ip dhcp relay information option circuit-id command in interface configuration mode.
- The remote-id sub-option is used to identify the remote host end of the circuit. The default value inserted into the relay agent DHCP packet is the MAC address of the chassis. This default value can be over-ridden by using the ip dhcp relay information option remote-id command in global configuration mode or interface configuration mode.
- Use the ip dhcp relay information option vpn command, in either global or interface configuration mode, to insert the virtual subnet selection (151), link selection (5), and server identifier override (11) sub-options into the relay agent DHCP packet.
- The virtual subnet selection (VSS) options/sub-options are described in RFC 6607. They are used to pass VSS information about a VPN to the DHCP server to assist in determining the subnet on which to select an address. You can set the VPN id for a VRF with the vpn id command. If a VPN id is not configured for the VRF, the virtual subnet selection sub-option will contain the VRF name.
- The link selection sub-option is described in RFC 3527. The link-selection sub-option is used by any DHCP relay agent that desires to specify a subnet/link for a DHCP client request that it is relaying but needs the subnet/link specification to be different from the IP address the DHCP server should use when communicating with the relay agent. By default, the link selection sub-option contains the subnet of the inbound interface to which the client is connected. This default value can be changed with the ip dhcp relay information option link-selection command.
- The server identifier override sub-option is described in RFC 5107. This sub-option allows the DHCP relay agent to specify a new value for the server ID option, which is inserted by the DHCP server in the reply packet. This allows the DHCP relay agent to act as the actual DHCP server so that subsequent requests from the client will come to the relay agent rather than to the DHCP server directly. The server identifier override sub-option contains the IP address of the inbound interface to which the client is connected, which is the IP address on the relay agent that is accessible from the client. Using this information, the DHCP client sends all renew and release requests to the relay agent. The relay agent adds all of the appropriate sub-options and then forwards the request packets to the original DHCP server.
- Use the ip dhcp relay information option server-override command, in either global or interface configuration mode, to insert only the link selection (5), and server identifier override (11) sub-options into the relay agent DHCP packet.
- Use the ip dhcp relay information option link-selection command in interface configuration mode to specify that the link selection sub-option should be included in the Relay Agent Information and to define a different subnet from the interface‘s primary IP address. This allows you to select a secondary IP address on an interface to be used to help in DHCP pool selection on the server. The subnet selection can be based on the DHCP client‘s vendor id (option 60) or its hardware MAC address.
Use the ip dhcp relay source-interface command, in global or interface configuration mode, to specify the source interface (VLAN or loopback) to be used used in the Relay Agent packets sent to the DHCP server or other relay agent. This command should be used in conjunction with the ip dhcp relay information option server-override or ip dhcp relay information option vpn commands, which cause the server identifier override (11) sub-option to be added to the Relay Agent DHCP packets sent to the DHCP server.
Note
The source interface specified with the
ip dhcp relay source-interface command must belong to the same VRF specified with the
ip helper-address command.
Command Order of Precedence
The following precedence rules apply to the DHCP relay agent information commands that can be configured in both router global and interface configuration modes.
If the ip dhcp relay information option commands or ip dhcp relay source-interface command are configured in global configuration mode but not configured in interface configuration mode, the global configuration is applied to all interfaces.
If the ip dhcp relay information option commands or ip dhcp relay source-interface command are configured in both global configuration mode and interface configuration mode, the interface configuration command takes precedence over the global configuration command. However, the global configuration is applied to interfaces that have not been configured at the interface level.
If the ip dhcp relay information option commands or ip dhcp relay source-interface command are not configured in global configuration mode but are configured in interface configuration mode, only the interfaces that have been configured are affected. All other interfaces are not impacted by the configuration.