Typical application – tracking the DHCP client default route

Last Updated : Nov 06, 2012 |

This typical application demonstrates a case where a user configures DHCP client on the device to enable cable modem connection to the WAN FastEthernet interface. The user wishes to know whether the DHCP client default route can be used for routing decisions – that is, whether traffic can be routed over this default route. To do so, the user activates tracking to monitor the remote HQ peer. When the object tracker is up, the DHCP default route may be used. When the object tracker is down, the DHCP default route is not used for routing and traffic is routed to alternate routes.

Note:

If several default routers are learned from a specific interface, the object tracker tracks only the first one.

! Apply DHCP client on the WAN Fast Ethernet 
!
interface fastethernet 10/2
    ip address dhcp
    exit
!
! Configure the RTRs and object trackers.
! Use the next-hop command to ensure that the RTR is sent over the 
! next hop it is monitoring, which is the WAN Fast Ethernet running 
! DHCP client.
!
! 192.30.3.1 is the remote HQ peer IP address.
!
rtr 2
    type echo protocol ipIcmpEcho 192.30.3.1
       next-hop interface fastethernet 10/2
       exit
track 2 rtr 2
    exit
!
! Apply object tracking on the DHCP client.
! 
interface fastethernet 10/2
    ip dhcp client route track 2
    exit