Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just out of curiosity, let's say I have a forwarding table in an IP router that looks like this:    Interface 4    Interface 3    Interface 2
default           Interface 1

The router have the following incomming datagrams to deal with:


Does the forwarding plane use the longest prefix matching rule here to determine on which interface the datagram should be forwarded?

Then datagram 1 should be sent to interface 3, 2->4, 3->4, 4->2 and 5->2...? Right?

share|improve this question
up vote 1 down vote accepted

No, datagrams 3 and 5 will be send to the default gateway through interface 1, because there is no subnet route to these destinations.

Check out the output of sipcalc:

$ sipcalc
-[ipv4 :] - 0

Host address            -
Host address (decimal)  - 2251438080
Host address (hex)      - 86323800
Network address         -
Network mask            -
Network mask (bits)     - 22
Network mask (hex)      - FFFFFC00
Broadcast address       -
Cisco wildcard          -
Addresses in network    - 1024
Network range           - -
Usable range            - -

The 3rd datagram, with IP address, is not within the range of this network, and this is the same for packet n°5.

An interesting reading is Evan answer at How does ipv4 subnetting works.

share|improve this answer
Petrus: is there a quick way to calculate the network range? – Lasse A Karlsen Nov 27 '12 at 21:53
@LasseAKarlsen: it's just a logical AND between address and netmask. Do it manually or with an ip calculator. – petrus Nov 27 '12 at 22:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.