Date: Tue, 26 Sep 2000 10:10:02 -0700 (PDT) From: Ruslan Ermilov <ru@sunbay.com> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/21561: route takes the netmask as the default gateway, creating a bad route. Message-ID: <200009261710.KAA53526@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/21561; it has been noted by GNATS. From: Ruslan Ermilov <ru@sunbay.com> To: madamus@connectalk.com Cc: bug-followup@FreeBSD.org Subject: Re: misc/21561: route takes the netmask as the default gateway, creating a bad route. Date: Tue, 26 Sep 2000 20:01:19 +0300 On Tue, Sep 26, 2000 at 07:53:33AM -0700, madamus@connectalk.com wrote: > > route -n add -net 10.150.200.0 255.255.252.0 10.125.200.199 > > will add a bad route to the system. A route that can't be deleted. > > It looks like this using "netstat -rn" > Destination Gateway Flags Netif Expire > default 10.125.204.1 UGSc 3 9 fxp0 > 10.20.200&0xa7dc8c7 255.255.252.0 UGSc 0 0 fxp0 > > the correct route command should be: > route -n add -net 10.150.200.0 -netmask 255.255.252.0 10.125.200.199 > > Comment: route should not allow this. > Nope, the route(1) is correct about it. Actually (and I think it is provided for backwards compatibility, thus undocumented) the format is: route [-n] command [-net | -host] destination gateway [netmask] ^^^^^^^ So, the route -n add -net 10.150.200.0 255.255.252.0 10.125.200.199 is equivalent to the route -n add -net 10.150.200.0 -netmask 10.125.200.199 255.255.252.0 You will get the same `weird' route in the second case. To delete this route, simply execute: route delete 10.20.200.0 -netmask 10.125.200.199 To add the correct route, either: route add -net 10.150.200.0 -netmask 255.255.252.0 10.125.200.199 or route add -net 10.150.200.0 10.125.200.199 255.255.252.0 or route add 10.150.200.0/22 10.125.200.199 Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009261710.KAA53526>