cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3868
Views
10
Helpful
15
Replies

How to put Track on route with dhcp gateway ( Cisco 819 )

plussier1
Level 1
Level 1

Hi,

I would like to know if it's possible to do the same setting like this one but with dhcp gateway ?

 

ip route 0.0.0.0 0.0.0.0 xxx.xxx.xxx.xxx track 1  ( Used at the moment with Static ISP from ISP )

 

We have a second site with no Static IP from ISP.

 

Is there a way to put track on Route with DHCP gateway ?

 

I tried but look like when you type

(config)#ip route 0.0.0.0 0.0.0.0 dhcp ?
  <1-255>  Distance metric for this route
  <cr>

you can't put track on this route

 

I need to put track because i use Ip sla to switch between ISP 1 and ISP 2 in case on failure of Main ISP, 1 on this case.

 

Please let my know !

 

Thank You!

 

Patrick Lussier

OrizonMobile

15 Replies 15

Reza Sharifi
Hall of Fame
Hall of Fame

Hi,

How about this command:

ip route  0.0.0.0 0.0.0.0  gigabitEthernet 0 track 1

gigabitEthernet 0 is an exapmle. Your interface maybe different.

HTH

Thank You for your reply,

I already tried but doesn't work see bellow the warning when I tried the command:

(config)#ip route 0.0.0.0 0.0.0.0 GigabitEthernet0 track 3
%Default route without gateway, if not a point-to-point interface, may impact performance

 

Is there some thing missing on my Gigabitethernet 0 interface setting ?

interface GigabitEthernet0
description WAN-1 DHCP TEST
ip address dhcp
no ip redirects
no ip proxy-arp
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
no cdp enable

 

Let me know and thank you !

Hello,

 

the below:

 

(config)#ip route 0.0.0.0 0.0.0.0 GigabitEthernet0 track 3
%Default route without gateway, if not a point-to-point interface, may impact performance

 

is just a warning, your router will take the command. It only means that if you don't specify a next hop, your router will have to ARP for the destination, which uses up more resources.

Another factor to consider is that a static route specifying an outbound interface but not any next hop address, when the interface is Ethernet, only works if the next hop device enables proxy arp. And many organizations are moving to disable proxy arp because of the security implications of proxy arp.

 

If we look a bit deeper into Georg's explanation about this using more resources we would find that it means:

- the router will arp for every individual destination (more cpu to make the request and more bandwidth to send the request and receive the response)

- the router will create an entry in the arp table for every individual destination (more memory to store the increasing number of entries and cpu utilization to make the entries)

- every 4 hours the router will time out the entry and arp for it again to refresh the table (more cpu to delete the entry and to generate the new arp request, more bandwidth to send the request and receive the response). And note that once an address is an entry in the arp table it will never be removed from the table, it just gets refreshed every 4 hours. So the arp table just gets larger and larger.

In a smaller router like the 819 this resource utilization may be more noticeable than it might be in some larger router which has more memory and a more powerful cpu.

 

It is a shame that it appears that there is not support for the track option if the route is learned via DHCP. Perhaps an EEM might be written to check on availability in the default route and to change the configured default route is the primary is not working.

 

HTH

 

Rick

HTH

Rick

I've been researching making dual WAN failover with WAN addresses determined by DHCP. I've tested the configuration below by power cycling my primary modem. Here's what works for me:

 

track 40 ip sla 40 reachability

ip sla 40
 icmp-echo 8.8.4.4 source-interface GigabitEthernet0/0
 timeout 6000
 frequency 10

ip sla schedule 40 life forever start-time now

interface GigabitEthernet0/0
 description WAN: DHCP WAN, primary
 ip dhcp client route track 40
 ip address dhcp

interface GigabitEthernet0/1
 description WAN: DHCP WAN, secondary
 ip address dhcp

ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/1 dhcp 200
ip route 0.0.0.0 0.0.0.0 dhcp

I followed the advice at this Cisco post. However, it didn't work because the default gateway specified the interface for both DHCP routes. When I dropped the interface on the primary route, it worked. The failure I was seeing was that once the SLA went down, it never came back up. Dropping the interface specification allowed it to return once the modem powered up and reset. I'm not familiar with the debugging or tracing systems, so I cannot tell you exactly why the behavior was one way or the other.

 

Nevertheless, if anyone coming here is looking for a solution, this configuration worked for me on an ISR 1941 Router.

Hello
If for some reason 8.8.4.4 becomes unreachable via the primary route the ip sla track will initiate and your secondary default will be installed in the route table however then 8.8.4.4. will then be reachable via this secondary path again and as such you will lose connectivity, So, you need to make sure 8.8.4.4. isnt reached via your secondary default path.

 

ip route 8.8.4.4 255.255.255.255 null 0  2


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Paul,

 

Thanks for the reply. I'm confused. The SLA contains an icmp-echo directed through a specific interface (the primary):

icmp-echo 8.8.4.4 source-interface GigabitEthernet0/0

as such, there's no need to be concerned about 8.8.4.4 being reachable through the secondary link. In fact, in this case, we want this address to be reachable as it's a DNS responder. Regardless, the sla will continue to attempt to reach the address through the primary link (interface) and only when it and the track are back up will the primary default route be added back into the routing table.

Have I missed something?

Hello


@AndrewPhilips88898 wrote:

Paul,

 

only when it and the track are back up will the primary default route be added back into the routing table.


Its sourced from that interface but it want stop it being reached though the secondary link hence the null route, In any case

@vamikhai  seems to have provided an elegant alternative solution using a local policy based route.

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

vamikhai
Cisco Employee
Cisco Employee

Please note, that in order for "ip dhcp client route track" to work properly on internet-facing interface, one needs to make sure the probe is always sent over the primary interface!

One way to achieve this is to configure local PBR like following:

 

access-list 101 permit icmp any host 8.8.4.4 echo
!
route-map ICMP-TRACK permit 10
 match ip address 101
 set ip next-hop dynamic dhcp
 set interface G0/0
!
ip local policy route-map ICMP-TRACK

 

Thanks for a very good suggestion. +5 for a creative approach. I have done track before and tried to make sure that the probe was sent using the desired interface. I had not considered local policy, and realize that it is a very good approach.

HTH

Rick

Do we still need local policy route-map even if we have source-interface specified under the sla and a static route facing the interface?

i.e. 
ip sla 8
icmp-echo 8.8.8.8 source-interface GigabitEthernet0/1


ip route 8.8.8.8 255.255.255.255 GigabitEthernet0/1

Thanks,

I would not say that local policy was a requirement. But it is an option that would be very effective. If your configuration using source-interface and a static route is consistently producing the results that you want then fine. But if sometimes it is not working then you might add local policy.

HTH

Rick

Hello,

 

here is what this would look like using EEM scripts:

 

track 1 ip sla 1 reachability
!
ip sla 1
icmp-echo 8.8.8.8 source-interface GigabitEthernet0/0
timeout 3000
threshold 1000
frequency 3
!
ip sla schedule 1 life forever start-time now
!
interface GigabitEthernet0/0
description WAN: DHCP WAN, primary
ip address dhcp

!

interface GigabitEthernet0/1
description WAN: DHCP WAN, secondary
ip address dhcp
!
ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0 dhcp
ip route 8.8.8.8 255.255.255.255 GigabitEthernet0/0
!
event manager applet ISP_PRIMARY_DOWN
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0 dhcp"
action 4.0 cli command "ip route 0.0.0.0 0.0.0.0 GigabitEhernet0/1 dhcp"
action 5.0 cli command "end"
action 6.0 cli command "clear ip nat translation *"
!
event manager applet ISP_PRIMARY_UP
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/1 dhcp"
action 4.0 cli command "ip route 0.0.0.0 0.0.0.0 GigabitEhernet0/0 dhcp"
action 5.0 cli command "end"
action 6.0 cli command "clear ip nat translation *"

I'm facing a similiar issue in that I need to track a DHCP-default route. I found the following link but still need to try it out.

 

https://www.cisco.com/c/en/us/support/docs/routers/2900-series-integrated-services-routers/213824-configure-ip-dhcp-client-route-track-f.html

 

 

CCIE #37979 (R/S)
Review Cisco Networking products for a $25 gift card