This functionality enables a DHCP server to identify the user (for example, cable access router) sending a request and initiate appropriate action based on this information. By default, DHCP does not insert relay information.
The ip dhcp relay information option command automatically adds the circuit identifier suboption and the remote ID suboption to the DHCP relay agent information option (also called option 82).
The vpn optional keyword should be used only when the DHCP server allocates addresses based on VPN identification suboptions.
The ip dhcp relay information option vpncommand adds the following VPN-related suboptions into the relay agent information option when DHCP broadcasts are forwarded by the relay agent from clients to a DHCP server:
- VPN identifier--Contains the VPN ID if configured or the virtual routing and forwarding (VRF) name if configured on the interface (VPN ID takes precedence over VRF name).
- Subnet selection--Contains the incoming interface subnet address.
- Server identifier override--Contains the incoming interface IP address.
After these suboptions are successfully added, the gateway address is set to the outgoing interface of the router toward the DHCP server IP address that was configured using the ip helper-address command.
If only the ip dhcp relay information option vpncommandis configured, the VPN identifier, subnet selection, and server identifier override suboptions are added to the relay information option. Note that the circuit identifier suboption and the remote ID suboption are not added to the relay information option. However, if both the ip dhcp relay information option command and the ip dhcp relay information option vpn command are configured, all five suboptions are added to the relay agent information option.
When the packets are returned from the DHCP server, option 82 is removed before the reply is forwarded to the client.
Even if the vpn option is specified, the VPN suboptions are added only to those DHCP or BOOTP broadcasts picked up by the interface that was configured with a VRF name or VPN ID.
For clients from unnumbered ATM or serial interfaces, when this command is enabled, the VPN identifier suboption will contain the VRF name of the unnumbered interface.
Subnet selection and server identifier override suboptions are added from the IP address of the interface from which the unnumbered interface is configured to borrow its IP address. The client host route will be added on the applicable VRF routing tables.
If the ip dhcp smart-relay global configuration command is enabled, then the server identifier override and subnet selection suboptions will use the secondary IP address of the incoming interface when the same client retransmits more than three DHCP DISCOVER packets (for both numbered and unnumbered interfaces).
The following example configures a DHCP server to insert the DHCP relay agent information option, including VPN suboptions, in forwarded BOOTREQUEST messages. In this example, the circuit identifier suboption and the remote ID suboption are not included in the relay information option:
ip dhcp relay information option vpn
The following example configures a DHCP server to insert the DHCP relay agent information option, including VPN suboptions, the circuit identifier suboption, and the remote ID suboption, in forwarded BOOTREQUEST messages:
ip dhcp relay information option vpnip dhcp relay information option
The following example enables DHCP option 82 support on the DHCP relay agent by using the ip dhcp relay information option command. The rbe nasipcommand configures the router to forward the IP address for Loopback0 to the DHCP server. The value (in hexadecimal) of the agent remote ID suboption is 010100000B0101814058320, and the value of each field is the following:
- Port Type: 0x01
- Version: 0x01
- Reserved: undefined
- NAS IP address: 0x0B010181 (hexadecimal value of 18.104.22.168)
- NAS Port
- Interface (slot/module/port): 0x40 (The slot/module/port values are 01 00/0/000.)
- VPI: 0x58 (hexadecimal value of 88)
- VCI: 0x320 (hexadecimal value of 800)
ip dhcp-server 172.16.1.2!ip dhcp relay information option!interface Loopback0 ip address 10.1.1.129 255.255.255.192!interface ATM4/0 no ip address!interface ATM4/0.1 point-to-point ip unnumbered Loopback0 ip helper-address 172.16.1.2 atm route-bridged ip pvc 88/800 encapsulation aal5snap!interface Ethernet 5/1 ip address 172.16.1.1 255.255.0.0!router eigrp 100 network 10.0.0.0 network 172.16.0.0!rbe nasip Loopback0
In the following example, the DHCP relay receives a DHCP request on Ethernet interface 0/1 and sends the request to the DHCP server located at IP helper address 10.44.23.7, which is associated with the VRF named red.
ip dhcp relay information option vpn!interface ethernet 0/1 ip helper-address vrf red 10.44.23.7