Hi seniors, On what basis a CISCO IOS decides to drop a packet or forward a packet, I mean how a packet with 192.168.10.1 will be match with the follwing table
I am not caring for outgoing ports, just want to know how IOS will decide about the route, with classless & classful. regards, Tahir
A router maintains a routing table for various networks. It learns about networks through dynamic routing protocols, static routes, or by virtue of being directly conneected to the network.
Giving you a simple, abridged version of things, when a router receives a packet on one of its interfaces, it will examine the destination address in the IP datagram.
It will then look in its routing table for a route to the network. If the destination address falls within the range of one of the networks it has in its routing table, it will forward it according to the next hop given in the routing table entry. If it has more than one route, it will take the route with the longest prefix match.
So, if it has a route to 192.168.0.0/16 and 192.168.10.0/30, it will route according to the latter - the more specific entry (longest prefix match), even though 192.168.0.0 includes the host address.
To answer your question regarding the 192 address you gave us, you must understand subnet masks. The IP address 192.168.10.1 is a host address that falls within network 192.168.10.0/30. The /30 mask will give you 4 addresses:
192.168.10.0 <---subnet address
192.168.10.1 <---host address
192.168.10.2 <---host address
192.168.10.3 <---Directed broadcast
For the router to successfully route subnets of major networks, you should have the ip classless command configured on the router. Of course, you would also have to deploy a routing protocol that supports classless routing and VLSM, like OSPF or EIGRP.
Volumes can be written about all this, so this is just a basic overview to answer your specific question.
IF so, please rate this post.