~ubuntu-branches/ubuntu/jaunty/ifupdown/jaunty-201309120846

« back to all changes in this revision

Viewing changes to interfaces.5.pre

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-05-27 06:43:06 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050527064306-mmu0c9p8os37l3bq
Tags: 0.6.7ubuntu1
* Resynchronise with Debian, resolving merge conflicts.
* Remove the initscripts dependency, since we now use our own readlink.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
commands.
24
24
This is where you configure how your system is connected to the network.
25
25
.P
26
 
Lines starting with `#' are ignored.
27
 
A line may be extended across multiple lines by making the last character a backslash.
28
 
.P
29
 
The file consists of zero or more "iface", "mapping" and "auto" stanzas.
30
 
Here is an example.
 
26
Lines starting with `#' are ignored. Note that end-of-line comments are
 
27
NOT supported, comments must be on a line of their own.
 
28
.P
 
29
A line may be extended across multiple lines by making the last character
 
30
a backslash.
 
31
.P
 
32
The file consists of zero or more "iface", "mapping", "auto" and "allow-"
 
33
stanzas. Here is an example.
31
34
.EX
32
35
auto lo eth0
 
36
allow-hotplug eth1
33
37
 
34
38
iface lo inet loopback
35
39
 
44
48
        up flush\-mail
45
49
 
46
50
iface eth0\-work inet dhcp
 
51
 
 
52
iface eth1 inet dhcp
47
53
.EE
48
 
Stanzas beginning with the word "auto" are used to identify the physical
 
54
Lines beginning with the word "auto" are used to identify the physical
49
55
interfaces to be brought up when
50
56
.B ifup
51
57
is run with the
56
62
.B ifup
57
63
brings the named interfaces up in the order listed.
58
64
.P
 
65
Lines beginning with "allow-" are used to identify interfaces that should
 
66
be brought up automatically by various subsytems. This may be done using
 
67
a command such as "ifup --allow=hotplug eth0 eth1", which will only bring
 
68
up eth0 or eth1 if it is listed in an "allow-hotplug" line. Note that
 
69
"allow-auto" and "auto" are synonyms.
 
70
.P
59
71
Stanzas beginning with the word "mapping" are used to determine how a
60
72
logical interface name is chosen for a physical interface that is to be
61
73
brought up.  The first line of a mapping stanza consists of the word
77
89
.B ifup
78
90
is normally given a physical interface name as its first non\-option argument.
79
91
.B ifup
80
 
also uses this name as the initial logical name for the interface 
81
 
unless it is accompanied by a  suffix of the form \fI=LIFACE\fR, in 
82
 
which case ifup chooses LIFACE as the initial logical name for the interface.
 
92
also uses this name as the initial logical name for the interface unless
 
93
it is accompanied by a  suffix of the form \fI=LOGICAL\fR, in which case
 
94
ifup chooses \fILOGICAL\fR as the initial logical name for the interface.
83
95
It then maps this name, possibly more than once according to successive
84
 
mapping specifications,  until no further mappings are possible.
85
 
If the resulting name is the name of some defined logical interface then 
 
96
mapping specifications,  until no further mappings are possible.  If the
 
97
resulting name is the name of some defined logical interface then
86
98
.B ifup 
87
99
attempts to bring up the physical interface
88
100
as that logical interface.  Otherwise
119
131
The following "command" options are available for every family and method.
120
132
Each of these options can be given multiple times in a single stanza,
121
133
in which case the commands are executed in the order in which they appear
122
 
in the stanza.  If one of the commands fails, none of the others will be
123
 
executed but the interface will still be configured.
 
134
in the stanza.
124
135
(You can ensure a command never fails by suffixing "|| true".)
125
136
.TP
126
 
.BI up " command"
127
 
Run
128
 
.I command
129
 
after bringing the interface up.
130
 
.TP
131
137
.BI pre\-up " command"
132
138
Run
133
139
.I command
134
140
before bringing the interface up.
 
141
If this command fails then
 
142
.B ifup
 
143
aborts,
 
144
refraining from marking the interface as configured,
 
145
prints an error message,
 
146
and exits with status 0.
 
147
This behavior may change in the future.
 
148
.TP
 
149
.BI up " command" 
 
150
.TP
 
151
.BI post\-up " command"
 
152
Run
 
153
.I command
 
154
after bringing the interface up.
 
155
If this command fails then
 
156
.B ifup
 
157
aborts,
 
158
refraining from marking the interface as configured
 
159
(even though it has really been configured),
 
160
prints an error message,
 
161
and exits with status 0.
 
162
This behavior may change in the future.
135
163
.TP
136
164
.BI down " command"
 
165
.TP
 
166
.BI pre\-down " command"
137
167
Run
138
168
.I command
139
169
before taking the interface down.
 
170
If this command fails then
 
171
.B ifdown
 
172
aborts,
 
173
marks the interface as deconfigured
 
174
(even though it has not really been deconfigured),
 
175
and exits with status 0.
 
176
This behavior may change in the future.
140
177
.TP
141
178
.BI post\-down " command"
142
179
Run
143
180
.I command
144
181
after taking the interface down.
 
182
If this command fails then
 
183
.B ifdown
 
184
aborts,
 
185
marks the interface as deconfigured,
 
186
and exits with status 0.
 
187
This behavior may change in the future.
145
188
.P
146
189
There exists for each of the above mentioned options a directory
147
190
.IR /etc/network/if\-\fB<option>\fI.d/ 
151
194
.P
152
195
All of these commands have access to the following environment variables.
153
196
.TP
154
 
.B
155
 
VERBOSITY
156
 
verbosity:
157
 
.I 1
158
 
if \fB\-\-verbose\fR option active,
159
 
.I 0
160
 
otherwise
161
 
.TP
162
 
.B
163
 
IFACE
 
197
.B IFACE
164
198
physical name of the interface being processed
165
199
.TP
166
 
.B
167
 
ADDRFAM
 
200
.B LOGICAL
 
201
logical name of the interface being processed
 
202
.TP
 
203
.B ADDRFAM
168
204
address family of the interface
169
205
.TP
170
 
.B
171
 
METHOD
 
206
.B METHOD
172
207
method of the interface (e.g.,
173
208
.IR static )
174
209
.TP
175
210
.B MODE
176
211
.IR start " if run from ifup, " stop " if run from ifdown"
177
212
.TP
178
 
.B
179
 
PATH
 
213
.B PHASE 
 
214
as per MODE, but with finer granularity, distinguishing the
 
215
\fIpre-up\fR, \fIpost-up\fR, \fIpre-down\fR and \fIpost-down\fR phases.
 
216
.TP
 
217
.B VERBOSITY
 
218
indicates whether \fB--verbose\fR was used; set to 1 if so, 0 if not.
 
219
.TP
 
220
.B PATH
180
221
the command search path:
181
 
.I
182
 
/usr/local/sbin:\%/usr/local/bin:\%/usr/sbin:\%/usr/bin:\%/sbin:\%/bin
 
222
.I /usr/local/sbin:\%/usr/local/bin:\%/usr/sbin:\%/usr/bin:\%/sbin:\%/bin
183
223
.P
184
224
Additionally, all options given in an interface definition stanza are
185
225
exported to the environment in upper case with "IF_" prepended and with