ip route, with interface as next hop
Hi,
I was doing some labs and it occured to me, I dont really know what happens when you have a static route statement such as:
ip route x.x.x.x y.y.y.y FastEthernet0/1
How does the local router send out a packet for x.x.x.x/y.y.y.y onto the fa0/1? and how does a/any receiving routers know if its meant for it to keep sending further?
I was doing some labs and it occured to me, I dont really know what happens when you have a static route statement such as:
ip route x.x.x.x y.y.y.y FastEthernet0/1
How does the local router send out a packet for x.x.x.x/y.y.y.y onto the fa0/1? and how does a/any receiving routers know if its meant for it to keep sending further?
Studying for CCNP (All done)
Comments
-
nel Member Posts: 2,859 ■□□□□□□□□□You only use that statement when you have only one exit point and there is only one device on the other end, like on a point to point link otherwise you have to state the next hop IP.Xbox Live: Bring It On
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking -
gojericho0 Member Posts: 1,059 ■■■□□□□□□□Also, when using this method router, the interface will assume the the remote network is directly connected when trying this on a multi-access network like ethernet and if its not you will have an encapsulation failure.
The good thing though about this method is that the route will go down if the interface status changes to up/down or down/down.
If you just use the next hop address, if there is an alternative route to the same destination learned from a dynamic routing protocol the static route may come back and convergence may not occur properly.
To get the best out of both worlds I always configure static routes like this
ip route x.x.x.x y.y.y.y eth0 z.z.z.z
here's a link that explains more in detail
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800ef7b2.shtml -
dtlokee Member Posts: 2,378 ■■■■□□□□□□Another fun fact when using an exit interface, the static route will show up in the routing table as connected and subject to advertisement via a "network" statement under your routing protocol.The only easy day was yesterday!
-
kpjungle Member Posts: 426nel wrote:You only use that statement when you have only one exit point and there is only one device on the other end, like on a point to point link otherwise you have to state the next hop IP.
I would never use the interface thing myself, but i just labbed it and it works even on multiaccess links.
my setup:
R1 --> R2 ---> R3 and R4 here
Link between R1 and R2 is serial, and the link between R2 and R3 and R4 is a lan segment.
I have a loopback on R3 that im pinging from R1 and it works.
My static route states: ip route 0.0.0.0 0.0.0.0 fa1/0 on R2, and it doesnt give any encapsulation errors. It just works.
On a side note, this is done in Dynamips.Studying for CCNP (All done) -
kpjungle Member Posts: 426dtlokee wrote:Another fun fact when using an exit interface, the static route will show up in the routing table as connected and subject to advertisement via a "network" statement under your routing protocol.
And give the advantage of 0 in advertised distance.Studying for CCNP (All done) -
gojericho0 Member Posts: 1,059 ■■■□□□□□□□kpjungle wrote:my setup:
R1 --> R2 ---> R3 and R4 here
Link between R1 and R2 is serial, and the link between R2 and R3 and R4 is a lan segment.
I have a loopback on R3 that im pinging from R1 and it works.
My static route states: ip route 0.0.0.0 0.0.0.0 fa1/0 on R2, and it doesnt give any encapsulation errors. It just works.
On a side note, this is done in Dynamips.
what happens if you ping something like 2.2.2.2? -
dtlokee Member Posts: 2,378 ■■■■□□□□□□When you use an multi-access interface as the exit interface (like Ethernet) it can work but it will rely on proxy arp from the upstream router.The only easy day was yesterday!
-
kpjungle Member Posts: 426gojericho0 wrote:kpjungle wrote:my setup:
R1 --> R2 ---> R3 and R4 here
Link between R1 and R2 is serial, and the link between R2 and R3 and R4 is a lan segment.
I have a loopback on R3 that im pinging from R1 and it works.
My static route states: ip route 0.0.0.0 0.0.0.0 fa1/0 on R2, and it doesnt give any encapsulation errors. It just works.
On a side note, this is done in Dynamips.
what happens if you ping something like 2.2.2.2?
The Cisco doc's let me to lab it so I got the theory working
It was only able to work because the routers answered an ARP reply the sourcing (one with the static route point out the exit interface), sent out. When i added another router down the chain, it couldnt resolve the ARP reply, and gave the encapsulation failure.
ThanksStudying for CCNP (All done)