cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1084
Views
0
Helpful
12
Replies

Static route and default route configuration

zillah2004
Level 1
Level 1

I have got 3 routers A , B ,C

1- Router A connected to Router B via serials cable S0/0->S0/0

2- Router B connected to Router C (simulated as ISP) via serial cable S0/1->S0/1

3- A S0/0 192.168.3.1/24 and B S0/0 192.168.3.2/24

4- A Loopback0 192.168.2.1/24 ,,,,simulate LAN for A.

5- B S0/1 172.20.20.6/30, C S0/1 (simulated as ISP) 172.20.20.5/30

6- B Loopback0 0.90.3.1/24,,,,,,simulate LAN for B.

I want to use “static IP route”, and “default IP route” for this scenario (I do not want to use dynamically routing protocol), I configured these:

A (Config)# ip route 0.0.0.0 0.0.0.0 192.168.3.2 ------default route

B (Config)# ip route 0.0.0.0 0.0.0.0 172.20.20.5------default route

B (Config)# ip route 192.168.2.0 255.255.255.0 192.168.3.1-----static route

C (Config)# ip route 192.168.3.0 255.255.255.0 172.20.20.6------static route

C (Config)# ip route 10.90.3.0 255.255.255.0 172.20.20.6------static route

Router A was able to ping 172.20.20.5 (C S0/1). But when I tried to ping from router C to 192.168.2.1 (A loopback0),,I could not,

12 Replies 12

Sanjeewa Alahakone
Cisco Employee
Cisco Employee

Based on what you said, you are missing a route to 192.168.2.0/24 in router C

e.g.

show ip route 192.168.2.0 255.255.255.0 in router C will say network is not in the routing table

You can use the following debugs if this setup is in a lab

1. debug ip icmp

2. debug ip packet 100

access-li 100 per icmp any any

3. show run | i ip class

Good luck

Sanjeewa

My understanding (correct me if I am wrong),if I want to configure static route,I have to choose the network of the directly next hop.

Can we configure from Router C static route for the network (192.168.2.0), which is belong to the second hop (Router A), (i.e it is not belong to next hop which is Router B my case) ?

Sanjeewa Alahakone
Cisco Employee
Cisco Employee

Well, not really. I will correct it with following

This is what you should keep in mind.

every router in the network should know the route to destination (default route is considered a candidate route)

e.g.

This what happen when you ping from the router A to router C

1. router A will take the source ip as leaving ip (192.168.3.1) and place destination 172.20.20.5

2. Since router A does not have an explicit route, it will follow the default route

3. Packet arrives at the router B

4. Router B will look at the packet/destination (172.20.20.5)

5. Router B finds 172.20.20.5 is connected route, and ARP for the 172.20.20.5

6. Router B sends the packet to router C

Now router C will examine the packet, it understand it needs to send ICMP echo reply to 192.168.3.1

1. Now routers C have to revert the source and destination

2. Router C will place its leaving interface (172.20.20.5) and send the packet to destination 192.168.3.1

3. Router C will look at his routing table and find 192.168.3.0 is via 172.20.20.6

4. Then router C will find the route to 172.20.20.6 is via connected

5. Router will send the packet to router B after ARP process

6. routerB will get the packet and ARP for 192.168.3.0

Now let see the your question

1. When you ping from router C to 192.168.2.1, router C has to have a route to destination

2. You only have a route to destination 192.168.3.0

3. Therefore the packet is dropped in router C

Suppose you had a route to 192.168.3.0 via 172.20.20.6 (in router C) then packet will be sent to router B

Then router B will look at the packet, find the route to 192.168.2.1 from the static route and ARP for 192.168.3.1

Rule : every hop (router) should know the route to destination

You said:

"Suppose you had a route to 192.168.3.0 via 172.20.20.6 (in router C) then packet will be sent to router B

Then router B will look at the packet, find the route to 192.168.2.1 from the static route and ARP for 192.168.3.1 "

Is there any mistyping here ?

because I get confuse. C has static route to 192.168.3.0 (I have already configured this),,,,and B has static route to 192.168.2.0 (I have already configured this also),,,,,.

My understand to what you said in quoted above (before I add static route for 192.168.2.0 in C),if C tries to send packet to 192.168.2.0, (Which is not included in its routing table)then C sends to B, if the packet reaches B, then B will be able to send it to A because it has static route to A

Second question:

In my case I have got 3 routers, between A and C, I have got only one router which is B.

Now If I have got another scenario with 4 routers, 2 routers between A and C, called them B1, B2,,,,,Do still I need to configure static route in router C pointing to Router A ? in this case as you know I have got 2 hops from C to A (not one hop like before)

Yes, I was a typo mistake.

should read as "Suppose you had a route to 192.168.2.0 via 172.20.20.6", Router C will drop the packet if the route is missing in the routing table

Going back to the rule, every router should have a route to destination.

router C should know that route to 192.168.2.0 via router B2 (172.20.20.6)

router B2 should know that route to 192.168.2.0 via router B1

and B1 should know the route is via A

Hope this is clear to you now

Regards

Sanjeewa

Thanks for that

Recall my first scenario,as you suggested we have to do this:

C(Config)# ip route 192.168.3.0 255.255.255.0 172.20.20.6------static route

C (Config)# ip route 10.90.3.0 255.255.255.0 172.20.20.6------static route

C (Config)# ip route 10.90.3.0 255.255.255.0 172.20.20.6------static route (I had missed this one)

Can we replace all the three static routes by default one:

New configuration will be:

C (Config)# ip route 0.0.0.0 0.0.0.0 172.20.20.6------default route (replace the three static)

Yes, you can replace all three static routes with one default route in Router C

I replaced the three static routes in C, by one which is default.

I was able to reach all networks except the network for LAN B (which is simulated be loopback 10.90.3.1)

Any idea about this issue ?

Any help

Any other help