Print this page
want to add link-local routes first

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/milestone/net-routing-setup
          +++ new/usr/src/cmd/svc/milestone/net-routing-setup
↓ open down ↓ 76 lines elided ↑ open up ↑
  77   77  # replace those added by the kernel during diskless booting.  An
  78   78  # empty "/etc/defaultrouter" file will cause the default route
  79   79  # added by the kernel to be deleted.
  80   80  #
  81   81  # Note that the default router file is ignored if we received routes
  82   82  # from a DHCP server.  Our policy is to always trust DHCP over local
  83   83  # administration.
  84   84  #
  85   85  smf_netstrategy
  86   86  
       87 +#
       88 +# Read /etc/inet/static_routes.vmadm and add each route.
       89 +#
       90 +if [ -f /etc/inet/static_routes.vmadm ]; then
       91 +        echo "Adding vmadm persistent link-local routes:"
       92 +        /usr/bin/egrep -v "^(#|$)"  /etc/inet/static_routes.vmadm | /usr/bin/egrep -e "-interface " | while read line; do
       93 +                /usr/sbin/route add $line
       94 +        done
       95 +fi
       96 +
  87   97  if [ "$_INIT_NET_STRATEGY" = "dhcp" ] && \
  88   98      [ -n "`/sbin/dhcpinfo Router`" ]; then
  89   99          defrouters=`/sbin/dhcpinfo Router`
  90  100  elif [ -f /etc/defaultrouter ]; then
  91  101          defrouters=`/usr/bin/grep -v \^\# /etc/defaultrouter | \
  92  102              /usr/bin/awk '{print $1}'`
  93  103          if [ -n "$defrouters" ]; then
  94  104                  #
  95  105                  # We want the default router(s) listed in
  96  106                  # /etc/defaultrouter to replace the one added from the
↓ open down ↓ 112 lines elided ↑ open up ↑
 209  219  # Read /etc/inet/static_routes and add each route.
 210  220  #
 211  221  if [ -f /etc/inet/static_routes ]; then
 212  222          echo "Adding persistent routes:"
 213  223          /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes | while read line; do
 214  224                  /usr/sbin/route add $line
 215  225          done
 216  226  fi
 217  227  
 218  228  #
 219      -# Read /etc/inet/static_routes.vmadm and add each route.
      229 +# Read /etc/inet/static_routes.vmadm and add each non-link-local route.
 220  230  #
 221  231  if [ -f /etc/inet/static_routes.vmadm ]; then
 222  232          echo "Adding vmadm persistent routes:"
 223      -        /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes.vmadm | while read line; do
      233 +        /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes.vmadm | /usr/bin/egrep -v -e "-interface " | while read line; do
 224  234                  /usr/sbin/route add $line
 225  235          done
 226  236  fi
 227  237  
 228  238  #
 229  239  # Log the result
 230  240  #
 231  241  echo "Routing setup complete:"
 232  242  /usr/bin/netstat -rn
 233  243  
 234  244  # Clear exit status.
 235  245  exit $SMF_EXIT_OK
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX