ifconfig refactoring for FreeBSD 125
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."
How about live /etc/rc.conf changes? (Score:1, Insightful)
Re:How about live /etc/rc.conf changes? (Score:3, Interesting)
Can't you just run
Re:How about live /etc/rc.conf changes? (Score:5, Informative)
Re:How about live /etc/rc.conf changes? (Score:2)
Re:How about live /etc/rc.conf changes? (Score:4, Informative)
This reads the network settings from rc.conf and reconfigures the interfaces and routes based on that info.
Wondering what YACC is? (Score:5, Informative)
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.
Re:Wondering what YACC is? (Score:3, Insightful)
They all have an ifconfig (even windows has, but it's spelled ipconfig), but a different one. The GNU version takes different arguments anyway - like for example none at all, which the FreeBSD version doesn't allow - so this will most likely not affect any Linux user in any way.
Re:Wondering what YACC is? (Score:1, Informative)
You are an idiot.
user@hemlock$ ifconfig
rl0: flags=8843 mtu 1500
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::248:54ff:fe85:5624%rl0 prefixlen 64 scopeid 0x1
ether 00:48:54:85:56:24
media: Ethernet autoselect (100baseTX )
status: active
lp0: flags=8810 mtu 15
Re:Wondering what YACC is? (Score:4, Funny)
Re:Wondering what YACC is? (Score:2)
eg external interface on a NAT box where the cable modem's network port is 10 megabit half duplex.
Cheapo = good (Score:1)
The 3coms don't like it when there's more than one in my firewall, the realteks work just fine. Only setting the macaddress didn't go well, so that's why the 3com on the outside.
Re:Cheapo = good (Score:2)
Re:Wondering what YACC is? (Score:2)
Re:Wondering what YACC is? (Score:1)
Re:Wondering what YACC is? (Score:2)
I've heard that the C and D variant fixed a lot of issues and I've had great success with them.
However, I'd like to nominate a contender. Davicom. I've had some extreme difficulties getting some Davicom NICs working at all without dropping connection or extreme speed problems. Under Win2k SP4, Debian Linux and OpenBSD. Admittedly these were all on-board in two classrooms I was challenged with. So the problems may have been with the implementatio
Re:Wondering what YACC is? (Score:2)
Re:Wondering what YACC is? (Score:2)
Not true. From the ifconfig manpage in FreeBSD (actually DragonFly, but who cares. Dfly didn't change ifconfig):
Using ifconfig w/out arguments (Score:5, Informative)
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)GNU ifconfig - What? (Score:5, Informative)
% 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.
Re:GNU ifconfig - What? (Score:3, Funny)
Re:Wondering what YACC is? (Score:4, Insightful)
You heard it here first: The Slashdot BSD Section is Dying.
Re:Wondering what YACC is? (Score:4, Interesting)
The conclusion that I have come to is that the /. editors just don't care about BSD. And the editors probably use the above quote to get out of anything us BSD users might find interesting. Mathmatically, it would be represented, "Linux == Interesting; BSD != Linux; BSD != Interesting" and since "BSD != Linux then BSD MUST be dying."
And I think that your absolutely right, about them not knowing what is worthy of reporting and what is not. When I first read the Refacturing of IFCONFIG, the thought that went through my mind was, "Who cares?" It really has no bearing on the useability of the OS. I think the real issue is that /. needs to put some one who actually uses BSD as an OS doing the editing. I think then, we might see some interesting.
Personally I think that the comment about BSD users getting BSD news elsewhere is pretty insightful. The only reason I read /. is because there are other technology issues which I am interested in and the Linux movement does facinate me. But nontheless, with the general bigotted spirit towards the BSD's, I can see why I, and most likely others go elsewhere.
A while back I fired off an email to address the concerns of us BSD users. The reply I got back from CdrTaco was essentially if more BSD users read /., then the trolls would be silenced with more BSD users moderating, and more /. stories would be about BSD, because there would be more submissions.
Well, I'll get off my soap box now, and wait till I get moderated down. Any bets on what it will be? Flamebait? Or maybe Off Topic. But moderators, if I can not be insightful or interesting, please vote for Flamebait.
Re:Wondering what YACC is? (Score:5, Interesting)
The ifconfig thread is interesting from a number of perspectives. Given that ifconfig is perhaps the command-line utility embodying BSD's decades-old networking legacy, it takes some courage to propose a radical reworking of it. Using a formal grammar rather than the ad hoc accretion of command-line options that 95% of Unix/Linux utilities use is another bold step. And opening the way to added functionality (one of the motivations for this project) adds to the interest. Sure, just looking at the surface it's easy to say "so they're changing some arguments to some crufty old Unix command -- ho hum." But it may well represent the initial step in a complete rethinking of how networking is administered at the host level. Even if it doesn't pan out that way, it's worth taking notice.
BTW, I don't moderate BSD stories any more. When I mod down the trolls, I tend to get slammed in metamod. (Talk about a hostile environment!) Hope springs eternal, though -- I keep thinking that /. will eventually start doing some housekeeping.
Re:Wondering what YACC is? (Score:2)
umm, no. ifconfig on freebsd with no arguments will run the equivalent of 'ifconfig -a'.
Re:Wondering what YACC is? (Score:3, Informative)
When was the last time you used FreeBSD?
$ uname
FreeBSD
$ ifconfig
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST > mtu 1500
inet 192.168.1.10 netmask 0xffffff00 broadcast 192.168.1.255
[snip]
FreeBSD has the best ifconfig of all Unices I've used. My favorite part is being albe to use the slash notation for the netmask, e.g. to add a secondary IP to fxp0, yo
Re:Wondering what YACC is? (Score:2)
> # ifconfig fxp0 192.168.1.12/32 alias
Woah, impressive!
Have you ever used Linux?
Re:Wondering what YACC is? (Score:2)
>> # ifconfig fxp0 192.168.1.12/32 alias
> Woah, impressive!
> Have you ever used Linux?
ok, ok, so apparently you can do it on Linux too....
Re:Wondering what YACC is? (Score:2)
You can assign any number of addresses to a single interface without cloning it.
$ ip addr add 192.168.1.7/24 dev eth0
$ ip addr add 10.1.7.7/24 dev eth0
$ ip addr add 10.2.4.5/24 dev eth0 scope link
Re:Wondering what YACC is? (Score:2)
XFree86 is a product for Unix and Unix variants. XFree86 was developed during the 80's, a bit before the time of Linux.
Apache HTTPd started life as a series of patches to the NCSA HTTPd server which was available for most flavours of Unix, Linux being one of them. I wouldn't go as far as to claim it as part of any community since the software they develop is platform independant.
Now the Linux community does contribute code to these projects, just as
Refactoring?!? (Score:1)
Either way I find it hard to appreciate why this is news.
Did he upload some speling, too? (Score:2, Offtopic)
What ever happened to "Small is Beautiful"? (Score:5, Funny)
Nice to see work on improving ifconfig (Score:4, Interesting)
- system("/usr/sbin/arp
...")
and you will see pretty quickly that it's much more complicated than any ioctl()Conceptually, ARP table entries as routing table entries is great but the API is in need of some serious re-working or a library to hide the complexity.
Linux's iproute2+tc (Score:4, Informative)
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.
Re:Linux's iproute2+tc (Score:3, Interesting)
"ip" is definitely great and I really miss that command on BSD systems.
Not only it is way more powerful that ifconfig, it is also easier to use, with a very logical and comprehensive syntax ("ip route add default via 192.168.1.221")
Refactoring "ifconfig" nowadays sounds like a total waste of time IMHO. Hopefully Dragonfly will take a more modern approach.
Re:Linux's iproute2+tc (Score:1, Interesting)
You can do everything ifconfig + iptables using ip + tc and more.
Try to do ifconfig eth0 allmulti with ip.
Re:Linux's iproute2+tc (Score:3, Insightful)
"tc" is a complex elephant in considerable need of exposure to someone who both a) cares about qdisc and b) understands OS usability. ip & tc are hardly comparable. The "shapecfg" command is more intuitive, but communicates with a completely separate and underdeveloped kernel subsystem.
iptables then has another syntax to learn, just