ifconfig(8) syntax intuitiveness
hmp at backplane.com
Wed Aug 24 07:28:15 PDT 2005
Joseph Garcia wrote:
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
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.
More information about the Users