Return to BSD News archive
Xref: sserve comp.unix.advocacy:541 comp.unix.bsd:13358 Path: sserve!newshost.anu.edu.au!dubhe.anu.edu.au!sirius.anu.edu.au!not-for-mail From: paulus@cs.anu.edu.au (Paul Mackerras) Newsgroups: comp.unix.advocacy,comp.unix.bsd Subject: Re: Is this a bug in Net2 IP code? Date: 7 Feb 1994 10:43:50 +1100 Organization: Department of Computer Science, Australian National University Lines: 27 Message-ID: <2j3vbmINNlok@sirius.anu.edu.au> References: <2ile8a$rh1@gap.cco.caltech.edu> <a09878.760154448@giant> <2inv6s$k1u@mail.fwi.uva.nl> <a09878.760220945@giant> NNTP-Posting-Host: sirius.anu.edu.au a09878@giant.rsoft.bc.ca (Curt Sampson) writes: >casper@fwi.uva.nl (Casper H.S. Dik) writes: >>For ethernet interfaces an ``ifconfig <if> inet <addr> netmask <mask>'' >>results in a route to the *net* ``<addr> & <mask>''. >>For the loopback interface this results in a route to *host* 127.0.0.1. >>If there are no special checks on the loopback net, all packets >>destined for 127.0.0.2 are going to be put out on the ethernet, >>provided there is a default route. >You're right, actually; this looks like a bug to me too. Now that >I look more closely at my system, I find that an attempt to ping >127.0.0.2 produces "no route to host" (I don't have a default route >set). Shouldn't the ifconfig produce a route to the loopback interface >for all of 127.0.0.0, given a netmask of 0xff000000, rather than >just a route to 127.0.0.1? No; there is a distinction between network routes and host routes. Routes through point-to-point interfaces, such as the loopback interface (as well as the slip and ppp interfaces), are host routes. Host routes are used in preference to network routes if both apply. Another way to look at is that host routes have a netmask of 0xffffffff. Paul Mackerras Dept. of Computer Science Australian National University.