xref: /freebsd/tools/tools/vimage/vimage.8 (revision aa0a1e58)
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
56The
57.Nm
58utility is an alternative user interface for controlling virtual network
59stacks in FreeBSD, aimed primarily at supporting legacy applications
60which are not yet converted to using
61.Xr jail 8 ,
62.Xr jexec 8 ,
63and
64.Xr jls 8 .
65.
66.Ss Overview
67A virtual image or vimage is a jail with its own independent network
68stack instance.  Every process, socket and network interface present
69in the system is always attached to one, and only one, virtual network
70stack instance (vnet).
71During system bootup sequence a default vnet
72is created to which all the configured interfaces and user processes
73are initially attached.
74Assuming that enough system resources are
75are available, a user with sufficient privileges can create and manage
76a hierarchy of subordinated virtual images.
77The
78.Nm
79command allows for creation, deletion and monitoring of virtual images,
80as well as for execution of arbitrary processes in a targeted virtual
81image.
82.Ss Invocation
83If invoked with no modifiers, the
84.Nm
85command spawns a new interactive shell in virtual image
86.Ar vname .
87If optional additional arguments following
88.Ar vname
89are provided, the first of those will be executed in place of the
90interactive shell, and the rest of the arguments will be passed as
91arguments to the executed command.
92.Pp
93The following modifiers are available:
94.Bl -tag -width indent
95.It Fl c
96Create a new virtual image named
97.Ar vname .
98Additional arguments, if provided, may be used to specify operating
99parameters different from defaults, in format
100.Ar param=value .
101See
102.Xr jail 8
103for an extensive list of available parameters.
104.It Fl m
105Modify the parameters of a virtual image named
106.Ar vname ,
107using the same syntax as with the -c form of the command.
108.It Fl d
109Delete the virtual image
110.Ar vname .
111No processes and/or sockets should exist in the target virtual image
112in order for the delete request to succeed.  Non-loopback interfaces
113residing in the target virtual image will be reassigned to the virtual
114image's parent.
115.It Fl l
116List the properties and statistics for virtual images one level
117below the current one in the hierarchy. If an optional argument
118.Ar vname
119is provided, only the information regarding the target virtual image
120.Ar vname
121is displayed.
122With the optional
123.Op Ar -r
124switch enabled the list will include all virtual images below the
125current level in the vimage hierarchy.
126Enabling the optional
127.Op Ar -v
128or
129.Op Ar -j
130switches results in a more detailed output.
131.It Fl i
132Move interface
133.Ar ifname
134to the target virtual image
135.Ar vname .
136Interfaces will be automatically renamed to
137.So
138ethXX
139.Sc ,
140unless an optional argument specifying the desired interface name
141.Op Ar newifname
142is provided.
143.El
144.Sh EXAMPLES
145Create a new virtual image named
146.So v1
147.Sc ,
148which is allowed to create and manage an own subhierarchy of vimages:
149.Pp
150.Dl vimage -c v1 children.max=100
151.Pp
152Execute 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
160Move the interface
161.So vlan0
162.Sc to the virtual image
163.So v1
164.Sc while renaming the interface as
165.So
166ve0
167.Sc :
168.Pp
169.Dl vimage -i v1 vlan0 ve0
170.Pp
171Show the status information for virtual image
172.So v1
173.Sc :
174.Pp
175.Dl vimage -lv v1
176.Sh DIAGNOSTICS
177The
178.Nm
179command 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
185Network stack virtualization framework first appeared as a patchset
186against the FreeBSD 4.7 kernel in 2002, and was maintained outside
187of the main FreeBSD tree.
188As a result of a project sponsored by the FreeBSD Foundation and
189Stiching NLNet, integrated virtualized network stack first appeared
190in FreeBSD 8.0.
191.Sh BUGS
192Deletion of vimages / vnets is known to leak kernel memory and fail at
193stopping various timers, hence may lead to system crashes.
194.Sh AUTHOR
195.An "Marko Zec" Aq zec@fer.hr
196