What gets checked first, GLBP or Static Route?

Answered Question
Aug 17th, 2010
User Badges:

I have 2 routers doing GLBP. The virtual IP is given to the workstations as their Default Gateway.


When a packet hits the default gateway, it'll go to RTR-A. Then the second packet request will go to RTR-B. This is all good via GLBP.


The question is, if RTR-A has a static route to 66.66.66.66 and the next hop for this destination is via RTR-B, how will RTR-A treat this packet when RTR-A is the router that needs to route the packet to the internet? I mean, how is this treated?


Will GLBP look at the packet and then determine that it is now RTR-A turn to take it, then gives it to RTR-A and then this router will look at its local routing table and then gives it to RTR-B because the destination is 66.66.66.66?


Or will the static route take precedence over GLBP? but again, only RTR-A will have this static route entry as the network admin is forcing everyting destined to 66.66.66.66 to go out of RTR-B. The confusion is the GLBP thing.



thank you for the help

Correct Answer by trondaker about 6 years 8 months ago

Again, even though GLBP answers per-host, it will still send out ICMP redirects with your setup, and Rtr-B will be used for _that_ destination if the end-host responds to redirects.


As to your question you can use the track function in IOS to do what you want, but to have:


ip route 66.66.66.66 255.255.255.255 RTR-B and ip route 66.66.66.66 255.255.255.255 RTR-B 200 doesn't make much sense. If you want to send everything to primary router RtR-B for 66.66.66.66 and if that goes down use RtR-X, then use:


ip sla 1 
icmp-echo x.x.x.x ! some loopback or interface on RtR-B
timeout 500
frequency 3
ip sla schedule 1 start-time now life forever
track 1 rtr 1 reachability



ip route 66.66.66.66 255.255.255.255 RtR-B track 1

ip route 66.66.66.66 255.255.255.255 RTR-X 200

Correct Answer by Deepak Khemani about 6 years 8 months ago

Hi


GLBP works on per host basis and not per packet basis. What I mean is when host looks for the gateway for first time, it is that time when it is decided which  router will actually be forwarding the packets for host.


Consider this example


Three Host X, Y, Z


Two routers with GLBP RTR A and RTR B operating in Round Robin Basis


  1. Host X boots gets IP address through DHCP or statically configured, it will send ARP query for gateway. ARP query is served by RTR A and it sends it MAC address. Now Host X will use RTR A as gateway
  2. Host Y boots gets IP address through DHCP or statically configured, it will send ARP query for gateway. ARP query this time is served by RTR B bcoz GLBP is configure to be in round robin mode. RTR B sends it MAC address to host Y. Now Host Y will use RTR B as gateway
  3. Host Z boots gets IP address through DHCP or statically configured, it will send ARP query for gateway. ARP query is this time will  served by RTR A and it sends it MAC address. Now Host X will use RTR A as gateway


RTR A has reachability to 66.66.66.66 network and RTR B also has reachability. So packet can be forwarded.


Host X ( RTR A as gateway) sends packet destined to 66.66.66.66 it goes to RTR A, which will send it to RTR B because of static route.


Host Y ( RTR B as gateway) sends packet destined to 66.66.66.66 it goes to RTR B, which will process it according to its routing table


Hope this helps.


Cheers

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
trondaker Thu, 08/19/2010 - 07:56
User Badges:

The GLBP-process will just answer with a MAC-address for one of the routers in a round-robin fashion - doesn't matter who has the routes to where. However Rtr-A will send an ICMP-redirect since the packet goes out an interface to another router where the client is also located. If the client responds to ICMP-redirects, packets for 66.66.66.66 in the future will go to Rtr-B.

Correct Answer
Deepak Khemani Thu, 08/19/2010 - 08:31
User Badges:

Hi


GLBP works on per host basis and not per packet basis. What I mean is when host looks for the gateway for first time, it is that time when it is decided which  router will actually be forwarding the packets for host.


Consider this example


Three Host X, Y, Z


Two routers with GLBP RTR A and RTR B operating in Round Robin Basis


  1. Host X boots gets IP address through DHCP or statically configured, it will send ARP query for gateway. ARP query is served by RTR A and it sends it MAC address. Now Host X will use RTR A as gateway
  2. Host Y boots gets IP address through DHCP or statically configured, it will send ARP query for gateway. ARP query this time is served by RTR B bcoz GLBP is configure to be in round robin mode. RTR B sends it MAC address to host Y. Now Host Y will use RTR B as gateway
  3. Host Z boots gets IP address through DHCP or statically configured, it will send ARP query for gateway. ARP query is this time will  served by RTR A and it sends it MAC address. Now Host X will use RTR A as gateway


RTR A has reachability to 66.66.66.66 network and RTR B also has reachability. So packet can be forwarded.


Host X ( RTR A as gateway) sends packet destined to 66.66.66.66 it goes to RTR A, which will send it to RTR B because of static route.


Host Y ( RTR B as gateway) sends packet destined to 66.66.66.66 it goes to RTR B, which will process it according to its routing table


Hope this helps.


Cheers

insccisco Thu, 08/19/2010 - 13:12
User Badges:

Hi Deepak,


It looks like this answers my question. In your example, when Host X (which has its Default Gateway with RTR-A) sends a packet to 66.66.66.66, before sending this packet it will look at its routing table and according to the static entry here, it will give send the packet over to RTR-B.


Actually this is very good explanation. Very clear and to the point. GLBP then really never is a problem or an obstacle. The hosts that have RTR-A as their Default Gateway will still send anything destined to 66.66.66.66 to RTR-A and then RTR-A will follow its routing table entries.


This redirection is then very transparent to the internal hosts, especially to the ones that have RTR-A as their Default Gateway.



Now, to take this a bit deeper, can we perhaps to some failover stuff here for anything destined to 66.66.66.66? I mean, can RTR-A have 2 static routing entries for this 66.66.66.66 network? one being "ip route 66.66.66.66 255.255.255.255 RTR-B"  and the second statement looking like "ip route 66.66.66.66 255.255.255.255 RTR-B 200" ???


The end result that we are trying to accomplish here is that for RTR-A to notice if there is an outage in RTR-B. If this is the case, then RTR-A will be smart enough to not send anything destined for 66.66.66.66 to RTR-B and instead send the packet using its own default gateway (RTR-A own gateway of last resort)?


can this be done?

Correct Answer
trondaker Fri, 08/20/2010 - 00:40
User Badges:

Again, even though GLBP answers per-host, it will still send out ICMP redirects with your setup, and Rtr-B will be used for _that_ destination if the end-host responds to redirects.


As to your question you can use the track function in IOS to do what you want, but to have:


ip route 66.66.66.66 255.255.255.255 RTR-B and ip route 66.66.66.66 255.255.255.255 RTR-B 200 doesn't make much sense. If you want to send everything to primary router RtR-B for 66.66.66.66 and if that goes down use RtR-X, then use:


ip sla 1 
icmp-echo x.x.x.x ! some loopback or interface on RtR-B
timeout 500
frequency 3
ip sla schedule 1 start-time now life forever
track 1 rtr 1 reachability



ip route 66.66.66.66 255.255.255.255 RtR-B track 1

ip route 66.66.66.66 255.255.255.255 RTR-X 200

Actions

This Discussion