Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Mar 2008 00:53:07 -0500 (EST)
From:      Andy Dills <andy@xecu.net>
To:        "Chris H." <chris#@1command.com>
Cc:        Greg Black <freebsd@mail.gbch.net>, freebsd-stable@freebsd.org
Subject:   Re: What's new on the 127.0.0/24 block in 7?
Message-ID:  <20080305002142.T37745@shell.xecu.net>
In-Reply-To: <20080304173032.2n9lrst6ewww4kos@webmail.1command.com>
References:  <200803040619.m246Jbja018523@drugs.dv.isc.org> <20080304000320.msp5bfrytc0wsowg@webmail.1command.com> <1204625690.2126.181.camel@localhost> <20080304024831.fh4h1s3hggg444c0@webmail.1command.com> <20080304110042.GB84355@eos.sc1.parodius.com> <20080304033914.hbevsjq9gkc0o4os@webmail.1command.com> <nospam-1204638408.88196@joker.yaxom.com> <20080304173032.2n9lrst6ewww4kos@webmail.1command.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Just to provide a little information in case there is still confusion...


On Tue, 4 Mar 2008, Chris H. wrote:

> Quoting Greg Black <freebsd@mail.gbch.net>:
> 
> > On 2008-03-04, Chris H. wrote:
> > 
> > > Yes, adding an entry in /etc/rc.conf that provides 254 IP's now
> > > reveals:
> > > lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> > >        inet6 ::1 prefixlen 128        inet6 fe80::1%lo0 prefixlen 64
> > > scopeid 0x3        inet 127.0.0.1 netmask 0xffffff00
> > > 
> > > as opposed to: 0xffffffff.
> > 
> > If you think the above shows evidence of providing 254 IP addresses,
> > it's really time either to catch up on some sleep or learn how these
> > things work.
> 
> Quite so. That was my point; adding netmask 255.255.255.0
> (0xffffff00) gave me 254 addresses. While the netmask
> 0xffffffff provides 1.

At the risk of being pedantic, I'm afraid that isn't true. If adding 
netmask 255.255.255.0 provided 255 addresses, adding the (default in every 
version of FreeBSD I'm aware of) netmask of 255.0.0.0 would provide 
255x255x255 addresses. That said, there is no way to ifconfig multiple 
addresses with a single address entry.

The netmask of an IP bound to an interface determines the scope of the 
logical network that can be reached through the given interface, not a 
range of addresses bound to the interface. So, 127.0.0.1 with a mask of 
255.255.255.0 means 127.0.0.0-255 would be reachable via lo0, whereas 
127.0.0.1 with a mask of 255.0.0.0 means 127.0-255.0-255.0-255 would 
be reachable via lo0.

In neither case would 127.0.0.2 be bound to lo0 implicitly, you would need 
to explicitly ifconfig them as aliases for them to be bound to lo0.

No worries regardless, netmasks are a common source of misunderstanding 
and confusion. In a routing context, the subnet mask does indeed affect 
every address within the subnet, however when binding addresses to an 
interface, the subnet mask merely controls which addresses are reachable 
locally on layer 2.

Andy

---
Andy Dills
Xecunet, Inc.
www.xecu.net
301-682-9972
---



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