# Configuring Dynamic Subscriber Interfaces for Interoperation with DHCP Relay and DHCP Relay Proxy

When you configure the DHCP relay application or the DHCP relay proxy application in the same virtual router (VR) as the DHCP external server application, we recommend that you define interface profiles to create the dynamic subscriber interfaces when the primary IP interface is static. Otherwise, the gateway IP address (giaddr) used for DHCP rebind or renewal requests might be inconsistent. Renewal requests apply only when DHCP relay proxy is configured in the same VR as DHCP external server.

The use of inconsistent giaddrs results in the transmission of negative acknowledgment (NAK) messages from the DHCP server and the removal of existing DHCP client bindings.

To apply an interface profile to a dynamic subscriber interface:

1. Define the interface profile.
   host1(config)#profile dsiTest host1(config-profile)#ip unnumbered loopback 5500 host1(config-profile)#exit
2. Define a route map in the VR in which the static primary IP interface resides.
   host1(config)#virtual-router relay Proceed with new virtual-router creation? [confirm]host1:relay(config)#route-map dsiTest host1:relay(config-route-map)#set ip interface-profile dsiTest host1:relay(config-route-map)#exit
3. Define a loopback interface with a host mask in the VR in which the static primary IP interface resides.
   host1:relay(config)#interface loopback 5500 host1:relay(config-if)#ip address 71.23.1.2/32
4. Enable the static primary IP interface to support creation of dynamic subscriber interfaces, and apply the route map to the IP interface subscriber in the static primary IP interface configuration.
   host1:relay(config)#interface fastEthernet 5/5.100 host1:relay(config-if)#ip unnumbered loopback 5500 host1:relay(config-if)#ip auto-configure ip-subscriber exclude-primary host1:relay(config-if)#ip route-map ip-subscriber dsiTest

   Use the exclude-primary keyword in the ip auto-configure ip-subscriber command to specify that the primary interface cannot be assigned to a subscriber.

5. If you have issued the ip dhcp-external server-sync command to resynchronize the DHCP external server application with the router and to support creation of subscriber state information based on lease renewals, you must do either of the following to ensure that the unicast acknowledgment (ACK) response to the renewal request has a route back to the DHCP client that generated the renewal request:
   - Enable the packet detection feature on the static primary IP interface in the context of the VR in which the static primary interface resides.
     host1:relay(config-if)#ip auto-detect ip-subscriber

     Issuing the ip auto-detect ip-subscriber command creates a dynamic subscriber interface back to the DHCP client when the router receives a packet with a source IP address that does not match any entries in the demultiplexer table. This method requires you to configure the primary IP interface to support creation of dynamic subscribers interfaces, which is accomplished by issuing the ip auto-configure ip-subscriber exclude-primary command, as shown in Step 4.

   - Configure an explicit network route in the context of the VR in which the static primary interface resides to provide connectivity back to the DHCP client.
     host1:relay(config)#ip route 71.23.0.0/24 fastEthernet 5/5.100

#### Related Documentation

- ip auto-configure ip-subscriber
- ip auto-detect ip-subscriber
- ip dhcp-external server-sync
- ip route
- ip route-map ip-subscriber
- set ip interface-profile