[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Post-installation: how to auto-configure network adapter (ie. enable internet access)?

From: Brian <ad44@cityscape.co.uk>
To: debian-user@lists.debian.org
Sent: Sunday, June 1, 2014 9:15 PM
Subject: Re: Post-installation: how to auto-configure network adapter (ie. enable internet access)?

> If you have GNOME you'd be as well using the software it provides, Network Manager. Otherwise there is interfaces(5) (man interfaces). It has
> oodles of examples to look at.

Did you mean that at the console, tty1, I type the following command?

sudo apt-get install network-manager

The installed NetworkManager package will auto-configure my laptop computer for me?

By the way I have a thorough look at "man interfaces". It contains heaps of commands and options but no examples for beginners on how to use them.

To illustrate what I mean, see the first few paragraphs after I type "man interfaces":


INTERFACES(5)                    File formats                    INTERFACES(5)

       /etc/network/interfaces  - network interface configuration for ifup and

       /etc/network/interfaces contains network interface configuration infor‐
       mation  for the ifup(8) and ifdown(8) commands.  This is where you con‐
       figure how your system is connected to the network.

       Lines starting with `#' are ignored. Note that end-of-line comments are
       NOT supported, comments must be on a line of their own.

       A line may be extended across multiple lines by making the last charac‐
       ter a backslash.

       The file consists of zero or more "iface", "mapping", "auto",  "allow-"
       and "source" stanzas. Here is an example.
       auto lo eth0
       allow-hotplug eth1

       iface lo inet loopback

       source interfaces.d/machine-dependent

       mapping eth0
            script /usr/local/sbin/map-scheme
            map HOME eth0-home
            map WORK eth0-work

       iface eth0-home inet static
            up flush-mail

       iface eth0-work inet dhcp

       Lines  beginning with the word "auto" are used to identify the physical
       interfaces to be brought up when ifup is run with the -a option.  (This
       option  is  used by the system boot scripts.)  Physical interface names
       should follow the word "auto" on the same line.  There can be  multiple
       "auto"  stanzas.   ifup  brings  the  named  interfaces up in the order

       Lines beginning with "allow-" are  used  to  identify  interfaces  that
       should  be  brought  up automatically by various subsytems. This may be
       done using a command such as "ifup --allow=hotplug  eth0  eth1",  which
       will  only  bring up eth0 or eth1 if it is listed in an "allow-hotplug"
       line. Note that "allow-auto" and "auto" are synonyms.

       Lines beginning with "source" are used to include  stanzas  from  other
       files, so configuration can be split into many files. The word "source"
       is followed by the path of file to be sourced. Shell wildcards  can  be
       used.  (See wordexp(3) for details.)

       Stanzas  beginning  with the word "mapping" are used to determine how a
       logical interface name is chosen for a physical interface that is to be
       brought  up.   The  first line of a mapping stanza consists of the word
       "mapping" followed by a pattern in shell  glob  syntax.   Each  mapping
       stanza  must contain a script definition.  The named script is run with
       the physical interface name as its argument and with  the  contents  of
       all  following  "map"  lines  (without the leading "map") in the stanza
       provided to it on its standard input. The script must print a string on
       its  standard  output before exiting. See /usr/share/doc/ifupdown/exam‐
       ples for examples of what the script must print.

       Mapping a name consists of searching the remaining mapping patterns and
       running the script corresponding to the first match; the script outputs
       the name to which the original is mapped.

       ifup  is  normally  given  a  physical  interface  name  as  its  first
       non-option  argument.   ifup also uses this name as the initial logical
       name for the interface unless it is accompanied by  a   suffix  of  the
       form  =LOGICAL, in which case ifup chooses LOGICAL as the initial logi‐
       cal name for the interface.  It then maps this name, possibly more than
       once  according to successive mapping specifications,  until no further
       mappings are possible.  If the resulting  name  is  the  name  of  some
       defined  logical  interface then ifup attempts to bring up the physical
       interface as that logical interface.   Otherwise  ifup  exits  with  an

       Stanzas defining logical interfaces start with a line consisting of the
       word "iface" followed by the name of the logical interface.  In  simple
       configurations  without  mapping stanzas this name should simply be the
       name of the physical interface to which it  is  to  be  applied.   (The
       default mapping script is, in effect, the echo command.)  The interface
       name is followed by the name of the address family that  the  interface...

[end quote]

What do the terms "iface", "mapping", "allow-hotplug eth1", "iface lo inet loopback", "up flush-mail" mean?

Brian, not everyone has a computer science or IT degree.


Reply to: