ifconfig refactoring for FreeBSD
Dan writes "Based on Sam Leffer's suggestion, Bruce Simpson has been working on refactoring ifconfig(8). ifconfig is a FreeBSD unix utility used to assign an address to a network interface and/or configure network interface parameters. Bruce says that ifconfig has grown increasingly large and become unwieldy. Part of the effort has been to get a handle on all of the options that are currently supported so he has written a YACC grammar for it. He has uploaded some grammer, created a design document and also generated a PDF file you can view which shows you syntax diagrams for each part of the parse tree."
For those of you who do not know what YACC is all about
Its good to see something like this happening as ifconfig is not only used on FreeBSD but also on most (all?) Linux distros.
Ifconfig is just one of the many contributions the BSD projects have given to the Linux and UNIX community.
PS: To all those "bsd is dying" trolls, things like this show its not. Without the work of the BSD projects you wouldn't have some of the many tools you use each day.
(\(\
(^.^)
(")")
*This is the cute bunny virus, please copy this into your sig so it can spread
Starting with FreeBSD 4.x, ifconfig with no arguments simply lists all interfaces the kernel has found, and their configuration details.
(the actual output has tabs to make the formatting a little prettier)The quick answer is "Yes, you can." In FreeBSD 5 for instance you can change a line in rc.conf and then just rerun the script for the daemon that corresponds to it. It's a bit like the init.d scripts in Linux except with a big global variables file. In FreeBSD 4 you can do it as well, but if I recall the scripts in FreeBSD 4 often lump several daemons together into a single file so you might end up restarting more than one daemon. I may be wrong, though. Brian
My Company
There is no "GNU ifconfig". Linux has it's own version which is probably based on an old BSD version, or, maybe written from scratch.
% ifconfig -V
net-tools 1.60
ifconfig 1.42 (2001-04-13)
You can tell it's not GNU because it doesn't spout on about the GPL everytime you run it.
That's already in there: /bin/sh /etc/netstart
This reads the network settings from rc.conf and reconfigures the interfaces and routes based on that info.
ifconfig is just the older, more compatible way to config the interfaces for those who grew up using older Linuxes and other Unices. You can do everything ifconfig + iptables using ip + tc and more.
So before anyone claims that Linux's ifconfig sucks and is too complicated, they've already made a better replacement for it, just needs more documentation and exposure.