cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
357
Views
10
Helpful
3
Replies

Only able to ping when static route to secondary is configured

nygenxny123
Level 1
Level 1

I added a static route on Router A to the secondary IP of router B

router B has these interfaces

interface FastEthernet0/0

ip address 192.168.1.236 255.255.255.0 secondary

ip address 192.168.21.236 255.255.255.0

Router A has this interface

interface FastEthernet0/0

ip address 192.168.1.250 255.255.255.0

I added this route to router A and was able to ping Router A from the 192.168.21.0 subnet

ip route 192.168.21.0 255.255.255.255.0 192.168.1.236 <----------(.1 subnet)

However, when I changed the route to this

ip route 192.168.21.0 255.255.255.255.0 192.168.21.236 <-----------(.21 subnet)

I was unable to ping router A from the 192.168.21.0 subnet

These are interconnected via 2950 switch

Both routers have routes to each other via "connected" fe0/0-which is connected to the 2950 to

the 192.168.1.0 subnet

Why do I need to add a static route ONLY on router A to ping back and forth, and

why does this only work if the static route is pointing to the secondary .1.236 address

of router B?

3 Replies 3

Edison Ortiz
Hall of Fame
Hall of Fame

Router B has created 2 subnets on its LAN interface. Router A only knows about one subnet (192.168.1.0/24). In order to reach another subnet, it needs to find a device (a router) that holds information about those other subnets.

On this case, Router B contains that information so you must instruct Router A that in order to reach 192.168.21.0/24, it must go via 192.168.1.236.

Yes, it's the same physical interface and that confuses things a little but that's how routing works.

HTH,

__

Edison.

Richard

There are some subtle aspects of your question that I would like to address as a supplement to the answer provided by Edison.

First let me observe that it is best practice when configuring secondary addresses to have all routers on that broadcast domain to use the same subnet as primary. And your configuration violates that. And the violation produces some interesting effects.

Then let me comment on your particular situation.

- router A believes that there is a single connected subnet (the "1" subnet). Therefore it will ARP for any address in that subnet and communicate directly with those addresses. For any other address it needs additional routing information. (especially to reach the "21" subnet it needs something like a static route).

- if the next hop address in the static route is in the "1" subnet then router A knows how to reach the next hop (it is in the connected subnet) and communication is successful.

- if the next hop address in the static route is in the "21" subnet then router A does not know how to reach the next hop (it does not yet know how to get to "21" since it is not a connected subnet) and communication fails.

As for the more specific questions at the end of your post, I would say:

- you need a static route on router A to ping back and forth. If router A is generating the ping then you need the static route to identify how to reach the destination. If router B is the source then you need a static route to forward the response packet.

- why does this only work if the static route is pointing to the secondary address? I believe that I addressed this since if the static route does not have a next hop address that is already reachable then the static route fails.

HTH

Rick

HTH

Rick

great explanations...thx!!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card