manpagez: man pages & more
info inetutils
Home | html | info | man

File: inetutils.info,  Node: ifconfig invocation,  Next: logger invocation,  Prev: hostname invocation,  Up: Top

5 'ifconfig': Configure network interfaces
******************************************

'ifconfig' is a program to retrieve and to set selected properties of
network interfaces.  It is best viewed as a tool to get information,
rather than for changing the behaviour of adapters, since it is hard to
support property setting in a portable manner.

Synopsis:

     ifconfig IFACE [ARG...]
     ifconfig -i IFACE [OPTION...] [-i IFACE2 [OPTION...]]

5.1 Command line options
========================

'-a'
'--all'
     Display all available interfaces, including those that not are
     marked as 'up', i.e., also the inactive interfaces.

'-A ADDR'
'--address=ADDR'
     Set address of selected interface to ADDR.

'-b ADDR'
'-B ADDR'
'--brdaddr=ADDR'
'--broadcast=ADDR'
     Set broadcast address of selected interface to ADDR.

'-d ADDR'
'-p ADDR'
'--dstaddr=ADDR'
'--peer=ADDR'
     Set destination (peer) address of selected interface.

'--down'
     Deactivate the selected interface.

'-F LIST'
'--flags=LIST'
     Change those interface flags mentioned in LIST.  The argument is a
     comma separated list of one ore more flag names to be set, or in
     case the name is prepended with 'no', the corresponding flag is
     cleared.  The output of 'ifconfig' with the option '--help'
     contains a list of available flag names.

'--format=FORMAT'
     Select output format; the value 'help' prints a list of all
     available formats.

'-i NAME'
'--interface=NAME'
     Select the named interface for any following action.

'-l'
'--list'
     List, with name only, all available interfaces, or only those
     selected should at least one option '-i' have specified.

'-m MASK'
'--netmask=MASK'
     Set netmask of selected interface to MASK.

'--metric=N'
     Set the metric of selected interface to the number N.

'-M N'
'--mtu=N'
     Set MTU of selected interface to the number N.

'-s'
'--short'
     Use short output format.  This is identical to specifying
     '--format=netstat'.

'--up'
     Activate the selected interface.

'-v'
'--verbose'
     Print informational messages when configuring an interface.

   Observe that the use of program options is the only manner in which
'ifconfig' is able to handle multiple interfaces in one invocation.
Once a particular interface has been selected using '-i', it is affected
by any following option until replaced by another interface selector.
This is also the main cause, that 'ifconfig' is unable to treat options
independently of their order, as is mostly the case in other GNU
software.

5.2 Formatted status output
===========================

The status of one or more interfaces can be presented in a number of
different formats.  A list of them is printed by the option
'--format=help'.  In the following table the valid formats are given,
each is used in the form '--format=NAME'.

check
check-existence
?
     Place holders for the ability to check whether the interfaces
     selected by one or more options '-i' are determining existing
     interfaces in the running system.  No output in case of success, an
     error message in case of a failure.

gnu
default
     Standard GNU output format.

gnu-one-entry
     Like the previous format, but with intermediary newlines removed.

help
     Display a list of valid formats, together with a short description
     for each choice.

net-tools
     Imitation of presentation used by the implementation in
     'net-tools'.  Default format for GNU/Linux.

netstat
     Terse output with statistics, similar to that of 'netstat -i'.

osf
     Format variant of 'unix' preferred by OSF's implementation.

unix
     Traditional UNIX type format.  Default for BSD, HPUX and Solaris.

5.3 Legacy syntax
=================

The traditional mode of invoking 'ifconfig' is via a parsed command
line, without all use of program switches and options, relying fully on
argument parsing.  This mode of use is supported also in the present
implementation, but keep in mind that only one interface can be
manipulated using this legacy syntax.

     ifconfig NAME [ADDR [DSTADDR]] [broadcast BRDADDR] [netmask MASK]
              [metric N] [mtu N] [up|down]

   As is conventional, only the primary address and possibly the peer
destination address are stated as bare arguments, without a specifying
keyword.  Some slight variation on this syntax will depend on the target
system for which the program is being built, as not all platforms
support identical abilities.  The best information is found via the
usage massage 'ifconfig --usage'.
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.