3 Replies Latest reply: May 10, 2010 11:31 AM by user4994457 RSS

    More than one entry in /etc/defaultrouter

    807567
      To my surprise, it's possible to put more than one entry in /etc/defaultrouter. It's even documented in the man page and if you do it you end up with what looks like more than one default route. But what's does it mean to have more than one default route? Does the kernel apply some kind of heuristic to decide which one to use? Does the default route with no device get ignored?


      $ cat /etc/defaultrouter
      10.8.60.1
      10.8.127.1
      $ netstat -nrv

      IRE Table: IPv4
      Destination Mask Gateway Device Mxfrg Rtt Ref Flg Out In/Fwd
      -------------------- --------------- -------------------- ------ ----- ----- --- --- ----- ------
      default 0.0.0.0 10.8.60.1 1500* 0 1 UG 761582 0
      default 0.0.0.0 10.144.128.1 e1000g3 1500* 0 1 UG 3546367 0
      10.8.60.0 255.255.252.0 10.8.61.22 e1000g0 1500* 0 1 U 2703697 0
      10.144.128.0 255.255.252.0 10.144.131.243 e1000g3 1500* 0 1 U 119119 0
      224.0.0.0 240.0.0.0 10.8.61.22 e1000g0 1500* 0 1 U 0 0
      127.0.0.1 255.255.255.255 127.0.0.1 lo0 8232* 0 52 UH 22475898 0
      $
        • 1. Re: More than one entry in /etc/defaultrouter
          user4994457
          john_lilburne wrote:
          To my surprise, it's possible to put more than one entry in /etc/defaultrouter. It's even documented in the man page and if you do it you end up with what looks like more than one default route. But what's does it mean to have more than one default route?
          Probably not what you want.
          Does the kernel apply some kind of heuristic to decide which one to use? Does the default route with no device get ignored?
          Round robin.

          What do you mean by "no device"? You have to have an IP destination or the route couldn't be configured. But that IP destination doesn't have to be currently available. Unplugging a cable doesn't take an IP interface "DOWN", nor does it modify the routing table.

          If you need dynamic, failure-resilient routing, then you'd have to run a routing update protocol. The contents of /etc/defaultrouter are for static routes.

          --
          Darren
          • 2. Re: More than one entry in /etc/defaultrouter
            807567
            By "no device" I meant that the first route listed as default didn't have anything under the "Device" column in the netstat output. Kinda hard to tell from my posting - I should have used one of the HTML tags to format the posting but I'm still learning.
            • 3. Re: More than one entry in /etc/defaultrouter
              user4994457
              I see that iin the output now. That's pretty odd since it appears to be a perfectly normal route. Multiple default routes are so rarely used that I'm not sure if that's normal behavior or not.

              --
              Darren