Re: What's new on the 127.0.0/24 block in 7?




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


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

Quoting Greg Black <freebsd@xxxxxxxxxxxxx>:

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
---
_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Trouble with multiple IPs on one interface
    ... >So can onl ythe 'primary' IP for the interface can have a netmask of ... If thats the case, make the subnet mask ...
    (comp.unix.bsd.freebsd.misc)
  • Re: ipfw question
    ... >I do agree with you that they should have the same netmask. ... >be on the same interface! ... Since the subnet mask in this case is ...
    (FreeBSD-Security)
  • Re: Whats new on the 127.0.0/24 block in 7?
    ... The netmask specified on an alias line is important! ... assigned to lo0, ... For example, if you had a network region of 192.168.1.0/24 (in English, ... FBSD servers sharing the same setups, ...
    (freebsd-stable)
  • Re: Desired behaviour of "ifconfig -alias"
    ... > For a set of IPs in the same subnet on the same interface, ... > the primary IP be the one with the proper netmask, ... alias Establish an additional network address for this interface. ... inet 88.198.173.154 netmask 0xfffffff8 broadcast 88.198.173.159 ...
    (freebsd-stable)
  • Re: 2 Nics and default route
    ... >> kernel figures out which interface to use to get to it. ... >> If for some reason you want the cards addressed in the same subnet, ... >> be done by artificially restricting the netmask, ... All machines in the subnet should have the same netmask set and you ...
    (comp.unix.bsd.openbsd.misc)