ifconfig(8) syntax intuitiveness

Hiten Pandya hmp at backplane.com
Wed Aug 24 07:28:15 PDT 2005


Joseph Garcia wrote:
Greetings.

I just wanted to bounce some ideas off of you guys. It’s petty stuff,
but it’s usability feedback nonetheless.
First let me start off by quoting the ifcconfig(8) man page:

"The ifconfig utility is used to assign an address to a network
interface and/or configure network interface parameters.  The ifconfig
utility must be used at boot time to define the network address of each
interface present on a machine; it may also be used at a later time to
redefine an interface's address or other operating parameters."
I was using ifconfig when it occurred to me how non-intuitive it is
having to use 255.255.255.255 as the netmask when adding an address
that is on the same subnet as an address already on the interface. For
example, if you already have 192.168.0.1/24 on fxp0, then you should be
able to add the following address with this command:
	ifconfig fxp0 add 192.168.0.2 netmask 255.255.255.0

instead of:

	ifconfig fxp0 add 192.168.0.2 netmask 255.255.255.255

The latter just doesn't seem very intuitive, because 255.255.255.255 is
generally used as a netmask in point-to-point connections, where the
other endpoint must be configured as well.
This is actually a gripe I had with ifconfig(8) for many years but just
dealt with it. I hear this is a FreeBSD-ism which is not present in
NetBSD. I can't confirm that since I don't use NetBSD. Perhaps someone,
far more talented than I, can fix this to work in a more intuitive way.
I also understand that “alias” is the same thing as “add” and “–alias”
is the same thing as “delete”. Personally, I never really did like the
alias/-alias commands because they didn’t seem like the right verb to
be using for the type of action that I was doing. I thought, “I’m not
aliasing an address to the interface. I’m adding it to the interface.”
Actually, this is fine the way it is because people can use what they
like. Although, I do like the verb "remove" better than "delete".
Again, that's because I felt that I was "removing" an address from an
interface and not "deleting" an address.
Many of the names (will) remain to retain as much compatibility as 
possible with system scripts from other operating systems, like SunOS, etc.

As for the netmask issue, I am not really sure why it is doing that.

			-Hiten





More information about the Users mailing list