Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jun 2000 19:35:27 -0700
From:      "Crist J. Clark" <cristjc@earthlink.net>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Confused by Loopback
Message-ID:  <20000623193527.B481@dialin-client.earthlink.net>
In-Reply-To: <20000623004145.B17268@hades.hell.gr>; from keramida@ceid.upatras.gr on Fri, Jun 23, 2000 at 12:41:45AM %2B0300
References:  <20000621205221.A43715@pool0586.cvx20-bradley.dialup.e> <20000623004145.B17268@hades.hell.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 23, 2000 at 12:41:45AM +0300, Giorgos Keramidas wrote:
> > $ netstat -rn
> > Routing tables
> >   
> > Internet:
> > Destination        Gateway            Flags     Refs     Use     Netif Expire
> > default            207.217.148.27     UGSc       11       22     tun0
> > 127.0.0.1          127.0.0.1          UH          0        0      lo0
> > 207.217.148.27     209.179.254.29     UH         12        0     tun0
> 
> While not connected to the network, I can see in my machine:
> 
>   % netstat -rn
>   Routing tables
> 
>   Internet:
>   Destination        Gateway            Flags     Refs     Use     Netif Expire
>   127.0.0.1          127.0.0.1          UH          1    11250      lo0

Yep. The 127-net is not there.

> > Notice there is no LAN entry for the 127-net like the ifconfig(8) mask
> > says. So if I were to do something silly like,
> > 
> >   $ ping 127.0.0.2
> >
> > It goes out over the tun0 interface. I noticed this because for some
> > perverse reason I tried,
> > 
> >   $ ping 127.255.255.255
> > 
> > And started getting replies from other hosts! I tried a traceroute(8)
> > and watched 127.0.0.2 packets make their happy way out towards the
> > I'net.
> > 
> > Tell me I'm missing something silly here.
> 
> You have not missed anything.  That is exactly the way it works.
> Why does it puzzle you?  Because a network route for 127.0.0.0/8 does
> not exist in your routing table by default?

Right. The netmask for the 127-net is 255.0.0.0. 127.0.0.2 should be
routed to the lo0 interface. It does not go to lo0 and heads out my
tun0. Why does it work that way? The loopback seems to be working
like, 127.0.0.1/32 and not 127.0.0.1/8

> If what puzzles you is that you actually *got* some replies back, you
> have to use a firewall to stop packets originating from, or destined to
> hosts in 127.0.0.0/8, from traversing your tun0 interface :)

I was not bothering to firewall my ppp. After firewalling on my cable
modem hookup, I did not figure dialing in a few minutes at a time was
much of a problem... now I wonder.
-- 
Crist J. Clark                           cjclark@alum.mit.edu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000623193527.B481>