.\" .\" Copyright (c) 2008 The DragonFly Project. All rights reserved. .\" .\" This code is derived from software contributed to The DragonFly Project .\" by Matthew Dillon .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" 3. Neither the name of The DragonFly Project nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific, prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $DragonFly: src/usr.sbin/vknetd/vknetd.8,v 1.1 2008/05/27 01:58:01 dillon Exp $ .\" .Dd May 26, 2008 .Dt vknet 8 .Os .Sh NAME .Nm vknet .Nd create a bridged network for (typically user-run) vkernel's .Sh SYNOPSIS .Nm .Op Fl cdU .Op Fl b Ar bridgeN .Op Fl p Ar socket_path .Op Fl t Ar tapN .Op Ar address/cidrbits .Sh DESCRIPTION The .Nm utility creates a virtualized bridged network suitable for vkernel use. The utility was created to simplify vkernel oprations and to allow user-run vkernels to have access to a network. General use is to specify a large 10-dot network which multiple vkernels are then able to connect to, and backfeed the whole mess to a TAP interface. .Pp A vkernel would make use of the virtualized network by specifying .Fl I Ar /dev/vknet instead of a .Xr tap 4 interface. Any number of vkernels may connect to the virtual network. .Pp .Nm Implements a simple bridge for all entities connected to it. A cache of MAC addresses is built up (just like an etherswitch does) and matching packets will be forwarded directly to the proper 'port' (connected clients or TAP interface). Unknown MACs will be broadcast. .Pp The following options are available: .Bl -tag -width flag .It Fl c Connect into the bridge and monitor activity. This option currently only monitors broadcast packets. Packets with cached MACs are not monitored. .It Fl d Debug mode. Do not go into the background. .It Fl U Unsecure mode. Act as a pure bridge and do not try to secure the IP space from host visibility. This is typically used with the .Fl b option to directly bridge .Nm into the host rather then operating it as a separate subnet. .It Fl b Ar bridgeN The .Xr tap 4 interface will be bridged into the specified bridge. .It Fl p Ar socket_path Specify where to create the unix domain socket in the filesystem space. By default the socket is called .Pa /dev/vknet . .It Fl t Ar tapN Specify a particular .Xr tap 4 interface to use. If not specified, .Nm will search for an unused tap interface. .It Ar address/cidrbits When operating in secure mode (which is the default), a CIDR block must be specified. The address is the address you wish to assign to the TAP interface and will sit on both the host and virtual networks if not bridged. The .Ar cidrbits is the number of bits representing the virtual subnet. For example, 10.1.0.1/24 places the tap interface on 10.1.0.1 and gives you an 8 bit subnet capable of handling 254 hosts. .El .Sh EXAMPLES .Li "vknetd 10.1.0.1/16" .Pp .Sh REQUIREMENTS .Nm requires that the .Ar if_tap and .Ar if_bridge modules be loaded. In addition, a 'vknet' group must exist in /etc/groups. .Sh FILES .Bl -tag -width /var/log/lastlog -compact .It Pa /dev/tap* TAP interface used to route packets from userland providers back into the real machine. If not otherwise specified an unused tap interface will be selected. .It Pa /dev/vknet Default socket .Nm sits on waiting for connections. .El .Sh BUGS .Nm defaults to secure mode and will prevent IP spoofing, but the security does not yet handle ARP issues so ARP spoofing can be used to create a denial of service attack on the host network. .Pp .Nm does not currently implement a timeout for its MAC cache. .Sh SEE ALSO .Xr vkernel 7 , .Xr vke 7 .Sh HISTORY The .Nm command was written by Matthew Dillon and first appeared in .Dx 1.13 in May 2008.