ip vs. if{up,down}

Ben Scott dragonhawk at gmail.com
Sun Mar 13 19:35:01 EST 2005


On Fri, 11 Mar 2005 16:11:46 -0500, Michael ODonnell
<michael.odonnell at comcast.net> wrote:
> I'm wondering about the history of the various bits
> of network management infrastructure.  For example,
> sometimes I see ifup mentioned as the way to bring an
> interface up and sometimes I see "ip up" mentioned.
> Is there a reason to prefer one or the other?

To expand on what plussier wrote:

The traditional command to configure an interface on nix is
"ifconfig".  You could do "ifconfig eth0 blah blah blah" to configure
and activate an interface, or "ifconfig eth0 down" to shut an
interface down.  The "ifconfig" approach generally assumed one address
per interface.

The newer command is "ip", which is part of the iproute2 suite.  It
provides a single interface to IP configuration, and breaks things
nicely into the datalink and network layers, eliminating the trouble
with multiple IP addresses per interface that "ifconfig" had.

The ifup/ifdown bit originated with Red Hat, I believe.  They are
configuration automation scripts which read config info from
/etc/sysconfig/network* and act on it.  "ifup foo" brings up an
Interface profile, which might invoke "ifconfig", "ip",
"ipx_interface", "wvdial", or any number of other tools.  So
"ifup/ifdown" function at a higher level then ifconfig/ip.

As for which is preferred, it largely depends on what your goal is. 
Certainly, on a system which provides them, "ifup" and "ifdown"
provide more opportunity for configuration automation to hook into
things.  So they could be preferred, as it makes it more likely that
all the bits and pieces of software will be on the same page.  On the
other hand, the "ip" command is more powerful, and might be preferred
if one is writing one's own configuration automation (for something
like virtual hosting).  Finally, if portability is one's goal,
"ifconfig" would be the best answer.

HTH,



More information about the gnhlug-discuss mailing list