]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/tools/vimage/vimage.8
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / tools / vimage / vimage.8
1 .\" Copyright (c) 2002, 2003 Marko Zec <zec@fer.hr>
2 .\" Copyright (c) 2009 University of Zagreb
3 .\" Copyright (c) 2009 FreeBSD Foundation
4 .\"
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd August 25, 2009
31 .Dt VIMAGE 8
32 .Os
33 .Sh NAME
34 .Nm vimage
35 .Nd manage virtual network stacks
36 .Sh SYNOPSIS
37 .Nm
38 .Op Fl c | m
39 .Ar vname
40 .Op Ar param=value ...
41 .Nm
42 .Fl d
43 .Ar vname
44 .Nm
45 .Fl l
46 .Op Fl rvj
47 .Op Ar vname
48 .Nm
49 .Fl i
50 .Ar vname ifname
51 .Op Ar newifname
52 .Nm
53 .Ar vi_name
54 .Op command ...
55 .Sh DESCRIPTION
56 The
57 .Nm
58 utility is an alternative user interface for controlling virtual network
59 stacks in FreeBSD, aimed primarily at supporting legacy applications
60 which are not yet converted to using
61 .Xr jail 8 ,
62 .Xr jexec 8 ,
63 and
64 .Xr jls 8 .
65 .
66 .Ss Overview
67 A virtual image or vimage is a jail with its own independent network
68 stack instance.  Every process, socket and network interface present
69 in the system is always attached to one, and only one, virtual network
70 stack instance (vnet).
71 During system bootup sequence a default vnet
72 is created to which all the configured interfaces and user processes
73 are initially attached.
74 Assuming that enough system resources are
75 are available, a user with sufficient privileges can create and manage
76 a hierarchy of subordinated virtual images.
77 The
78 .Nm
79 command allows for creation, deletion and monitoring of virtual images,
80 as well as for execution of arbitrary processes in a targeted virtual
81 image.
82 .Ss Invocation
83 If invoked with no modifiers, the
84 .Nm
85 command spawns a new interactive shell in virtual image
86 .Ar vname .
87 If optional additional arguments following
88 .Ar vname
89 are provided, the first of those will be executed in place of the
90 interactive shell, and the rest of the arguments will be passed as
91 arguments to the executed command.
92 .Pp
93 The following modifiers are available:
94 .Bl -tag -width indent
95 .It Fl c
96 Create a new virtual image named
97 .Ar vname .
98 Additional arguments, if provided, may be used to specify operating
99 parameters different from defaults, in format
100 .Ar param=value .
101 See
102 .Xr jail 8
103 for an extensive list of available parameters.
104 .It Fl m
105 Modify the parameters of a virtual image named
106 .Ar vname ,
107 using the same syntax as with the -c form of the command.
108 .It Fl d
109 Delete the virtual image
110 .Ar vname .
111 No processes and/or sockets should exist in the target virtual image
112 in order for the delete request to succeed.  Non-loopback interfaces
113 residing in the target virtual image will be reassigned to the virtual
114 image's parent.
115 .It Fl l
116 List the properties and statistics for virtual images one level
117 below the current one in the hierarchy. If an optional argument
118 .Ar vname
119 is provided, only the information regarding the target virtual image
120 .Ar vname
121 is displayed.
122 With the optional
123 .Op Ar -r
124 switch enabled the list will include all virtual images below the
125 current level in the vimage hierarchy.
126 Enabling the optional
127 .Op Ar -v
128 or
129 .Op Ar -j
130 switches results in a more detailed output.
131 .It Fl i
132 Move interface
133 .Ar ifname
134 to the target virtual image
135 .Ar vname .
136 Interfaces will be automatically renamed to
137 .So
138 ethXX
139 .Sc ,
140 unless an optional argument specifying the desired interface name
141 .Op Ar newifname
142 is provided.
143 .El
144 .Sh EXAMPLES
145 Create a new virtual image named
146 .So v1
147 .Sc ,
148 which is allowed to create and manage an own subhierarchy of vimages:
149 .Pp
150 .Dl vimage -c v1 children.max=100
151 .Pp
152 Execute the
153 .So ifconfig
154 .Sc command in the virtual image
155 .So v1
156 .Sc :
157 .Pp
158 .Dl vimage v1 ifconfig
159 .Pp
160 Move the interface
161 .So vlan0
162 .Sc to the virtual image
163 .So v1
164 .Sc while renaming the interface as
165 .So
166 ve0
167 .Sc :
168 .Pp
169 .Dl vimage -i v1 vlan0 ve0
170 .Pp
171 Show the status information for virtual image
172 .So v1
173 .Sc :
174 .Pp
175 .Dl vimage -lv v1
176 .Sh DIAGNOSTICS
177 The
178 .Nm
179 command exits 0 on success, and >0 if an error occurs.
180 .Sh SEE ALSO
181 .Xr jail 8
182 .Xr jexec 8
183 .Xr jls 8
184 .Sh HISTORY
185 Network stack virtualization framework first appeared as a patchset
186 against the FreeBSD 4.7 kernel in 2002, and was maintained outside
187 of the main FreeBSD tree.
188 As a result of a project sponsored by the FreeBSD Foundation and
189 Stiching NLNet, integrated virtualized network stack first appeared
190 in FreeBSD 8.0.
191 .Sh BUGS
192 Deletion of vimages / vnets is known to leak kernel memory and fail at
193 stopping various timers, hence may lead to system crashes.
194 .Sh AUTHOR
195 .An "Marko Zec" Aq zec@fer.hr