ifconfig(8) syntax intuitiveness

Joerg Sonnenberger joerg at britannica.bec.de
Wed Aug 24 07:23:22 PDT 2005


On Wed, Aug 24, 2005 at 03:26:17PM +0200, Erik P. Skaalerud wrote:
> Joseph Garcia wrote:
> >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
> >
> 
> I second this. I had problems with this when I first used IP aliasing on 
> FreeBSD long time ago because I had the wrong netmask set. (/24 instead 
> of /32).

It's not that easy. This has nothing to do with the interface, but is a
restriction from the routing stack. Once that restriction goes away,
there's no reason why aliases wouldn't allow it too.

> I second your thoughts about "delete". You don't delete it, you remove it.

You delete the route.

> I have another suggestion for ifconfig aswell. Show netmaskes in human 
> readable format (decimal) instead of HEX. I mean, who really thinks 
> about netmasks in HEX formats?

Me. Actually, decimal netmasks are *not* human readable, because it is
much harder to determine the *binary* affect they have.

Joerg





More information about the Users mailing list