xref: /dragonfly/usr.sbin/vknetd/vknetd.8 (revision 36a3d1d6)
1.\"
2.\" Copyright (c) 2008 The DragonFly Project.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to The DragonFly Project
5.\" by Matthew Dillon <dillon@backplane.com>
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.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in
15.\"    the documentation and/or other materials provided with the
16.\"    distribution.
17.\" 3. Neither the name of The DragonFly Project nor the names of its
18.\"    contributors may be used to endorse or promote products derived
19.\"    from this software without specific, prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
25.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\" $DragonFly: src/usr.sbin/vknetd/vknetd.8,v 1.3 2008/05/31 12:04:15 swildner Exp $
35.\"
36.Dd May 21, 2009
37.Dt VKNETD 8
38.Os
39.Sh NAME
40.Nm vknetd
41.Nd create a bridged network for (typically user-run) vkernels
42.Sh SYNOPSIS
43.Nm
44.Op Fl cdU
45.Op Fl b Ar bridgeN
46.Op Fl p Ar socket_path
47.Op Fl t Ar tapN
48.Op Ar address Ns / Ns Ar cidrbits
49.Sh DESCRIPTION
50The
51.Nm
52utility creates a virtualized bridged network suitable for vkernel use.
53The utility was created to simplify
54.Nm vkernel
55operations and to allow user-run
56vkernels to have access to a network.
57General use is to specify a large 10-dot network which multiple vkernels are
58then able to connect to, and backfeed the whole mess to a TAP interface.
59.Pp
60A
61.Nm vkernel
62would make use of the virtualized network by specifying
63.Fl I Ar /var/run/vknet
64instead of a
65.Xr tap 4
66interface.
67Any number of vkernels may connect to the virtual network.
68.Pp
69.Nm
70Implements a simple bridge for all entities connected to it.
71A cache
72of MAC addresses is built up (just like an ethernet switch does) and matching
73packets will be forwarded directly to the proper
74.Sq port
75(connected clients or TAP interface).
76Unknown MACs will be broadcast.
77.Pp
78The following options are available:
79.Bl -tag -width flag
80.It Fl c
81Connect into the bridge and monitor activity.
82This option currently only monitors broadcast packets.
83Packets with cached MACs are not monitored.
84.It Fl d
85Debug mode.
86Do not go into the background.
87.It Fl U
88Unsecure mode.
89Act as a pure bridge and do not try to secure the IP
90space from host visibility.
91This is typically used with the
92.Fl b
93option to directly bridge
94.Nm
95into the host rather than operating it as a separate subnet.
96.It Fl b Ar bridgeN
97The
98.Xr tap 4
99interface
100will be bridged into the specified bridge.
101.It Fl p Ar socket_path
102Specify where to create the unix domain socket in the filesystem space.
103By default the socket is called
104.Pa /var/run/vknet .
105.It Fl t Ar tapN
106Specify a particular
107.Xr tap 4
108interface to use.
109If not specified,
110.Nm
111will search for an unused TAP interface.
112.It Ar address Ns / Ns Ar cidrbits
113When operating in secure mode (which is the default), a CIDR block must be
114specified.
115It is optional in unsecure mode.
116The
117.Ar address
118is the address you wish to assign to the TAP
119interface and will sit on both the host and virtual networks if not bridged.
120The
121.Ar cidrbits
122is the number of bits representing the virtual subnet.
123For example,
12410.1.0.1/24 places the TAP interface on 10.1.0.1 and gives you an 8 bit
125subnet capable of handling 254 hosts.
126An address of 0.0.0.0 is allowed as a special case in secure mode so that
127bootp (
128.Xr dhclient 8 )
129can get through.
130.El
131.Sh FILES
132.Bl -tag -width ".Pa /var/run/vknet" -compact
133.It Pa /dev/tap*
134TAP interface used to route packets from userland providers back into the
135real machine.
136If not otherwise specified an unused TAP interface will be selected.
137.It Pa /var/run/vknet
138Default socket
139.Nm
140sits on waiting for connections.
141.El
142.Sh EXAMPLES
143.Dl "vknetd 10.1.0.1/16"
144.Sh REQUIREMENTS
145.Nm
146requires that the
147.Nm if_tap
148and
149.Nm if_bridge
150modules be loaded.
151In addition, a
152.Dq vknet
153group must exist in
154.Pa /etc/groups .
155.Sh SEE ALSO
156.Xr vknet 1 ,
157.Xr bridge 4 ,
158.Xr tap 4 ,
159.Xr vke 4 ,
160.Xr vkernel 7 ,
161.Xr dhclient 8
162.Sh HISTORY
163The
164.Nm
165command was written by Matthew Dillon and first appeared in
166.Dx 1.13
167in May 2008.
168.Sh BUGS
169.Nm
170defaults to secure mode and will prevent IP spoofing, but the security
171does not yet handle ARP issues so ARP spoofing can be used to create a
172denial of service attack on the host network.
173.Pp
174.Nm
175does not currently implement a timeout for its MAC cache.
176