> Hi,
>     There are two things going on with the route setup.
> 
>     if [ "x$defaultrouter" != "xNO" ] ; then
>             static_routes="default ${static_routes}"
>             route_default="default ${defaultrouter}"
>     fi
> 
> 
>     1) since route_default is never used, it should be deleted, ignore that
> line above.

Wrong, it is evaluated when this line is executed:
                    eval route_args=\$route_${i}

I wrote this code 4 years ago, it works, has been working and
will continue to work.  Please, just leave the static/default route
stuff alone.  

> 
>     2) if you set defaultrouter to anything other than "NO", the
> static_route variable gets a "default" route
>          route label added, and this label will get evaled later on.
> 
> So rc.conf should read: (example from my setup)
> 
> 
> defaultrouter="YES"             # Set to default gateway (or NO).

No, the comment is correct as it stands, set it to ``NO'' or set
it to the IP address of the defaultroute + any funky route flags
you may want on it.

> static_routes="local"           # Set to static route list (or leave
> empty).
> route_local=" -net <net ip>  <host>"
> route_default=" default <host>"

Boo bad, your value of route_default will be smashed by rc.network
when it does ``route_default="default ${defaultrouter}"''.  You'll
end up with the command ``route add default YES'' being executed,
not something you really want :-)

> 
> So, two actions are needed. The route_default line from rc.network should
> get deleted, and the comment
> in rc.conf for the defaultrouter variable should be clearer.
> 
> If others agree, I can go and commit the fixes for that ....

NO!  Do not agree, read and understand what the trick above is,
``eval route_args=\${route_${i}'' when $i="default'' grabs the
route_default for you.


-- 
Rod Grimes - KD7CAX - (RWG25)                   rgri...@gndrsh.aac.dev.com
Accurate Automation, Inc.                   Reliable computers for FreeBSD
http://www.aai.dnsmgr.com


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to