5 Replies Latest reply on Feb 20, 2013 1:51 PM by noor

    static /32 route more-specific than connected /24 route?

    esfb8zs New Member

      Can a NetVanta 5305 have a static route that is more-specific than a connected route?

       

      For example, could a NetVanta be configured with:

      Switch -> VLNANs -> IP Settings -> IP Address = 10.0.0.1 and Subnet Mask = 255.255.0.0

      ...and also configure

      Router/Bridge -> Route Table -> Destination Address = 10.0.0.33 and Destination Mask 255.255.255.255, and Gateway -> Address = 10.0.0.254

       

      What I'd like is for packets to 10.0.0.2 through .254 be handled normally as part of the connected VLAN, except packets for 10.0.0.33 would be sent to 10.0.0.254 instead.

       

      I'm guessing that this depends on how the route lookup is performed (by netmask then connected-versus-static; or by route type, then by netmask).

        • Re: static /32 route more-specific than connected /24 route?
          Employee

          esfb8zs -  - When a route table lookup is performed, routes of different types use a metric called the "administrative distance" to determine route preference. A connected route will always be preferred over a static route. This is because a connected route has an administrative distance of 0 while a static route, by default, has an administrative distance of 1. The route type with the lower administrative distance will be preferred.

           

          Below is a table of well known route types and their administrative distances:

           

          Route TypeAdminstrative Distance
          Connected0
          Static1
          BGP (external)20
          OSPF110
          RIP120
          BGP (internal)200

           

          It is also important to keep in mind that connected routes reflect the networks that the router sees as local. These routes are added automatically when an interface is configured with an IP address and subnet mask and is in an "up" state. In fact, if a destination IP address is part of a device's local network, it will not "route" the traffic, but instead use ARP to send traffic instead.

           

          Unfortunately, adding a static route, such as you did, will not work as it will always prefer the connected route. In fact, any packet destined for a 10.0.x.x IP address (based on the subnet mask you mentioned above) will not go through any gateway and will simply use ARP to get to its destination.

           

          Please do not hesitate to let us know if you have any questions.

           

          Thanks,

          Noor

            • Re: static /32 route more-specific than connected /24 route?
              kworm New Member

              Noor,

               

              I don't believe you are correct about this.  I think the more specific route for the /32 will be looked up and used before the connected route with the /24.  If not I think this would be an ip routing bug on the Netvanta platform.  Every IP router I have seen will consider the most specific route (most subnet mask bits) first and then other things like metrics assuming there are multiple routes with the same number of mask bits.  I don't have access to a Netvanta, but on an Total Access 908 it will the use the /32 route in the way esfb8zs inquired about.

               

              Kevin

                • Re: static /32 route more-specific than connected /24 route?
                  Employee

                  Kevin,

                   

                  You are right, I was incorrect about this. The administrative distance is used to select which route will be in the route table when they share the same network and network mask. The most specific route in the route table will be used when a destination IP address falls within multiple network routes.

                   

                  esfb8zs - Specifying the routes as you did in your original post should work as long as the source IP address is not in the same network as the 10.0.x.x network. The reason for this is that any device in the 10.0.x.x network will use ARP for any destination IP address within its network. The traffic will never reach your AOS device. The way to get around this would be to add a /32 route on your device as you did on the NetVanta.

                   

                  Please do not hesitate to let us know if you have any further questions.

                   

                  Thanks,

                  Noor

                    • Re: static /32 route more-specific than connected /24 route?
                      Employee

                      esfb8zs -

                      I went ahead and flagged this post as “Assumed Answered.”  If any of the responses on this thread assisted you, please mark them as either Correct or Helpful answers with the applicable buttons.  This will make them visible and help other members of the community find solutions more easily.  If you still need assistance, I would be more than happy to continue working with you on this - just let me know in a reply.

                       

                      Noor

                        • Re: static /32 route more-specific than connected /24 route?
                          Employee

                          I went ahead and flagged the "Correct Answer" on this post to make it more visible and help other members of the community find solutions more easily. If you don't feel like the answer I marked was correct, feel free to come back to this post and unmark it and select another in its place with the applicable buttons.  If you still need assistance, we would be more than happy to continue working with you on this - just let us know in a reply.

                           

                          Thanks,

                          Noor