In this blog, we discuss when a gateway decides that it’s not a good gateway any more and proposes a new gateway to the host by setting redirection.
Introduction
We explore how a gateway (a router) present in a LAN handles routing to the outside of this network and uses redirection to enhance this operation. In the first part, we describe the lab setup to show this routing operation. In the second part, we deep analyze this behavior before we conclude.
Lab setup
Our lab setup is 3 routers: R1, R2 and R3, in addition to 2 PC: PC1 and PC2. In this lab, PC1 tries to interconnect to PC2.

Routers R1, R2 and R3 have interfaces (f0/0) in the same network 123.0.0.0 and belong the same broadcast domain Vlan204. This is to test redirection that we put all the routers on the same L2 network.
Deep analysis
To allow PC1 to connect to PC2, static routing is configured on routers R1, R2 and R3. On router R1, PC1 and PC2 network are not connected and one hop away. Static route to PC1 is configured with a nexthop pointing to f0/0 interface of R2. The same for PC2, the configured nexthop is the IP address of the f0/0 interface of R3.