From owner-freebsd-questions Thu Dec 25 12:53:35 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA00830 for questions-outgoing; Thu, 25 Dec 1997 12:53:35 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id MAA00819 for ; Thu, 25 Dec 1997 12:53:28 -0800 (PST) (envelope-from stanb@awod.com) Received: from grizzly.fas.com (chs0267.awod.com [208.140.97.27]) by freefall.freebsd.org (8.8.6/8.8.5) with ESMTP id MAA01011 for ; Thu, 25 Dec 1997 12:49:26 -0800 (PST) Message-Id: <199712252049.MAA01011@freefall.freebsd.org> Received: by grizzly.fas.com ($Revision: 1.37.109.23 $/16.2) id AA105122999; Thu, 25 Dec 1997 15:49:59 -0500 Subject: Routeing help please. To: freebsd-questions@freebsd.com (Free BSD Questions list) Date: Thu, 25 Dec 1997 15:49:59 -0500 (EST) From: "Stan Brown" X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk I am trying to set up my FreeBSD laptop, so that it can connect to multiple networks and/or also call my home network via ppp. I have the ppp conection working as far as getting the link up, but I am strugling with routing. When the machine boots the folowing perl script is escruted: #!/usr/local/bin/perl %gateway = ('205.159.77.233' => { gw => '205.159.77.234', dns => ['205.159.77.240', '208.140.99.9', '198.81.225.1'], dom => 'fas.com', yp => 'yes" }, '222.198.37.141' => { gw => '222.198.37.254', dns => ['192.1.37.20'], dom => 'westvaco.com', yp => 'no" }, '192.168.0.3 -link0' => { gw => '192.168.0.1', dns => ['192.168.0.1'], dom => 'westvaco.com', yp => 'no" }, ); `route delete default 2>&1 > /dev/null`; foreach $key (keys(%gateway)) { $thiskey = $key; $up=1; `ifconfig ep0 inet $key netmask 0xffffff00`; unless (system("ping -c 1 $gateway{$key}{gw} > /dev/null")) { last; } print "Cannot ping $gateway{$key}{gw}\n"; $up=0; } if($up) { `route add default $gateway{$thiskey}{gw}`; open RESOLVFILE, "> /etc/resolv.conf"; print RESOLVFILE "domain $gateway{$thiskey}{dom}\n"; foreach $ipnum (@{$gateway{$thiskey}{dns}}) { print RESOLVFILE "nameserver $ipnum\n"; } close RESOLVFILE; print "Configured for network $gateway{$thiskey}{dom}\n"; } else { print "Cannot find a known network\n"; `/usr/bin/killall ypbind`; } Now here is the problem. If the machine is *not* conectedd to any of these networks, I still get the folowing routing table: Script started on Thu Dec 25 15:15:06 1997 # netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire 127.0.0.1 127.0.0.1 UH 3 203 lo0 192.168.0.1 link#5 UHLW 0 1 205.159.77 link#5 UC 0 0 205.159.77.234 link#5 UHLW 0 1 205.159.77.240 link#5 UHLW 0 11 222.198.37.254 link#5 UHLW 0 1 # ^Dexit Script done on Thu Dec 25 15:15:14 1997 Now as you can see, I have some pretty strange entries her. For each one of the networks that I tride I have this mysterios link#5 entry. route delete refuses to remove these entries. I also have a network entry for the last network that I tried. What are these entries, and how do I avoid creating them, or dlete them after I test for that network ? Thanks. -- Stan Brown stanb@netcom.com 770-996-6955 Factory Automation Systems Atlanta Ga. -- Look, look, see Windows 95. Buy, lemmings, buy! Pay no attention to that cliff ahead... Henry Spencer (c) 1997 Stan Brown. Redistribution via the Microsoft Network is prohibited.