File: ifrename.8

package info (click to toggle)
wireless-tools 30~pre9-12
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,632 kB
  • ctags: 4,575
  • sloc: ansic: 13,804; sh: 209; makefile: 154
file content (191 lines) | stat: -rw-r--r-- 5,302 bytes parent folder | download | duplicates (28)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
.\" Jean II - HPL - 2004-2007
.\" ifrename.8
.\"
.TH IFRENAME 8 "26 February 2007" "wireless-tools" "Linux Programmer's Manual"
.\"
.\" NAME part
.\"
.SH NAME
ifrename \- rename network interfaces based on various static criteria
.\"
.\" SYNOPSIS part
.\"
.SH SYNOPSIS
.B "ifrename [-c configfile] [-p] [-d] [-u] [-v] [-V] [-D] [-C]"
.br
.B "ifrename [-c configfile] [-i interface] [-n newname]"
.\"
.\" DESCRIPTION part
.\"
.SH DESCRIPTION
.B Ifrename 
is a tool allowing you to assign a consistent name to each of your
network interface.
.PP
By default, interface names are dynamic, and each network interface is
assigned the first available name
.RI ( eth0 ", " eth1 "...)."
The order network interfaces are created may vary. For built-in
interfaces, the kernel boot time enumeration may vary. For removable
interface, the user may plug them in any order.
.PP
.B Ifrename
allow the user to decide what name a network interface will have.
.B Ifrename 
can use a variety of
.I selectors
to specify how interface names match the network interfaces on the
system, the most common selector is the interface 
.IR "MAC address" .
.PP
.B Ifrename
must be run before interfaces are brought up, which is why it's mostly
useful in various scripts (init, hotplug) but is seldom used directly
by the user. By default,
.B ifrename 
renames all present system interfaces using mappings defined in
.IR /etc/iftab .
.\"
.\" PARAMETER part
.\"
.SH PARAMETERS
.TP
.BI "-c " configfile
Set the configuration file to be used (by default 
.IR /etc/iftab ).
The configuration file define the mapping between selectors and
interface names, and is described in
.IR iftab (5).
.br
If
.I configfile
is "-", the configuration is read from stdin.
.TP
.B -p
Probe (load) kernel modules before renaming interfaces. By default
.B ifrename 
only check interfaces already loaded, and doesn't auto-load the
required kernel modules. This option enables smooth integration with
system not loading modules before calling
.BR ifrename .
.TP
.B -d
Enable various
.B Debian
specific hacks. Combined with
.BR -p ,
only modules for interfaces specified in
.I /etc/network/interface
are loaded.
.TP
.BI "-i " interface
Only rename the specified
.I interface 
as opposed to all interfaces on the system. The new interface name is
printed.
.TP
.BI "-n " newname
When used with
.IR -i ,
specify the new name of the interface. The list of mappings from the
configuration file is bypassed, the interface specified with
.I -i
is renamed directly to
.IR newname .
The new name may be a wildcard containing a single '*'.
.br
When used without 
.IR -i ,
rename interfaces by using only mappings that would rename them to
.IR newname .
The new name may not be a wildcard. This use of ifrename is
discouraged, because inefficient
.RI ( -n " without " -i ).
All the interfaces of the system need to be processed at each
invocation, therefore in most case it is not faster than just letting
ifrename renaming all of them (without both 
.IR -n " and " -i ).
.TP
.B -t
Enable name takeover support. This allow interface name swapping
between two or more interfaces.
.br
Takeover enable an interface to 'steal' the name of another
interface. This works only with kernel 2.6.X and if the other
interface is down. Consequently, this is not compatible with
Hotplug. The other interface is assigned a random name, but may be
renamed later with 'ifrename'.
.br
The number of takeovers is limited to avoid circular loops, and
therefore some complex multi-way name swapping situations may not be
fully processed.
.br
In any case, name swapping and the use of this feature is discouraged,
and you are invited to choose unique and unambiguous names for your
interfaces...
.TP
.B -u
Enable
.I udev
output mode. This enables proper integration of
.B ifrename
in the
.I udev
framework,
.BR udevd (8)
will use
.B ifrename
to assign interface names present in
.IR /etc/iftab .
In this mode the output of ifrename can be parsed
directly by
.BR udevd (8)
as an IMPORT action. This requires
.I udev
version 107 or later.
.TP
.B -D
Dry-run mode. Ifrename won't change any interface, it will only print
new interface name, if applicable, and return.
.br
In dry-run mode, interface name wildcards are not resolved. New
interface name is printed, even if it is the same as the old name.
.br
Be also aware that some selectors can only be read by root, for
example those based on
.BR ethtool ),
and will fail silently if run by a normal user. In other words,
dry-run mode under a standard user may not give the expected result.
.TP
.B -V
Verbose mode. Ifrename will display internal results of parsing its
configuration file and querying the interfaces selectors. Combined
with the
.I dry-run
option, this is a good way to debug complex configurations or trivial
problems.
.TP
.B -C
Count matching interfaces. Display the number of interface matched,
and return it as the exit status of ifrename.
.br
The number of interfaces matched is the number of interface on the
system for which a mapping was found in the config file (which is
different from the number of interface renamed).
.\"
.\" AUTHOR part
.\"
.SH AUTHOR
Jean Tourrilhes \- jt@hpl.hp.com
.\"
.\" FILES part
.\"
.SH FILES
.I /etc/iftab
.\"
.\" SEE ALSO part
.\"
.SH SEE ALSO
.BR ifconfig (8),
.BR ip (8),
.BR iftab (5).