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 22.214.171.124 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 126.96.36.199?
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 188.8.131.52 to go out of RTR-B. The confusion is the GLBP thing.
thank you for the help
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 184.108.40.206 255.255.255.255 RTR-B and ip route 220.127.116.11 255.255.255.255 RTR-B 200 doesn't make much sense. If you want to send everything to primary router RtR-B for 18.104.22.168 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
ip sla schedule 1 start-time now life forever
track 1 rtr 1 reachability
ip route 22.214.171.124 255.255.255.255 RtR-B track 1
ip route 126.96.36.199 255.255.255.255 RTR-X 200
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
- 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
- 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
- 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 188.8.131.52 network and RTR B also has reachability. So packet can be forwarded.
Host X ( RTR A as gateway) sends packet destined to 184.108.40.206 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 220.127.116.11 it goes to RTR B, which will process it according to its routing table
Hope this helps.