3 Replies Latest reply on Nov 29, 2019 9:45 AM by DubbsNix

    Is it bad to have two default routes (same gateway) one tied to NIC,one not?

    DubbsNix

      Basically as per the subject.  Whar are the conceivable issues with having to default routes whose only difference is one is tied to a network interface and one is not. i.e.

       

       

      netstat -rn

      Routing Table: IPv4
        Destination           Gateway           Flags  Ref     Use     Interface
      -------------------- -------------------- ----- ----- ---------- ---------
      0.0.0.0              100.100.XXX.XXX     UG        1          0
      default              100.XXX.XXX.XXX     2       6380 net0
      default              100.XXX.XXX.XXX     2     268875

       

       

      For extra points is there a way to remove a specific default route, as running route delete seems to always remove the first entry displayed from netstat -rn regardless of of whether you specify a NIC or not.

       

      thanks,

       

      Dave

        • 1. Re: Is it bad to have two default routes (same gateway) one tied to NIC,one not?
          Nohj

          Hi Dave,

           

          I am looking forward to the answer to two default routes question, often thought about how it works.

           

          I can answer the second part, if you add the IP to the delete command it deletes the specific route:

           

          route delete default 100.XXX.XXX.XXX

           

          Cheers,

          John

          • 2. Re: Is it bad to have two default routes (same gateway) one tied to NIC,one not?
            DubbsNix

            Hi John,

             

            thanks for your answer but the issue is the two routing entries share the same IP address. So, infact, I have been running:

             

            route delete default 100.XXX.XXX.XXX

             

            The problem is then deletes this entry,

             

            default              100.XXX.XXX.XXX     2       6380 net0

             

            When I want it to delete the one without the interface:

             

            default              100.XXX.XXX.XXX     2     268875

             

            I can delete both then add the interfaced one again, but was hoping to avoid that.

             

            thanks again,

             

            Dave

            • 3. Re: Is it bad to have two default routes (same gateway) one tied to NIC,one not?
              DubbsNix

              SO to answer my own question:

               

              I cannot find a way to delete a specific default route entry. So my solution was to remove the first entry:

               

              #route delete default 100.XXX.XXX.XXX

               

              then FROM THE CONSOLE:

               

              #route delete default 100.XXX.XXX.XXX ; route add default 100.XXX.XXX.XXX -ifp net0

               

              This then left only the desired entry in place. This was a better method then running #route flush and there was no noticeable impact as the change was instantaneous.

               

              Lastly, the answer is YES having two default routes defined causes problems. THe system uses them both in a round-robin fashion so if one of them doesn't work then you're gonna hit problems roughly %50 of the time.

               

              thanks to everyone who looked into this, and those that contributed.

               

              Dave