#vkernel_bin="/boot/kernel.VKERNEL" # Default path to the vkernel binary
#vkernel_kill_timeout="45" # Default timeout before a SIGKILL is issued
+vknetd_enable="NO" # Bridged networking
+vknetd_flags="-U" # Bridged networking flags
#
# Create an entry for each vkernel specified in vkernel_list
# replacing 'example' by the name of the vkernel.
--- /dev/null
+#!/bin/sh
+#
+
+# PROVIDE: vknetd
+# REQUIRE: DAEMON netif
+# BEFORE: LOGIN
+
+. /etc/rc.subr
+
+name="vknetd"
+rcvar=`set_rcvar`
+start_precmd="vknetd_precmd"
+command="/usr/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+
+vknetd_precmd()
+{
+ # load if_tap kernel module if needed
+ if ! kldstat -q -m "if_tap"; then
+ if kldload if_tap; then
+ info 'if_tap module loaded.'
+ else
+ err 1 'if_tap module failed to load.'
+ fi
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
/usr/sbin/vknetd -p /var/run/vknet -U -b bridge0
Second, you can set up a LAN just between the vkernel and the machine it
-is running on:
+is running on. In your /etc/rc.conf you set:
- /usr/sbin/vknetd -p /var/run/vknet -U 10.30.0.1/16
+ vknetd_enable="YES"
+ vknetd_flags="10.30.0.1/16"
-This setup is typically done in /etc/rc.local. vknetd just sits there
-waiting for connections. Any number of vkernels can then attach to it.
-If you bridge you can use your normal LAN's dhcp server and run dhclient
-on the vkernel. If you set up a local LAN it is easiest to simply configure
-the address by hand.
+vknetd just sits there waiting for connections. Any number of vkernels
+can then attach to it. If you bridge you can use your normal LAN's dhcp
+server and run dhclient on the vkernel. If you set up a local LAN it
+is easiest to simply configure the address by hand.