From owner-freebsd-doc@FreeBSD.ORG Fri Jul 18 10:11:26 2003 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 32AB137B405 for ; Fri, 18 Jul 2003 10:11:26 -0700 (PDT) Received: from mail.ac-net.at (secure.ac-net.at [212.24.125.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF25C43FA3 for ; Fri, 18 Jul 2003 10:11:23 -0700 (PDT) (envelope-from shammer@daemon.li) Received: from localhost (server.ac-net.at [127.0.0.1]) by mail.ac-net.at (AC-net Mailserver v1.3a) with ESMTP id 373773FEC for ; Fri, 18 Jul 2003 19:11:14 +0200 (CEST) Received: from daemon.li (dsl-152-229.utaonline.at [62.218.152.229]) by mail.ac-net.at (AC-net Mailserver v1.3a) with SMTP id 08CAE3FE9 for ; Fri, 18 Jul 2003 17:11:12 +0000 (UTC) Received: (qmail 7925 invoked from network); 18 Jul 2003 17:12:33 -0000 Received: from localhost (HELO daemon.li) (127.0.0.1) by localhost with SMTP; 18 Jul 2003 17:12:33 -0000 Received: (from shammer@localhost) by daemon.li (8.12.6/8.12.7/Submit) id h6IHCWJ0007923; Fri, 18 Jul 2003 19:12:32 +0200 (CEST) (envelope-from shammer) Date: Fri, 18 Jul 2003 19:12:32 +0200 From: Josef El-Rayes To: Marc Fonvieille Message-ID: <20030718171232.GA7907@daemon.li> References: <200307180951.h6I9pDOx003423@daemon.li> <20030718101101.GA551@nosferatu.blackend.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <20030718101101.GA551@nosferatu.blackend.org> User-Agent: Mutt/1.4i Reply-Path: j.el-rayes@daemon.li X-Operating-System: FreeBSD 4.8-STABLE X-Virus-Scanned: by AMaViS 0.3.12 with AC-networks extensions cc: freebsd-docs@FreeBSD.org Subject: Re: docs/54610: [patch] adds route(8) examples to routing chapter X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: j.el-rayes@daemon.li List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 17:11:26 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Marc Fonvieille wrote: > I was thinking about that since a while; there's something missing in > your submission: how to "definitively" define a gateway (default > route): the rc.conf line... i added some text about defaultrouter and static_routes in /etc/rc.conf greets, josef -- www: http://www.daemon.li nic-hdl: JER1080312-NICAT FreeBSD PortMaintainer "Make World - Not War!" --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="chapter.sgml.diff" --- chapter.sgml.orig Thu Jul 17 23:48:58 2003 +++ chapter.sgml Fri Jul 18 19:10:28 2003 @@ -362,6 +362,66 @@ + + Manually define routing tables + manually define routing tables + + In some cases it is very useful to be able to dynamically define or manipulate the routing table on the command line. + This is achieved via the &man.route.8; command. For example, if you want to set the default route to a specific ip adress, + this is done by using the add parameter of the route command: + + + + &prompt.root;route add default 192.168.0.1 + add net default: gateway 192.168.0.1 + + + + Additional manipulation of the routing table is done via the + change and delete parameters. Use + flush to clear the whole routing table. + To receive specific information about how packages to a certain destination get + routed, there is the get parameter. + + + + Setting the routing table through route only + lasts until next reboot. To have the defaultrouter set on every + system startup automatically, define a defaultrouter in /etc/rc.conf + + + defaultrouter="192.168.0.1" + + This might also be achieved by using sysinstall. + + + For setting other routes than defaultrouter at startup, there is + following option in /etc/rc.conf + + static_routes="" + + + If you want to route traffic for subnet 192.168.1.1/24 to + 192.168.0.1 and all traffic for subnet + 192.168.2.1/24 to 192.168.0.2, + this has to be defined in /etc/rc.conf that way + + + static_routes="myroute myroute2" + route_myroute="192.168.1.1/24 192.168.0.1" + route_myroute2="192.168.2.1/24 192.168.0.2" + + + On system startup /etc/rc.networkparses the defined + routes and sets them by using route add. + + + To switch off all static routes by default, define + static_routes="NO" + + + + Dual Homed Hosts dual homed hosts --J2SCkAp4GZ/dPZZf--