diff options
author | Cullum Smith <cullum@sacredheartsc.com> | 2024-07-12 15:20:54 -0400 |
---|---|---|
committer | Cullum Smith <cullum@sacredheartsc.com> | 2024-07-12 15:20:54 -0400 |
commit | 241833b7f320e7fca84ba226f1ecbb0c963534f7 (patch) | |
tree | ee9839af8bee6ec9c5cac08306e3167634babcec /files/usr/local/etc | |
parent | 8ec6df0afeb4ef69fa64de5516d16f4be48e0549 (diff) | |
download | infrastructure-241833b7f320e7fca84ba226f1ecbb0c963534f7.tar.gz |
initial commit of hypervisor configs
Diffstat (limited to 'files/usr/local/etc')
-rw-r--r-- | files/usr/local/etc/jailctl.conf.freebsd_hypervisor | 29 | ||||
-rw-r--r-- | files/usr/local/etc/rc.d/vmctl.freebsd_hypervisor | 24 | ||||
-rw-r--r-- | files/usr/local/etc/vmctl.conf.freebsd_hypervisor | 18 |
3 files changed, 71 insertions, 0 deletions
diff --git a/files/usr/local/etc/jailctl.conf.freebsd_hypervisor b/files/usr/local/etc/jailctl.conf.freebsd_hypervisor new file mode 100644 index 0000000..02b6065 --- /dev/null +++ b/files/usr/local/etc/jailctl.conf.freebsd_hypervisor @@ -0,0 +1,29 @@ +#!/bin/sh + +JAIL_HOME='${hypervisor_jail_home}' +JAIL_DATASET='${hypervisor_jail_dataset}' +TRUNK_INTERFACE='${hypervisor_trunk_interface}' + +DEFAULT_DOMAIN='${domain}' +DEFAULT_VLAN='${hypervisor_default_vlan}' +DEFAULT_NETMASK='$(prefix2netmask "$hypervisor_default_prefix")' +DEFAULT_OS_QUOTA='${hypervisor_default_os_quota}' +DEFAULT_DATA_QUOTA='${hypervisor_default_data_quota}' + +ZFS_OPTS='${hypervisor_jail_default_zfs_opts}' + +DEFAULT_DEVFS_RULESET='5' +BPF_ENABLED_DEVFS_RULESET='${hypervisor_jail_bpf_ruleset}' + +DEFAULT_PF_CONF='egress = "jail0" + +set block-policy return +set skip on lo +scrub in on \$egress all fragment reassemble no-df + +antispoof quick for \$egress + +block all +pass out quick on \$egress inet +pass in quick on \$egress inet proto icmp all icmp-type { echoreq, unreach } +pass in quick on \$egress inet proto tcp to port ssh' diff --git a/files/usr/local/etc/rc.d/vmctl.freebsd_hypervisor b/files/usr/local/etc/rc.d/vmctl.freebsd_hypervisor new file mode 100644 index 0000000..5f1a84b --- /dev/null +++ b/files/usr/local/etc/rc.d/vmctl.freebsd_hypervisor @@ -0,0 +1,24 @@ +#!/bin/sh +# +# $FreeBSD$ + +# PROVIDE: vmctl +# REQUIRE: NETWORKING SERVERS dmesg +# BEFORE: ipfw pf +# KEYWORD: shutdown nojail + +. /etc/rc.subr + +name="vmctl" +desc="Start and stop bhyve virtual machines" +rcvar="vmctl_enable" + +: ${vmctl_enable:="NO"} + +command="/usr/local/sbin/${name}" +start_cmd="${command} _start-all" +stop_cmd="${command} _stop-all" +status_cmd="${command} list" + +load_rc_config $name +run_rc_command "$1" diff --git a/files/usr/local/etc/vmctl.conf.freebsd_hypervisor b/files/usr/local/etc/vmctl.conf.freebsd_hypervisor new file mode 100644 index 0000000..7bef759 --- /dev/null +++ b/files/usr/local/etc/vmctl.conf.freebsd_hypervisor @@ -0,0 +1,18 @@ +#!/bin/sh + +VM_HOME='${hypervisor_vm_home}' +VM_DATASET='${hypervisor_vm_dataset}' +TRUNK_INTERFACE='${hypervisor_trunk_interface}' + +DEFAULT_DOMAIN='${domain}' +DEFAULT_CPUS='${hypervisor_vm_default_cpus}' +DEFAULT_MEMORY='${hypervisor_vm_default_mem}' +DEFAULT_OS_SIZE='${hypervisor_default_os_quota}' +DEFAULT_DATA_SIZE='${hypervisor_default_data_quota}' +DEFAULT_PREFIXLEN='${hypervisor_default_prefix}' +DEFAULT_VLAN='${hypervisor_default_vlan}' +TEMPLATE_ZVOL_SIZE='${hypervisor_vm_template_size}' +DEFAULT_AUTOSTART_DELAY='${hypervisor_vm_default_autostart_delay}' + +ZFS_OPTS='${hypervisor_vm_default_zfs_opts}' +ZFS_VOLBLOCKSIZE='${hypervisor_vm_zfs_volblocksize}' |