From owner-freebsd-stable Thu Nov 18 7:22:23 1999 Delivered-To: freebsd-stable@freebsd.org Received: from melete.ch.intel.com (melete.ch.intel.com [143.182.246.25]) by hub.freebsd.org (Postfix) with ESMTP id 424C315426 for ; Thu, 18 Nov 1999 07:22:14 -0800 (PST) (envelope-from jreynold@sedona.ch.intel.com) Received: from sedona.intel.com (sedona.ch.intel.com [143.182.218.21]) by melete.ch.intel.com (8.9.1a+p1/8.9.1/d: relay.m4,v 1.11 1999/11/10 17:27:15 spurcell Exp $) with ESMTP id PAA27966 for ; Thu, 18 Nov 1999 15:21:57 GMT Received: from hip186.ch.intel.com (hip186.ch.intel.com [143.182.225.68]) by sedona.intel.com (8.9.1a/8.9.1/d: sendmail.cf,v 1.8 1999/04/16 15:25:49 steved Exp steved $) with ESMTP id IAA03325 for ; Thu, 18 Nov 1999 08:22:09 -0700 (MST) X-Envelope-To: X-Envelope-From: jreynold@sedona.ch.intel.com Received: (from jreynold@localhost) by hip186.ch.intel.com (8.9.1a/8.9.1/d: client.m4,v 1.3 1998/09/29 16:36:11 sedayao Exp sedayao $) id KAA22351; Thu, 18 Nov 1999 10:22:34 -0500 (EST) From: John Reynolds~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14388.6585.781834.681200@hip186.ch.intel.com> Date: Thu, 18 Nov 1999 08:22:33 -0700 (MST) To: freebsd-stable@freebsd.org Subject: defaultrouter variable in /etc/rc.conf -- Used? X-Mailer: VM 6.75 under Emacs 19.34.1 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello all, First off, I'd like to thank every single person who ever contributed a line of code or docs to FreeBSD! I've recently put togther a small machine to act as a firewall and gateway for a home network (connected to cable modem) and the code and docs have just been wonderful (when I don't have to ask a question, it's straight forward )! However, I've run into something that has bewildered me in the setup for one of my networked machines (behind firewall). I needed to add a default route so that all packets would be sent to the gateway. No problem. A little looking around at /etc/defaults/rc.conf and the man page for said file and I find: defaultrouter (str) If not set to NO then create a default route to this host name or IP address (use IP address value if you also require this router to get to a name server!) Great! Sounds like just what I need. However, upon rebooting, things did not work as expected. I track things down to the following code in rc.network (my machine has been freshly CVSuped and mergemastered). # Configure routing if [ "x$defaultrouter" != "xNO" ] ; then static_routes="default ${static_routes}" route_default="default ${defaultrouter}" fi # Set up any static routes. This should be done before router discovery. if [ "x${static_routes}" != "x" ]; then for i in ${static_routes}; do eval route_args=\$route_${i} route add ${route_args} done fi So, $defaultrouter is appended to the string "default " and set into the route_default variable. Fine. However, route_default isn't used ANYWHERE in this file nor seen in any other rc* files. ? Additionally, even if you don't have a list of static routes in your /etc/rc.conf, the "if" section for the static routes will execute (and not do very much but make "route" commands that fail due to incorrect usage) because the static_routes variable is prepended with "default " too ("x${static_routes}" != "x" is always true). I think I understand what the defaultrouter variable in rc.conf was supposed to trigger. I'm less clueful as to what static_routes is supposed to accomplish, but my local hack to make things work the way I needed them was to make this section of rc.network appear as follows: if [ "x$defaultrouter" != "xNO" ] ; then # static_routes="default ${static_routes}" # route_default="default ${defaultrouter}" route add default ${defaultrouter} fi Now upon boot, the proper "route add default" command is run with my value for defaultrouter and the static_routes "if" statement doesn't trigger anything to happen (which seems to be okie dokie to me). Is defaultrouter a deprecated variable in defaults/rc.conf? It doesn't appear to be. If not, is the above what "should be" in rc.network to accomplish this default route? Finally, why was the static_route variable being prepended with the word "default " too? What is the appropriate thing to do with static_routes from rc.conf? I have things working "ok for me" but I figured with Jordan's message yesterday about a code slush coming at the end of this month, I'd better bring this up so that we get it fixed. -Jr ps: I did not send-pr this because I'm not sure what the "static_routes" variable "should do" .... -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | John Reynolds CEG, CCE, Next Generation Flows, HLA | | Intel Corporation MS: CH6-210 Phone: 480-554-9092 pgr: 868-6512 | | jreynold@sedona.ch.intel.com http://www-aec.ch.intel.com/~jreynold/ | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message