“I’ve always assumed that ifup and ifdown were conditional commands that performed their assigned duties only if the interface device in question was up or down, as the command might be. I was dead wrong. I blame my mistake on being a programmer, rather than being stupid, but it’s simply too close to call. The if in ifup, ifdown, and ifstatus is not a programmer’s if – it’s an abbreviation for interface. On the off chance that I’m not the only one who has misunderstood these commands because of their rather iffy names, here’s what they really do and how they are used.”
CLI Magic: ifup, ifdown, ifstatus
26 Comments

try ifplugstatus, should be part of the ifplugd tools…i think! have seen it on suse(?) before but not sure about others that I can remember of course I suffer from CRS so…

1) What did the author think the “if” in ifconfig meant?
2) ifup and ifdown are distro specific. ifconfig is a program, ifup and ifdown are just scripts around that tool.
The reason why his confusion with the names of ifup and ifdown shocks me is that ifconfig is the tool you are normally introduced to first when learning network configuration in *nix. ifup and ifdown are primarily used internally by the distro specific init scripts, but they are, as the author discovered, very handy tools on their own, so many distros make them into separate scripts so that the user can run them directly. (Not all distros have ifup/ifdown as separate scripts, Arch Linux for instance doesn’t) My point is that ifconfig is the central network configuration tool you learn when getting to know linux/*bsd, not ifup/ifdown.
2006-02-07 9:31 am
nimbleifup and ifdown are distro specific. ifconfig is a program, ifup and ifdown are just scripts around that tool.
Yep.
ifup eth0 = ifconfig eth0 up
ifdown eth0 = ifconfig eth0 down
ifstatus = ifconfig
Not convinced those marginal savings in typing are worth those extra scripts. They certainly do succeed in creating pointless and confusing differences between distributions though, as we’ve seen in this thread.
2006-02-07 1:27 pm
bogomipzifup eth0 only uses ifconfig for static IP, with dhcp it spawns dhcpcd or a similar client. On my distro (archlinux), ifup also puts in the full interface configuration (e.g. 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255) on each invocation, and it configures wireless devices using iwconfig. So the differences are huge between distros, as with all things related to init scripts.

Ok, an “article” about a guy’s story about not previously knowing what ifup/down/state are good for with a peculiar turn when he realizes hey, these are good for something. Maybe he’d also never used ifconfig before, then no wonder he was ignorant about ifxxx.
Ok, let me reformulate this: wow, what a great writing ! Makes my life so much more wonderful !

Seriously, why is this being posted? Big deal, someone find out that the if in a command name stands for interface, not for if? If you don’t know something about a command you read the man or use the –help option. What’s next, someone who finds out that the tar command isn’t same shit that roads are (partially) made of?

Ouch.. I think I just hurt my forehead…

hmm… so what did you think ifconfig was all about? 🙂 Knowing about the good ol’ ifconfig should have helped you along understanding ifup/down IMO…
I really can’t imagine this beeing a common mistake
Odd how the author would confuse an “if” programming statement with an OS command … a command is pretty much a program in itself, so why the confusion?
Maybe it’s because the author knows that unix command shells ARE programmable, and that OS commands ARE programming statements, and that “if” is a valid
conditional statement in the shell. Try it and see.
What really threw me off about this article was the use of the “CLI” acronym.
It’s probably an abbreviation for “click” so it must have something to to with the GUI.
My Debian machine has the commands ifup and ifdown, but no ifstatus. I searched: “apt-cache search ifstatus” and nothing was found. Does anyone know where you obtain this piece of software?
Why does one want to test ifup for example when your browser clearly loads pages?It’s evident your connection is up.
Why does one want to test ifup for example when your browser clearly loads pages?It’s evident your connection is up.
Because not everyone uses a pretty GUI on Linux.
These commands are mostly useful in scripting. You can’t test whether your connection is up and working from a shell script with GUI tools. There’s a lot of other things like this. Ever wonder why there is ‘true’ and ‘false’ commands? That’s why.
Why does one want to test ifup for example when your browser clearly loads pages?It’s evident your connection is up.
In order for a website to load in your browser, it has to be able to resolve the domain name to an IP address, and you have to have your routing table setup properly.
In other words, just because you can’t reach http://google.com via your browser, it doesn’t mean your connection is actually down. The command line tools give you more control over troubleshooting a problem. And, as someone else pointed out, the command line tools are often used in scripting.
ifconfig is my usual toy…
ifyoudidnotknowthis
{
you = newb;
}
Edited 2006-02-07 01:12
ifyoudidnotknowthis
{
you = newb;
}
Classic! What’s up with the moderation, people lost their sense of humor around here ?
What really threw me off about this article was the use of the “CLI” acronym.
Why? Was it too obvious? 🙂
Thom, if you thought that was interesting, wait till you hear this next one. man is not a reference to the little people that live inside your computer. It is, in fact, short for manual.
*For those who have no sense of humor, this is a joke not a troll.
# emerge -S ifstatus
Searching…
[ Results for search key : ifstatus ]
[ Applications found : 0 ]
Am I missing something?
As far as I know Gentoo (and Debian?) don’t have ifstatus. They do have ifconfig which offers similar function.
For ifup and ifdown in gentoo see here: http://forums.gentoo.org/viewtopic-t-385555.html
As far as I know Gentoo (and Debian?) don’t have ifstatus. They do have ifconfig which offers similar function.
I’m running Gentoo and searched my ass off for them 🙂
For ifup and ifdown in gentoo see here: