From owner-freebsd-bugs Tue Jan 25 7:23: 1 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id D36BA14D05; Tue, 25 Jan 2000 07:22:59 -0800 (PST) (envelope-from ru@FreeBSD.org) Received: (from ru@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA61853; Tue, 25 Jan 2000 07:22:54 -0800 (PST) (envelope-from ru@FreeBSD.org) Date: Tue, 25 Jan 2000 07:22:54 -0800 (PST) From: Message-Id: <200001251522.HAA61853@freefall.freebsd.org> To: jin@george.lbl.gov, ru@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: bin/2258: route add/delete [network] xxx.yyy.zzz.0 my-IP Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Synopsis: route add/delete [network] xxx.yyy.zzz.0 my-IP State-Changed-From-To: open->closed State-Changed-By: ru State-Changed-When: Tue Jan 25 06:56:21 PST 2000 State-Changed-Why: The third argument of the route(8) (in the "old form") is treated as a netmask value, so the following command # route add 198.207.143.0 127.0.0.1 1 is, in fact, only a short equivalent of the # route add -net 198.207.143.0 -netmask 1 127.0.0.1 You can see this with the following (non-destructive) command: # route -vnt add -net 198.207.143.0 -netmask 1 127.0.0.1 [...] sockaddrs: 198.207.143.0 127.0.0.1 0.0.0.1 add net 198.207.143.0: gateway 127.0.0.1 Applying mask of 0.0.0.1 to 198.207.143.0 gives 0.0.0.0/0.0.0.1. That is what is actually stored in the kernel routing table. To delete this entry, simply execute: # route delete 0 -netmask 1 To dump the entire routing table (note the magic -d option), run: # route -vnd flush Actually, the only problem is the way netstat(1) reports "default" route for (in fact) non-default routes, but this has already been fixed in 4.0-CURRENT (see src/sbin/route/route.c,v 1.41). I will be MFC'ing this into -STABLE right now. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message