SYSCTL(7)
π sysctl(7) β system information variables β¨
okay so welcome to sysctl(7), bestie!! this page lives in the Miscellaneous Information Manual, and it's literally the master list of every system variable the kernel keeps for u π«Ά. it's a long one, so buckle up.
πΈ NAME πΈ
sysctl β system information variables π
β¨ DESCRIPTION β¨
so there's the sysctl(3) library function and the sysctl(8) utility, and like, both of them are how u get and set the values of system variables β which the kernel is out here maintaining for u 24/7, no cap.
the variables are organized in a tree, and each one is identified by a sequence of numbers. conventionally those numbers are separated by dots, with the topmost identifier chillin' on the left side. every number also has a corresponding text name, bestie. and if u ever need to convert the text representation into the numeric one, u have two options: the sysctlnametomib(3) function, or the -M argument to the sysctl(8) utility. iconic.
every individual sysctl variable is described below, both in textual and numeric form where applicable. quick breakdown of who uses which:
- the textual names can be used as an argument to the
sysctl(8)utility, and also in the file/etc/sysctl.confπ - the numeric names are usually defined as preprocessor constants, and they're intended for use by programs.
every such constant expands to one integer, which identifies the sysctl variable relative to the upper level of the tree. if u want programming examples, go read the sysctl(3) manual page β that's where the lore is. π
π³ Top level names π³
the top level names are defined with a CTL_ prefix in <sys/sysctl.h>, and here's the full lineup. the next levels and subsequent levels down live in the include files listed here, and each one gets its own section below. so many vibes:
kern/CTL_KERNβ next level names in<sys/sysctl.h>β High kernel limitsvm/CTL_VMβ next level names in<uvm/uvm_param.h>β Virtual memoryvfs/CTL_VFSβ next level names in<sys/mount.h>β Filesystemnet/CTL_NETβ next level names in<sys/socket.h>β Networkingdebug/CTL_DEBUGβ next level names in<sys/sysctl.h>β Debugginghw/CTL_HWβ next level names in<sys/sysctl.h>β Generic CPU, I/Omachdep/CTL_MACHDEPβ next level names in<sys/sysctl.h>β Machine dependentuser/CTL_USERβ next level names in<sys/sysctl.h>β User-levelddb/CTL_DDBβ next level names in<sys/sysctl.h>β In-kernel debuggerproc/CTL_PROCβ next level names in<sys/sysctl.h>β Per-processvendor/CTL_VENDORβ next level names?β Vendor specificemul/CTL_EMULβ next level names in<sys/sysctl.h>β Emulation settingssecurity/CTL_SECURITYβ next level names in<sys/sysctl.h>β Security settings
π The debug.* subtree π
the debugging variables vary from system to system, and that's literally the point. a debugging variable can be added or deleted without needing to recompile sysctl so it knows about it. every time it runs, sysctl gets the list of debugging variables straight from the kernel and displays their current values. main character energy, honestly.
the system defines twenty (struct ctldebug) variables, named debug0 through debug19. they're declared as separate variables so they can be individually initialized at the location of their associated variable. and the loader prevents multiple use of the same variable by issuing errors if a variable is initialized in more than one place. it's giving strict parents, but like, fair.
for example, to export the variable dospecialcheck as a debugging variable, the following declaration would be used:
int dospecialcheck = 1;
struct ctldebug debug5 = { "dospecialcheck", &dospecialcheck };
ngl, note that the dynamic implementation ofsysctlcurrently in use largely makes this particular sysctl interface obsolete. seesysctl(8)for more information if u want the tea. π
π The vfs.* subtree π
a distinguished second level name, vfs.generic (VFS_GENERIC), is used to get general information about all file systems. it has the following third level identifiers:
vfs.generic.maxtypenum(VFS_MAXTYPENUM) β the highest valid file system type number.vfs.generic.conf(VFS_CONF) β returns configuration information about the file system type given as a fourth level identifier.vfs.generic.usermount(VFS_USERMOUNT) β controls whether users other than the super-user can mount file systems. defaults to0, so only the super-user can mount file systems.
β οΈ file systems mounted by unprivileged users must be mounted with thenodevandnosuidmount(8)options. like, do not skip this, bestie.
vfs.generic.magiclinks(VFS_MAGICLINKS) β controls whether expansion of variables is going to be performed on pathnames or not. defaults to0, no variable expansion. variables are of the form@nameand the variables supported are described insymlink(7)under βMAGIC SYMLINKSβ. β¨
there's also a second level name for controlling the wapbl(4) (Write Ahead Physical Block Logging file system journaling) capabilities, with these third level identifiers:
vfs.wapbl.flush_disk_cacheβ controls whether to attempt to flush the disk cache on each commit. it defaults to1, and it should always be on to ensure integrity of file system metadata in the event of a power loss. for slow disks, turning it off can improve performance. π’vfs.wapbl.verbose_commitβ for each transaction log commit, print the number of bytes written and the time it took to commit asseconds.nanoseconds.
the remaining second level identifiers are the file system names themselves, identified by the type number returned by a statvfs(2) call or from vfs.generic.conf.
and the third level identifiers available for each file system? those are given in the header file that defines the mount argument structure for that file system. iykyk. π¦
π» The hw.* subtree π»
the string and integer information available for the hw level is detailed below. the changeable column shows whether a process with appropriate privilege may change the value. π
hw.alignbytesβ integer β changeable: nohw.byteorderβ integer β changeable: nohw.cnmagicβ string β changeable: yeshw.disknamesβ string β changeable: nohw.diskstatsβ struct β changeable: nohw.machineβ string β changeable: nohw.machine_archβ string β changeable: nohw.modelβ string β changeable: nohw.ncpuβ integer β changeable: nohw.ncpuonlineβ integer β changeable: nohw.pagesizeβ integer β changeable: nohw.physmemβ integer β changeable: nohw.physmem64β quad β changeable: nohw.usermemβ integer β changeable: nohw.usermem64β quad β changeable: no
and now the actual deets on each one, periodt:
hw.alignbytes(HW_ALIGNBYTES) β alignment constraint for all possible data types. this shows the valueALIGNBYTESin<machine/param.h>, at the kernel compilation time.hw.byteorder(HW_BYTEORDER) β the byteorder (4321, or1234).hw.cnmagic(HW_CNMAGIC) β the console magic key sequence. πͺhw.disknames(HW_DISKNAMES) β the list of (space separated) disk device names on the system.hw.iostatnames(HW_IOSTATNAMES) β a space separated list of devices that will have I/O statistics collected on them.hw.iostats(HW_IOSTATS) β return statistical information on the NFS mounts, disk and tape devices on the system. an array ofstruct io_sysctlstructures is returned, whose size depends on the current number of such objects in the system. the third level name is the size of thestruct io_sysctl. the type of object can be determined by examining thetypeelement ofstruct io_sysctl. which can beIOSTAT_DISK(disk drive),IOSTAT_TAPE(tape drive), orIOSTAT_NFS(NFS mount). πhw.machine(HW_MACHINE) β the machine class.hw.machine_arch(HW_MACHINE_ARCH) β the machine CPU class.hw.model(HW_MODEL) β the machine model.hw.ncpu(HW_NCPU) β the number of CPUs configured.hw.ncpuonline(HW_NCPUONLINE) β the number of CPUs online.hw.pagesize(HW_PAGESIZE) β the software page size.hw.physmem(HW_PHYSMEM) β the bytes of physical memory as a 32-bit integer.hw.physmem64(HW_PHYSMEM64) β the bytes of physical memory as a 64-bit integer.hw.usermem(HW_USERMEM) β the bytes of non-kernel memory as a 32-bit integer.hw.usermem64(HW_USERMEM64) β the bytes of non-kernel memory as a 64-bit integer.
π§ The kern.* subtree π§
this subtree includes data generally related to the kernel β like, the whole vibe of the kernel itself. the string and integer information available for the kern level is detailed below. the changeable column shows whether a process with appropriate privilege may change the value. π
okay so here's the whole menu of kern. second-level names β type on the left, whether you're allowed to change it on the right. I'm putting the changeability right there with the type so you don't have to squint at anything π«Ά (and yeah, node means "not applicable" in the changeable column, she's built different).
kern.aio_listio_maxβinteger, changeable: yeskern.aio_maxβinteger, changeable: yeskern.arandomβinteger, changeable: nokern.argmaxβinteger, changeable: nokern.boothowtoβinteger, changeable: nokern.boottimeβstruct timespec, changeable: nokern.buildinfoβstring, changeable: nokern.ccpuβinteger, changeable: nokern.clockrateβstruct clockinfo, changeable: nokern.consdevβinteger, changeable: nokern.coredumpβnode, changeable: not applicablekern.cp_idβstruct, changeable: nokern.cp_timeβuint64_t[], changeable: nokern.cryptodevallowsoftβinteger, changeable: yeskern.defcorenameβstring, changeable: yeskern.detachallβinteger, changeable: yeskern.domainnameβstring, changeable: yeskern.driversβstruct kinfo_drivers, changeable: nokern.dump_on_panicβinteger, changeable: yeskern.expose_addressβinteger, changeable: yeskern.fileβstruct file, changeable: nokern.forkfsleepβinteger, changeable: yeskern.fscaleβinteger, changeable: nokern.fsyncβinteger, changeable: nokern.hardclock_ticksβinteger, changeable: nokern.heartbeat.max_periodβinteger, changeable: yeskern.hostidβinteger, changeable: yeskern.hostnameβstring, changeable: yeskern.iov_maxβinteger, changeable: nokern.ipcβnode, changeable: not applicablekern.job_controlβinteger, changeable: nokern.labeloffsetβinteger, changeable: nokern.labelsectorβinteger, changeable: nokern.login_name_maxβinteger, changeable: nokern.logsigexitβinteger, changeable: yeskern.lwpβstruct kinfo_lwp, changeable: yeskern.mapped_filesβinteger, changeable: nokern.maxfilesβinteger, changeable: yeskern.maxlwpβinteger, changeable: yeskern.maxpartitionsβinteger, changeable: nokern.maxphysβinteger, changeable: nokern.maxprocβinteger, changeable: yeskern.maxptysβinteger, changeable: yeskern.maxvnodesβinteger, changeable: yeskern.messagesβinteger, changeable: yeskern.mbufβnode, changeable: not applicablekern.memlockβinteger, changeable: nokern.memlock_rangeβinteger, changeable: nokern.memory_protectionβinteger, changeable: nokern.moduleβnode, changeable: not applicablekern.monotonic_clockβinteger, changeable: nokern.mqueueβnode, changeable: not applicablekern.msgbufβinteger, changeable: nokern.msgbufsizeβinteger, changeable: nokern.ngroupsβinteger, changeable: nokern.ntptimeβstruct ntptimeval, changeable: nokern.osreleaseβstring, changeable: nokern.osrevisionβinteger, changeable: nokern.ostypeβstring, changeable: nokern.pipeβnode, changeable: not applicablekern.poolβstruct pool_sysctl, changeable: nokern.posix1versionβinteger, changeable: nokern.posix_aioβinteger, changeable: nokern.posix_barriersβinteger, changeable: nokern.posix_reader_writer_locksβinteger, changeable: nokern.posix_semaphoresβinteger, changeable: nokern.posix_spin_locksβinteger, changeable: nokern.posix_threadsβinteger, changeable: nokern.posix_timersβinteger, changeable: nokern.procβstruct kinfo_proc, changeable: nokern.proc2βstruct kinfo_proc2, changeable: nokern.proc_argsβstring, changeable: nokern.profilingβnode, changeable: not applicablekern.rawpartitionβinteger, changeable: nokern.root_deviceβstring, changeable: nokern.root_partitionβinteger, changeable: nokern.rtc_offsetβinteger, changeable: yeskern.saved_idsβinteger, changeable: nokern.sbmaxβinteger, changeable: yeskern.schedβnode, changeable: not applicablekern.securelevelβinteger, changeable: raise onlykern.sofixedbufβboolean, changeable: yeskern.somaxkvaβinteger, changeable: yeskern.sooptionsβinteger, changeable: yeskern.synchronized_ioβinteger, changeable: nokern.timecounterβnode, changeable: not applicablekern.timexβstruct, changeable: nokern.tkstatβnode, changeable: not applicablekern.ttyβnode, changeable: not applicablekern.urandomβinteger, changeable: nokern.usercryptoβinteger, changeable: yeskern.userasymcryptoβinteger, changeable: yeskern.veriexecβnode, changeable: not applicablekern.versionβstring, changeable: nokern.vnodeβstruct vnode, changeable: no
and now the β¨loreβ¨ for each one:
kern.aio_listio_max
the absolute cap on how many async I/O ops you can shove into one single list I/O call. and like literally every variable that has anything to do with aio(3), this one can get created and yeeted dynamically when the matching kernel module gets loaded or unloaded π
kern.aio_max
the max number of asynchronous I/O operations. that's it, that's the tweet.
kern.arandom (KERN_ARND)
returns independent, uniformly distributed random bytes every single time you ask β as many as you want, up to 256, all pulled from the system entropy pool; go peek at rnd(4) for the deets π
reading kern.arandom is equivalent to reading up to 256 bytes at a time from /dev/urandom. reading it never blocks, and once the system entropy pool has full entropy, everything you read from kern.arandom afterwards is fit for use as cryptographic key material π for example, the arc4random(3) library routine uses kern.arandom internally to seed a cryptographic pseudorandom number generator. icon behaviour, honestly.
kern.argmax (KERN_ARGMAX)
the maximum bytes of argument that get handed to execve(2).
kern.boothowto
the flags that came in from the boot loader. hop over to reboot(2) if you wanna know what each flag actually means πΈ
kern.boottime (KERN_BOOTTIME)
you get a struct timespec structure back. it holds the time the system was booted β and for this purpose that time is defined as the moment the kernel first started accumulating clock ticks β
kern.bufq
this one's carrying info about the bufq(9) subsystem. rn the only third level name that's actually implemented is kern.bufq.strategies, which hands you a list of the buffer queue strategies currently available π¦
kern.buildinfo
when the kernel gets built, the build environment can optionally drop arbitrary info into this variable. cute little build-time easter egg.
kern.ccpu (KERN_CCPU)
the scheduler exponential decay value. math girlie things π
kern.clockrate (KERN_CLOCKRATE)
you get a struct clockinfo structure back. inside: the clock, statistics clock and profiling clock frequencies, the number of micro-seconds per hz tick, and the clock skew rate. hz(9) has additional details if you're feeling curious π₯
kern.consdev (KERN_CONSDEV)
console device. short and sweet.
kern.coredump
all the settings around set-id processes and coredumps π by default, set-id processes don't dump core in situations where other processes totally would. this node is how an admin changes that behaviour.
the third level name is kern.coredump.setid, and the fourth level variables are right here:
kern.coredump.setid.dumpβinteger, changeable: yeskern.coredump.setid.groupβinteger, changeable: yeskern.coredump.setid.modeβinteger, changeable: yeskern.coredump.setid.ownerβinteger, changeable: yeskern.coredump.setid.pathβstring, changeable: yes
and what they do:
kern.coredump.setid.dumpβ if it's non-zero, set-id processes will dump core π«Άkern.coredump.setid.groupβ the group-id for the set-id processes' coredump.kern.coredump.setid.modeβ the mode for the set-id processes' coredump. peepchmod(1)for how modes work.kern.coredump.setid.ownerβ the user-id that gets used as the owner of the set-id processes' coredump.kern.coredump.setid.pathβ the path where the set-id processes' coredumps get saved. same syntax askern.defcorename.
kern.cp_id (KERN_CP_ID)
a mapping of CPU number to CPU id. matching game π₯
kern.cp_time (KERN_CP_TIME)
returns an array of CPUSTATES uint64_ts. that array holds the number of clock ticks spent in the different CPU states. on multi-processor systems, the sum across all CPUs comes back to you β unless you gave it appropriate space for one data set for each CPU. you can also grab data for one specific CPU by adding the number of that CPU at the end of the MIB, which enlarges it by one π§
kern.cryptodevallowsoft
this variable controls userland access to hardware versus software transforms in the crypto(4) system π the available values are:
< 0β always force userlevel requests to use software transforms.= 0β if present, use hardware and grant userlevel requests for non-accelerated transforms (handling the latter in software).> 0β allow user requests only for transforms which are hardware-accelerated. yes that's a greater than zero situation, not an option name, we're still finishing up the last entry π«Άkern.defcorename(KERN_DEFCORENAME) β the default template for the name of core dump files. also peepproc.pid.corenamein the per-process variablesproc.*, andcore(5)for the format of this template. the default value is%n.coreand you can change it with the kernel config optionoptions DEFCORENAME(seeoptions(4)).kern.detachallβ detach all devices at shutdown. that's it, that's the whole vibe.kern.domainname(KERN_DOMAINNAME) β get or set the YP domain name.kern.drivers(KERN_DRIVERS) β returns an array ofstruct kinfo_driverscontaining the name and major device numbers of all the device drivers in the current kernel. thed_namefield is always a NUL terminated string. thed_bmajorfield gets set to-1if the driver doesn't have a block device. bestie said "no block device" and honestly valid πkern.expose_addressβ exposes kernel addresses insysctl(3)calls used byfstat(1)andsockstat(1).- set it to
0β access is not allowed. - set it to
1β only processes that have opened/dev/kmemcan have access. - set it to
2β every process is allowed. - defaults to
0for KASLR kernels and1otherwise.
- set it to
π¨ okay listen: allowing general access renders KASLR ineffective, and allowing only kmem accessing programs weakens KASLR if those programs can be subverted to leak the addresses. this is not the casual little toggle it looks like, fr.
kern.dump_on_panic(KERN_DUMP_ON_PANIC) β perform a crash dump onpanic(9).kern.file(KERN_FILE) β returns the entire file table. the returned data consists of a singlestruct filelistfollowed by an array ofstruct file, whose size depends on the current number of such objects in the system. so like, the size is doing its own thing based on how much is going on πkern.forkfsleep(KERN_FORKFSLEEP) β if thefork(2)system call fails due to a limit on the number of processes (either the globalmaxproclimit or the user's one), wait this many milliseconds before returningEAGAINerror to the process. useful to keep heavily forking runaway processes in bay π§ default zero (no sleep). maximum is 20 seconds.kern.fscale(KERN_FSCALE) β the kernel fixed-point scale factor.kern.fsync(KERN_FSYNC) β returns1if the IEEE Std 1003.1b-1993 (βPOSIX.1β) File Synchronization Option is available on this system, otherwise0.kern.hardclock_ticks(KERN_HARDCLOCK_TICKS) β returns the number ofhardclock(9)ticks.kern.heartbeat.max_periodβ time in seconds since the lastoptions HEARTBEATprogress check has passed before it will trigger a panic. seeoptions(4).kern.histβ this variable contains kernel history data if the kernel was configured for any of the optionsUVMHIST,USB_DEBUG,BIOHIST, orSCDEBUG. (seeoptions(4)for more details.) the third-level names correspond to each available history table. the values of the history tables are in an internal format, and can be decoded by thevmstat(1)utility's-Uand-uoptions; the-loption can be used to see which tables are available. lowkey a little archaeological dig πkern.hostid(KERN_HOSTID) β get or set the host identifier. this is aimed to replace the legacygethostid(3)andsethostid(3)system calls.kern.hostname(KERN_HOSTNAME) β get or set thehostname(1). main character of your prompt, honestly.kern.iov_max(KERN_IOV_MAX) β return the maximum number ofiovecstructures that a process has available for use withpreadv(2),pwritev(2),readv(2),recvmsg(2),sendmsg(2)andwritev(2). that's a whole friend group of syscalls π«Άkern.ipc(KERN_SYSVIPC) β return information about the SysV IPC parameters. the third level names for the ipc variables are detailed below π
Third level name Type Changeable
kern.ipc.sysvmsg integer no
kern.ipc.sysvsem integer no
kern.ipc.sysvshm integer no
kern.ipc.sysvipc_info struct no
kern.ipc.shmmax integer yes
kern.ipc.shmmni integer yes
kern.ipc.shmseg integer yes
kern.ipc.shmmaxpgs integer yes
kern.ipc.shm_use_phys integer yes
kern.ipc.msgmni integer yes
kern.ipc.msgseg integer yes
kern.ipc.semmni integer yes
kern.ipc.semmns integer yes
kern.ipc.semmnu integer yes
kern.ipc.sysvmsg(KERN_SYSVIPC_MSG) β returns1if System V style message queue functionality is available on this system, otherwise0.kern.ipc.sysvsem(KERN_SYSVIPC_SEM) β returns1if System V style semaphore functionality is available on this system, otherwise0.kern.ipc.sysvshm(KERN_SYSVIPC_SHM) β returns1if System V style share memory functionality is available on this system, otherwise0.kern.ipc.sysvipc_info(KERN_SYSVIPC_INFO) β return System V style IPC configuration and run-time information. the fourth level name selects the System V style IPC facility.
Fourth level name Type
KERN_SYSVIPC_MSG_INFO struct msg_sysctl_info
KERN_SYSVIPC_SEM_INFO struct sem_sysctl_info
KERN_SYSVIPC_SHM_INFO struct shm_sysctl_info
KERN_SYSVIPC_MSG_INFOβ return information on the System V style message facility. themsg_sysctl_infostructure is defined in<sys/msg.h>.KERN_SYSVIPC_SEM_INFOβ return information on the System V style semaphore facility. thesem_sysctl_infostructure is defined in<sys/sem.h>.KERN_SYSVIPC_SHM_INFOβ return information on the System V style shared memory facility. theshm_sysctl_infostructure is defined in<sys/shm.h>.
kern.ipc.shmmax(KERN_SYSVIPC_SHMMAX) β max shared memory segment size in bytes.kern.ipc.shmmni(KERN_SYSVIPC_SHMMNI) β max number of shared memory identifiers.kern.ipc.shmseg(KERN_SYSVIPC_SHMSEG) β max shared memory segments per process.kern.ipc.shmmaxpgs(KERN_SYSVIPC_SHMMAXPGS) β max amount of shared memory in pages.kern.ipc.shm_use_phys(KERN_SYSVIPC_SHMUSEPHYS) β locking of shared memory in physical memory. if0, memory can be swapped out, otherwise it will be locked in physical memory.kern.ipc.msgmniβ max number of message queue identifiers.kern.ipc.msgsegβ max number of number of message segments. π yes it literally says "number of number of", the manpage said what it said and I'm not editing her.kern.ipc.semmniβ max number of number of semaphore identifiers. same energy, iconic.kern.ipc.semmnsβ max number of number of semaphores in system.kern.ipc.semmnuβ max number of undo structures in system.
kern.job_control(KERN_JOB_CONTROL) β returns1if job control is available on this system, otherwise0.kern.labeloffset(KERN_LABELOFFSET) β the offset within the sector specified byKERN_LABELSECTORof thedisklabel(5).kern.labelsector(KERN_LABELSECTOR) β the sector number containing thedisklabel(5).kern.login_name_max(KERN_LOGIN_NAME_MAX) β the size of the storage required for a login name, in bytes, including the terminating NUL. yes bestie, the NUL counts toward the byte budget πΈkern.logsigexit(KERN_LOGSIGEXIT) β if this flag is non-zero, the kernel willlog(9)all process exits due to signals which create acore(5)file, and whether the coredump was created.kern.lwp(KERN_LWP) β returns information about the current light-weight process. thekinfo_lwpstructure is defined in<sys/sysctl.h>.kern.mapped_files(KERN_MAPPED_FILES) β returns1if the IEEE Std 1003.1b-1993 (βPOSIX.1β) Memory Mapped Files Option is available on this system, otherwise0.kern.maxfiles(KERN_MAXFILES) β the maximum number of open files that may be open in the system. this also controls the maximum file locks per unprivileged user enforced byfcntl(2)andflock(2). two jobs, one variable, she's versatile β¨kern.maxpartitions(KERN_MAXPARTITIONS) β the maximum number of partitions allowed per disk.kern.maxlwpβ the maximum number of Lightweight Processes (threads) the system allows per uid.kern.maxphys(KERN_MAXPHYS) β maximum raw I/O transfer size.kern.maxproc(KERN_MAXPROC) β the maximum number of simultaneous processes the system will allow.kern.maxptys(KERN_MAXPTYS) β the maximum number of pseudo terminals. this value can be both raised and lowered, though it cannot be set lower than number of currently used ptys. see alsopty(4).kern.maxvnodes(KERN_MAXVNODES) β the maximum number of vnodes available on the system. this cannot be lowered below the number of currently active vnodes. so like, respect the ones already thriving πkern.mbuf(KERN_MBUF) β return information about the mbuf control variables. mbufs are data structures which store network packets and other data structures in the networking code, seembuf(9). the third level names for the mbuf variables are detailed below. the Changeable column shows whether a process with appropriate privilege may change the value.
Third level name Type Changeable
kern.mbuf.mblowat integer yes
kern.mbuf.mclbytes integer yes
kern.mbuf.mcllowat integer yes
kern.mbuf.msize integer yes
kern.mbuf.nmbclusters integer yes
kern.mbuf.nmbclusters_limit integer no
the variables are as follows:
kern.mbuf.mblowat(MBUF_MBLOWAT) β the mbuf low water mark.kern.mbuf.mclbytes(MBUF_MCLBYTES) β the mbuf cluster size.kern.mbuf.mcllowat(MBUF_MCLLOWAT) β the mbuf cluster low water mark.
and that's where this part cuts off β more variables coming, don't go anywhere π
π kern.mbuf.msize (MBUF_MSIZE)
The mbuf base size. Short king. That's the whole entry, no notes.
π¦ kern.mbuf.nmbclusters (MBUF_NMBCLUSTERS)
The limit on the number of mbuf clusters. Okay but hear me: this one can only be increased β and it can only be increased on machines with direct-mapped pool pages. So there's no take-backs, no lowering it later. It's giving one-way street, ngl. π
kern.mbuf.nmbclusters_limit (MBUF_NMBCLUSTERS_LIMIT)
The limit of nmbclusters. Yes bestie, the limit of the limit. π
β kern.memlock (KERN_MEMLOCK)
Returns 1 if the IEEE Std 1003.1b-1993 (βPOSIX.1β) Process Memory Locking Option is available on this system, otherwise 0. Binary queen β it's a yes or a no, no in-between. β¨
kern.memlock_range (KERN_MEMLOCK_RANGE)
Returns 1 if the IEEE Std 1003.1b-1993 (βPOSIX.1β) Range Memory Locking Option is available on this system, otherwise 0.
π«Ά kern.memory_protection (KERN_MEMORY_PROTECTION)
Returns 1 if the IEEE Std 1003.1b-1993 (βPOSIX.1β) Memory Protection Option is available on this system, otherwise 0. Same energy, different option, we love a consistent trio. π
π kern.messages
Kernel console message verbosity. See <sys/reboot.h>. The mapping goes like this:
0β Silent βAB_SILENT1β Quiet βAB_QUIET2β Normal βAB_NORMAL3β Verbose βAB_VERBOSE4β Debug βAB_DEBUG
So like, 0 is "don't perceive me" and 4 is "I will tell you EVERYTHING". π
π kern.module
Settings related to kernel modules. The third level names for the settings are:
kern.module.autoloadβ integer β changeable: yeskern.module.autounload_unsafeβ integer β changeable: yeskern.module.autotimeβ integer β changeable: yeskern.module.verboseβ boolean β changeable: yes
The variables are as follows:
kern.module.autoload
A boolean that controls whether kernel modules are loaded automatically. See module(7) for details. iykyk.
kern.module.autounload_unsafe
A boolean that controls whether the kernel will autounload modules that were automatically loaded and have not been audited for autounload.
By default, only modules that have been audited will be autounloaded, and only if they were autoloaded to begin with. So the safe behaviour is the default, and this flag is you choosing chaos. π¨
kern.module.autotime
An integer that controls the delay before an attempt is made to automatically unload a module that was autoloaded. Setting this value to zero disables the autounload function. Zero = off, that's the whole trick. π
kern.module.verbose
A boolean that enables or disables verbose debug messages related to kernel modules. Turn it on when you want the kernel to overshare.
πΈ kern.monotonic_clock (KERN_MONOTONIC_CLOCK)
Returns the standard version the implementation of the IEEE Std 1003.1b-1993 (βPOSIX.1β) Monotonic Clock Option conforms to, otherwise 0. Time only goes forward, bestie. β³
π kern.mqueue
Settings related to POSIX message queues; see mqueue(3). Heads up: this node is created dynamically when the corresponding kernel module is loaded β so if you can't find it, that's why. π«
The third level names for the settings are:
kern.mqueue.mq_open_maxβ integer β changeable: yeskern.mqueue.mq_prio_maxβ integer β changeable: yeskern.mqueue.mq_max_msgsizeβ integer β changeable: yeskern.mqueue.mq_def_maxmsgβ integer β changeable: yeskern.mqueue.mq_max_maxmsgβ integer β changeable: yes
The variables are:
kern.mqueue.mq_open_max
The maximum number of message queue descriptors any single process can open.
kern.mqueue.mq_prio_max
The maximum priority of a message.
kern.mqueue.mq_max_msgsize
The maximum size of a message in a message queue.
kern.mqueue.mq_def_maxmsg
The default maximum message count.
kern.mqueue.mq_max_maxmsg
The maximum number of messages in a message queue. (Yes, max_maxmsg. They said what they said. π)
π§ kern.msgbuf (KERN_MSGBUF)
The kernel message buffer, rotated so that the head of the circular kernel message buffer is at the start of the returned data. Important lil caveat: the returned data may contain NUL bytes. So don't you dare treat it like a cute little C string, bestie. π
kern.msgbufsize (KERN_MSGBUFSIZE)
The maximum number of characters that the kernel message buffer can hold.
π₯ kern.ngroups (KERN_NGROUPS)
The maximum number of supplemental groups.
kern.ntptime (KERN_NTPTIME)
A struct ntptimeval structure is returned. This structure contains data used by the ntpd(8) program. Time girlies, rise. β°
π kern.osrelease (KERN_OSRELEASE)
The system release string.
kern.osrevision (KERN_OSREV)
The system revision, expressed as an integer.
kern.ostype (KERN_OSTYPE)
The system type string. Three lil identity sysctls, all iconic, all short. π
π kern.pipe (KERN_PIPE)
Pipe settings. The third level names for the integer pipe settings are detailed below, and the changeable column tells you whether a process with appropriate privilege may change the value:
kern.pipe.kvasizβ integer β changeable: yeskern.pipe.maxbigpipesβ integer β changeable: yeskern.pipe.maxkvaszβ integer β changeable: yeskern.pipe.limitkvaβ integer β changeable: yeskern.pipe.nbigpipesβ integer β changeable: yes
The variables are as follows:
kern.pipe.kvasiz (KERN_PIPE_KVASIZ)
Amount of kernel memory consumed by pipe buffers.
kern.pipe.maxbigpipes (KERN_PIPE_MAXBIGPIPES)
Maximum number of βbigβ pipes. Yes the quotes are doing heavy lifting there. π
kern.pipe.maxkvasz (KERN_PIPE_MAXKVASZ)
Maximum amount of kernel memory to be used for pipes.
kern.pipe.limitkva (KERN_PIPE_LIMITKVA)
Limit for direct transfers via page loan.
kern.pipe.nbigpipes (KERN_PIPE_NBIGPIPES)
Number of βbigβ pipes.
β¨ kern.pool
Provides statistics about the pool(9) and pool_cache(9) subsystems. Stats, not vibes β well, stats about the vibes. π
πΈ kern.posix1version (KERN_POSIX1)
The version of ISO/IEC 9945 (IEEE Std 1003.1 (βPOSIX.1β)) with which the system attempts to comply. Attempts is doing a lot of work in that sentence, but okay. π
kern.posix_aio
The version of IEEE Std 1003.1 (βPOSIX.1β) and its Asynchronous I/O option to which the system attempts to conform.
π¦ kern.posix_barriers (KERN_POSIX_BARRIERS)
The version of IEEE Std 1003.1 (βPOSIX.1β) and its Barriers option to which the system attempts to conform, otherwise 0.
kern.posix_reader_writer_locks (KERN_POSIX_READER_WRITER_LOCKS)
The version of IEEE Std 1003.1 (βPOSIX.1β) and its Read-Write Locks option to which the system attempts to conform, otherwise 0.
kern.posix_semaphores (KERN_POSIX_SEMAPHORES)
The version of IEEE Std 1003.1 (βPOSIX.1β) and its Semaphores option to which the system attempts to conform, otherwise 0.
kern.posix_spin_locks (KERN_POSIX_SPIN_LOCKS)
The version of IEEE Std 1003.1 (βPOSIX.1β) and its Spin Locks option to which the system attempts to conform, otherwise 0. (Spin locks: the extroverts of the locking world. π)
kern.posix_threads (KERN_POSIX_THREADS)
The version of IEEE Std 1003.1 (βPOSIX.1β) and its Threads option to which the system attempts to conform, otherwise 0.
kern.posix_timers (KERN_POSIX_TIMERS)
The version of IEEE Std 1003.1 (βPOSIX.1β) and its Timers option to which the system attempts to conform, otherwise 0.
π kern.proc (KERN_PROC)
Return the entire process table, or a subset of it. An array of struct kinfo_proc structures is returned, whose size depends on the current number of such objects in the system. So like... the array size is doing whatever it wants based on how many procs exist, stay flexible. π
The third and fourth level numeric names are as follows:
KERN_PROC_ALLβ fourth level is: NoneKERN_PROC_GIDβ fourth level is: A group IDKERN_PROC_PIDβ fourth level is: A process IDKERN_PROC_PGRPβ fourth level is: A process groupKERN_PROC_RGIDβ fourth level is: A real group IDKERN_PROC_RUIDβ fourth level is: A real user IDKERN_PROC_SESSIONβ fourth level is: A session IDKERN_PROC_TTYβ fourth level is: A tty deviceKERN_PROC_UIDβ fourth level is: A user ID
kern.proc2 (KERN_PROC2)
As for KERN_PROC, but an array of struct kinfo_proc2 structures are returned. The fifth level name is the size of the struct kinfo_proc2 and the sixth level name is the number of structures to return. Six levels deep, bestie β that's not a sysctl, that's a whole family tree. π³
π kern.proc_args (KERN_PROC_ARGS)
Return the argv or environment strings (or the number thereof) of a process. Multiple strings are returned separated by NUL characters. The third level name is the process ID. The fourth level name is as follows:
KERN_PROC_ARGVβ TheargvstringsKERN_PROC_ENVβ TheenvironstringsKERN_PROC_NARGVβ The number ofargvstringsKERN_PROC_NENVβ The number ofenvironstringsKERN_PROC_PATHNAMEβ The full pathname of the executableKERN_PROC_CWDβ The current working directory
π₯ kern.profiling (KERN_PROF)
Return profiling information about the kernel. Warning bestie: if the kernel is not compiled for profiling, attempts to retrieve any of the KERN_PROF values will fail with EOPNOTSUPP. So don't come crying to me, check your kernel config first. π
The third level names for the string and integer profiling information are detailed below, and the changeable column shows whether a process with appropriate privilege may change the value:
kern.profiling.countβu_short[]β changeable: yeskern.profiling.fromsβu_short[]β changeable: yeskern.profiling.gmonparamβstruct gmonparamβ changeable: nokern.profiling.stateβ integer β changeable: yeskern.profiling.tosβstruct tostructβ changeable: yes
The variables are as follows:
kern.profiling.count (GPROF_COUNT)
Array of statistical program counter counts.
kern.profiling.froms (GPROF_FROMS)
Array indexed by program counter of call-from points.
πΈ kern.profiling.gmonparams (GPROF_GMONPARAM)
Structure giving the sizes of the above arrays. (And yes, it's spelled gmonparams here β that's literally what the page says, don't @ me. π«Ά)
π©Ί kern.profiling.state (GPROF_STATE)
Profiling state, bestie. Set it to GMON_PROF_ON and profiling starts. Set it to GMON_PROF_OFF and profiling stops. that's it, that's the whole switch πΈ
kern.profiling.tos (GPROF_TOS)
An array of struct tostruct that describes where calls actually land and how many times each one happened. like a lil receipts folder for your function calls π§Ύ
kern.rawpartition (KERN_RAWPARTITION)
The raw partition of a disk, and ngl it's zero-indexed so a == 0. yes queen, we start at zero π
kern.root_device (KERN_ROOT_DEVICE)
The name of the root device, e.g. wd0. literally the origin story of your whole filesystem π«Ά
kern.root_partition (KERN_ROOT_PARTITION)
The root partition on the root device (a == 0). π
kern.rtc_offset (KERN_RTC_OFFSET)
Returns the offset of your real time clock from UTC, measured in minutes. iykyk π°οΈ
kern.saved_ids (KERN_SAVED_IDS)
Returns 1 if the saved set-group and saved set-user ID are available, otherwise not. it's giving "do we have the thing" energy π
kern.sbmax (KERN_SBMAX)
Maximum socket buffer size, in bytes. big buffer, big vibes π¦
kern.securelevel (KERN_SECURELVL)
Head on over to secmodel_securelevel(9) for this one β¨
kern.sched (dynamic)
This whole node is here to influence the scheduling of LWPs β their priorisation, how they're distributed on CPUs, and how they get moved between them. main character scheduler behavior fr fr π₯
Third level names:
kern.sched.cacheht_timeβ integer β changeable: yeskern.sched.balance_periodβ integer β changeable: yeskern.sched.average_weightβ integer β changeable: yeskern.sched.min_catchβ integer β changeable: yeskern.sched.timesoftintsβ integer β changeable: yeskern.sched.kpreempt_priβ integer β changeable: yeskern.sched.upreempt_priβ integer β changeable: yeskern.sched.maxtsβ integer β changeable: yeskern.sched.mintsβ integer β changeable: yeskern.sched.nameβ string β changeable: nokern.sched.rttsβ integer β changeable: nokern.sched.pri_minβ integer β changeable: nokern.sched.pri_maxβ integer β changeable: no
The variables are as follows, and yes we're going through all of them π
kern.sched.cacheht_time(dynamic) β Cache hotness time, aka how long a LWP gets kept on one particular CPU instead of being shuffled off to another one. This is the whole point: it reduces the overhead of flushing and reloading caches. Defaults to3ms. You gotta give it inhzunits, seemstohz(9). π§kern.sched.balance_period(dynamic) β The interval at which the CPU queues get checked for re-balancing. Defaults to300ms. Also needs to be given inhzunits, seemstohz(9). βοΈkern.sched.average_weight(dynamic) β This one influences how likely LWPs are to be migrated from one CPU's queue of LWPs that are ready to run over to a different, idle CPU. The value is the percentage used for weighting the average count of migratable threads from the past against the current number of migratable threads. Small value = more weight on the past, larger value = more weight on the current situation. Defaults to50, and it must be between0and100. respect the range bestie π«Άkern.sched.min_catch(dynamic) β Minimum count of migratable (runnable) threads needed for catching (stealing) from another CPU. Defaults to1, but you can bump it up to decrease the chance of thread migration between CPUs. light fingers, lowkey πkern.sched.timesoftints(dynamic) β Enables tracking of CPU time for soft interrupts as part of a LWP's real execution time. Set it to a non-zero value to enable it, and seeps(1)for printing CPU times. πkern.sched.kpreempt_pri(dynamic) β Minimum priority to trigger kernel preemption. π₯kern.sched.upreempt_pri(dynamic) β Minimum priority to trigger user preemption. π₯kern.sched.maxts(dynamic) β Scheduler-specific maximal time quantum, in milliseconds. Must be set to a value larger thanmintsand between10andhzas given by thekern.clockratesysctl. Provided by the M2 scheduler. πkern.sched.mints(dynamic) β Scheduler-specific minimal time quantum, in milliseconds. Must be set to a value smaller thanmaxtsand between1andhzas given by thekern.clockratesysctl. Provided by the M2 scheduler. πkern.sched.name(dynamic) β The scheduler name. Provided both by the M2 and the 4BSD scheduler. β¨kern.sched.rtts(dynamic) β Fixed scheduler-specific round-robin time quantum, in milliseconds. Provided both by the M2 and the 4BSD scheduler. πkern.sched.pri_min(dynamic) β Minimal POSIX real-time priority. Seesched(3). βkern.sched.pri_max(dynamic) β Maximal POSIX real-time priority. Seesched(3). β
kern.sofixedbuf (KERN_SOFIXEDBUF)
Prevents socket buffer autoscaling whenever a size is set with SO_SNDBUF or SO_RCVBUF. no surprise resizing, we said what we said π
kern.somaxkva (KERN_SOMAXKVA)
Maximum amount of kernel memory to be used for socket buffers, in bytes. πΎ
kern.sooptions
Sets the default socket option flags for socket(2) creation. Peep setsockopt(2) for the list of supported flags π
kern.synchronized_io (KERN_SYNCHRONIZED_IO)
Returns 1 if the IEEE Std 1003.1b-1993 (βPOSIX.1β) Synchronized I/O Option is available on this system, otherwise 0. it's literally a yes/no girlie β
kern.timecounter (dynamic)
Display and control the timecounter source of the system. very important, very demure π°οΈ
Third level names:
kern.timecounter.choiceβ string β changeable: nokern.timecounter.hardwareβ string β changeable: yeskern.timecounter.timestepwarningsβ integer β changeable: yes
The variables are as follows:
kern.timecounter.choice(dynamic) β The list of available timecounters, with their quality and frequency. it's giving menu πkern.timecounter.hardware(dynamic) β The currently selected timecounter source. the one that got picked πkern.timecounter.timestepwarnings(dynamic) β If non-zero, displays a message each time the time is stepped. π
kern.timex (KERN_TIMEX)
Not available. she's not coming to the function, bestie π
kern.tkstat (KERN_TKSTAT)
Returns information about the number of characters sent and received on ttys. The third level names for the tty statistic variables are detailed below, and the changeable column shows whether a process with appropriate privilege may change the value.
Third level names:
kern.tkstat.canccβ quad β changeable: nokern.tkstat.ninβ quad β changeable: nokern.tkstat.noutβ quad β changeable: nokern.tkstat.rawccβ quad β changeable: no
The variables are as follows:
kern.tkstat.cancc(KERN_TKSTAT_CANCC) β The number of canonical input characters. πkern.tkstat.nin(KERN_TKSTAT_NIN) β The total number of input characters. β¬ οΈkern.tkstat.nout(KERN_TKSTAT_NOUT) β The total number of output characters. β‘οΈkern.tkstat.rawcc(KERN_TKSTAT_RAWCC) β The number of raw input characters. π§
kern.tty
The third level names for the tty setup variables are detailed below, and the changeable column shows whether a process with appropriate privilege may change the value.
Third level names:
kern.tty.qsizeβ int β changeable: yes
The variables are as follows:
kern.tty.qsizeβ Control/display the size of the default input and output queues selected during tty creation. It gets converted to a power of two, and its range is between1024and65536. powers of two only, we don't do arbitrary here π
kern.uidinfo
Resource usage for the current user. it's your personal receipts π§Ύ
Third level names:
kern.uidinfo.proccntβ integer β changeable: nokern.uidinfo.lwpcntβ integer β changeable: nokern.uidinfo.lockcntβ integer β changeable: nokern.uidinfo.semcntβ integer β changeable: nokern.uidinfo.sbsizeβ integer β changeable: nokern.uidinfo.proccntβ Returns the number of active processes for the current user. π«Άkern.uidinfo.lwpcntβ Returns the number of active threads for the current user, and heads up: the first thread of each process is not counted. πkern.uidinfo.lockcntβ Number of locks held by the current user. πkern.uidinfo.semcntβ Number of semaphores held by the current user. π¦kern.uidinfo.sbsizeβ Number of bytes in socket buffers allocated to the current user. π¦
kern.urandom (KERN_URND)
Random integer value. chaos, but make it cryptographic π²
kern.usercrypto
When enabled, this allows userland to open(2) the /dev/crypto special device, which is the one used by the crypto(4) system. π
kern.userasymcrypto
Enables or disables the use of software asymmetric crypto support in the crypto(4) system. ποΈ
kern.veriexec
Runtime information for veriexec(8).
Third level names:
kern.veriexec.algorithmsβ string β changeable: nokern.veriexec.countβ node β changeable: not applicablekern.veriexec.strictβ integer β changeable: yeskern.veriexec.verboseβ integer β changeable: yeskern.veriexec.algorithmsβ Returns a string with the supported algorithms in Veriexec. the whole roster β¨kern.veriexec.countβ Sub-nodes get added to this node as new mounts are monitored by Veriexec. Each mount lives under its owntableNnode, and under each of those there will be three variables indicating the mount point, the file system type, and the number of entries. it grows, it's alive π¦kern.veriexec.strictβ Controls the strict level of Veriexec. Seesecurity(7)for more information on each level's implications. and bestie, please actually read that, the implications are real πkern.veriexec.verboseβ the vibes dial for Veriexec ποΈ. Set it to0and you only get the bare-minimum tea: fingerprint mismatches, entries getting yeeted from the tables, and modification of a fingerprinted file. Set it to1and it gets chatty (ie., when a file with a valid fingerprint is accessed). Verbose level2is straight-up debug mode π.kern.version(KERN_VERSION) β the system version string, aka the kernel's little name tag π.kern.vnode(KERN_VNODE) β returns the entire vnode table, bestie. Big dump energy. β οΈ note: the vnode table is not necessarily a consistent snapshot of the system, so don't come for me if it's a little chaotic. The returned data is an array whose size depends on the current number of such objects in the system, and each element of the array contains the kernel address of a vnodestruct vnode *followed by the vnode itselfstruct vnode.
The machdep.* subtree
The set of variables defined here is architecture dependent β so like, your mileage honestly varies by machine π«Ά. Most architectures define at least the following variable:
machdep.booted_kernelβ type: string, changeable: no (hands off, it's not that kind of variable β)
The net.* subtree
The string and integer information available for the net level is detailed below, and the changeable column tells you whether a process with appropriate privilege may change the value π. The second and third levels are typically the protocol family and protocol number, though this is not always the case (iconic of them, honestly).
net.routeβ routing messages, changeable: nonet.inetβ IPv4 values, changeable: yes β¨net.inet6β IPv6 values, changeable: yes β¨net.keyβ IPsec key management values, changeable: yes β¨
net.route (PF_ROUTE)
Returns the entire routing table or a subset of it. The data comes back as a sequence of routing messages (see route(4) for the header file, format and meaning π) β and the length of each message is contained in the message header.
So the levels work like this, bestie: the third level name is a protocol number, which is currently always 0. The fourth level name is an address family, which may be set to 0 to select all address families. The fifth and sixth level names are as follows:
NET_RT_FLAGSβ sixth level isrtflagsNET_RT_DUMPβ sixth level is: NoneNET_RT_IFLISTβ sixth level is: None
net.inet (PF_INET)
Get or set various global information about the IPv4 (Internet Protocol version 4). The third level name is the protocol, and the fourth level name is the variable name. The currently defined protocols and names are, and yes I'm listing every single one because you deserve the full menu π:
arp
arp/nd_delayβ integer, changeable βarp/nd_bmaxtriesβ integer, changeable βarp/nd_umaxtriesβ integer, changeable βarp/nd_basereachableβ integer, changeable βarp/nd_retransβ integer, changeable βarp/nd_nudβ integer, changeable βarp/nd_maxnudhintβ integer, changeable βarp/log_movementsβ integer, changeable βarp/log_permanent_modifyβ integer, changeable βarp/log_unknown_networkβ integer, changeable βarp/log_wrong_ifaceβ integer, changeable β
carp
carp/allowβ integer, changeable βcarp/preemptβ integer, changeable βcarp/logβ integer, changeable βcarp/arpbalanceβ integer, changeable β
icmp
icmp/errppslimitβ integer, changeable βicmp/maskreplβ integer, changeable βicmp/rediracceptβ integer, changeable βicmp/redirtimeoutβ integer, changeable βicmp/bmcastechoβ integer, changeable βicmp/dynamic_rt_msgβ boolean, changeable β
ip
ip/allowsrcrtβ integer, changeable βip/anonportalgo.selectedβ string, changeable βip/anonportalgo.availableβ string, changeable βip/anonportalgo.reserveβ struct, changeable βip/anonportmaxβ integer, changeable βip/anonportminβ integer, changeable βip/checkinterfaceβ integer, changeable βip/dad_countβ integer, changeable βip/directed-broadcastβ integer, changeable βip/do_loopback_cksumβ integer, changeable βip/forwardingβ integer, changeable βip/forwsrcrtβ integer, changeable βip/gifttlβ integer, changeable βip/grettlβ integer, changeable βip/hashsizeβ integer, changeable βip/hostzerobroadcastβ integer, changeable βip/lowportminβ integer, changeable βip/lowportmaxβ integer, changeable βip/maxflowsβ integer, changeable βip/maxfragpacketsβ integer, changeable βip/mtudiscβ integer, changeable βip/mtudisctimeoutβ integer, changeable βip/random_idβ integer, changeable βip/redirectβ integer, changeable βip/subnetsarelocalβ integer, changeable βip/ttlβ integer, changeable β
tcp
tcp/rfc1323β integer, changeable βtcp/sendspaceβ integer, changeable βtcp/recvspaceβ integer, changeable βtcp/mssdfltβ integer, changeable βtcp/syn_cache_limitβ integer, changeable βtcp/syn_bucket_limitβ integer, changeable βtcp/syn_cache_intervalβ integer, changeable βtcp/init_winβ integer, changeable βtcp/init_win_localβ integer, changeable βtcp/mss_ifmtuβ integer, changeable βtcp/win_scaleβ integer, changeable βtcp/timestampsβ integer, changeable βtcp/cwmβ integer, changeable βtcp/cwm_burstsizeβ integer, changeable βtcp/ack_on_pushβ integer, changeable βtcp/keepidleβ integer, changeable βtcp/keepintvlβ integer, changeable βtcp/keepcntβ integer, changeable βtcp/slowhzβ integer, changeable: no πtcp/keepinitβ integer, changeable βtcp/log_refusedβ integer, changeable βtcp/rstppslimitβ integer, changeable βtcp/identβ struct, changeable: no πtcp/dropβ struct, changeable: no πtcp/sack.enableβ integer, changeable βtcp/sack.globalholesβ integer, changeable: no πtcp/sack.globalmaxholesβ integer, changeable βtcp/sack.maxholesβ integer, changeable βtcp/ecn.enableβ integer, changeable βtcp/ecn.maxretriesβ integer, changeable βtcp/congctl.selectedβ string, changeable βtcp/congctl.availableβ string, changeable βtcp/abc.enableβ integer, changeable βtcp/abc.aggressiveβ integer, changeable β
udp
udp/checksumβ integer, changeable βudp/do_loopback_cksumβ integer, changeable βudp/recvspaceβ integer, changeable βudp/sendspaceβ integer, changeable β
The variables are as follows π (this is the part where it gets good):
arp.nd_delayβ the delay in seconds before sending the first probe, after it has been decided that the entry is stale. β³arp.nd_bmaxtriesβ the maximum number of broadcasts send to discover the hardware address claiming an IP address.arp.nd_umaxtriesβ the maximum number of unicasts send to the hardware address to ensure it still claims an IP address.arp.nd_basereachableβ the number of milliseconds the ARP entry is considered reachable before probing reachability.arp.nd_retransβ the number of milliseconds between ARP probes.arp.nd_nudβ if set to non-zero, perform Neighor Unreachability Detection. π (yes, that's how it's spelled in the source, don't @ me)arp.nd_maxnudhintβ Neighbor discovery permits upper layer protocols to supply reachability hints, to avoid unnecessary neighbor discovery exchanges. This variable defines the number of consecutive hints the neighbor discovery layer will take. For example, by setting the variable to3, neighbor discovery layer will take 3 consecutive hints in maximum. After receiving 3 hints, neighbor discovery layer will perform normal neighbor discovery process. π§ β¨carp.allowβ if set to0, incomingcarp(4)packets will not be processed. If set to any other value, processing will occur. Enabled by default π.
carp.arpbalance
Set this to literally anything that isn't 0 and the ARP balancing magic of carp(4) turns on β¨. Here's the vibe: when ARP requests come in for an IP address that belongs to any of your virtual hosts, carp hashes the source IP from that ARP request to pick one lucky virtual host out of the whole set of hosts that share that IP. Then the master of that chosen host answers with the correct virtual MAC address π. Off by default, bestie.
carp.log
If you set this to any value other than 0, carp(4) will log its errors π. Disabled by default.
carp.preempt
Okay so this one's the "do I fight for the throne" switch π. If it's 0, carp(4) will not try to become master while it's still hearing advertisements from another active master. If it's set to any other value, carp will snatch the virtual host crown if it thinks it can send advertisements more frequently than whoever's currently master. Disabled by default.
ip.allowsrcrt
Set to 1 and the host accepts source routed packets π£οΈ.
ip.anonportalgo.available
The available RFC 6056 port randomization algorithms β like, the whole lineup of what's on the menu for port picking π².
ip.anonportalgo.reserve
A bitmask of ports that will not be used during anonymous or privileged port selection π . Reserved means reserved, periodt.
ip.anonportalgo.selected
The currently selected RFC 6056 port randomization algorithm; peep rfc6056(7) for the details π.
ip.anonportmax
The highest port number to use for TCP and UDP ephemeral port allocation π₯. This cannot be set to less than 1024 or greater than 65535, and it must be greater than ip.anonportmin.
ip.anonportmin
The lowest port number to use for TCP and UDP ephemeral port allocation πΈ. This cannot be set to less than 1024 or greater than 65535.
ip.checkinterface
If set to non-zero, the host will reject packets addressed to it that arrive on an interface not bound to that address π«. > Heads up fr fr: currently this has to be disabled if NAT is used to translate the destination address to another local interface, or if addresses are added to the loopback interface instead of the interface where the packets for those packets are received.
ip.dad_count
The number of arp(4) probes sent for Address Conflict Detection π. Set it to 0 to disable this entirely.
ip.directed-broadcast
If set to 1, enables directed broadcast behavior for the host π’.
ip.do_loopback_cksum
Perform IP checksum on loopback β .
ip.forwarding
If set to 1, enables IP forwarding for the host β meaning the host is acting as a router π¦. Main character energy, honestly.
ip.forwsrcrt
If set to 1, enables forwarding of source-routed packets for the host π€οΈ. > Careful bestie: this value may only be changed if the kernel security level is less than 1.
ip.gifttl
The maximum time-to-live (hop count) value for an IPv4 packet generated by a gif(4) tunnel interface β³.
ip.grettl
The maximum time-to-live (hop count) value for an IPv4 packet generated by a gre(4) tunnel interface β³.
ip.hashsize
The size of the IPv4 Fast Forward hash table ποΈ. This value must be a power of 2 (64, 256...). A larger hash table size results in fewer collisions β fewer collisions is literally the dream π
. Also see ip.maxflows.
ip.hostzerobroadcast
All zeroes address is broadcast address. Simple as that π―.
ip.lowportmax
The highest port number to use for TCP and UDP reserved port allocation π. This cannot be set to less than 0 or greater than 1024, and must be greater than ip.lowportmin.
ip.lowportmin
The lowest port number to use for TCP and UDP reserved port allocation π. This cannot be set to less than 0 or greater than 1024, and must be smaller than ip.lowportmax.
ip.maxflows
IPv4 Fast Forwarding is enabled by default β‘. If set to 0, IPv4 Fast Forwarding is disabled. ip.maxflows controls the maximum amount of flows which can be created. The default value is 256.
ip.maxfragpackets
The maximum number of fragmented packets the node will accept π¦. 0 means the node will not accept any fragmented packets. -1 means the node will accept as many fragmented packets as it receives. The flag is provided basically for avoiding possible DoS attacks π‘οΈ.
ip.mtudisc
If set to 1, enables Path MTU Discovery (RFC 1191) π§. When Path MTU Discovery is enabled, the transmitted TCP segment size will be determined by the advertised maximum segment size (MSS) from the remote end, as constrained by the path MTU. If MTU Discovery is disabled, the transmitted segment size will never be greater than tcp.mssdflt (the local maximum segment size).
ip.mtudisctimeout
The number of seconds in which a route added by the Path MTU Discovery engine will time out β±οΈ. When the route times out, the Path MTU Discovery engine will attempt to probe a larger path MTU.
ip.random_id
Assign random ip_id values π².
ip.redirect
If set to 1, ICMP redirects may be sent by the host β©οΈ. This option is ignored unless the host is routing IP packets, and should normally be enabled on all systems.
ip.subnetsarelocal
If set to 1, subnets are to be considered local addresses π‘.
ip.ttl
The maximum time-to-live (hop count) value for an IP packet sourced by the system β³. This value applies to normal transport protocols, not to ICMP.
icmp.errppslimit
This variable specifies the maximum number of outgoing ICMP error messages, per second π¨. ICMP error messages that exceeded the value are subject to rate limitation and will not go out from the node. A negative value disables rate limitation.
icmp.maskrepl
If set to 1, ICMP network mask requests are to be answered π.
icmp.rediraccept
If set to non-zero, the host will accept ICMP redirect packets β©οΈ. > Note that routers will never accept ICMP redirect packets, and the variable is meaningful on IP hosts only.
icmp.redirtimeout
This variable specifies the lifetime of routing entries generated by incoming ICMP redirect β³. This defaults to 600 seconds.
icmp.returndatabytes
Number of bytes to return in an ICMP error message π.
icmp.bmcastecho
If set to 1, enables responding to ICMP echo or timestamp request to the broadcast address π‘.
icmp.dynamic_rt_msg
A boolean that says whether the kernel sends a routing message for RTM_DYNAMIC or not π§Ύ. If set to true, it sends such a routing message.
tcp.ack_on_push
If set to 1, TCP is to immediately transmit an ACK upon reception of a packet with PUSH set β‘. This can avoid losing a round trip time in some rare situations, but has the caveat of potentially defeating TCP's delayed ACK algorithm. > Use of this option is generally not recommended, but the variable exists in case your configuration really needs it π.
tcp.cwm
If set to 1, enables use of the Hughes/Touch/Heidemann Congestion Window Monitoring algorithm π. This algorithm prevents line-rate bursts of packets that could otherwise occur when data begins flowing on an idle TCP connection. These line-rate bursts can contribute to network and router congestion. This can be particularly useful on World Wide Web servers which support HTTP/1.1, which has lingering connections β iykyk π.
tcp.cwm_burstsize
The Congestion Window Monitoring allowed burst size, in terms of packet count π¦.
tcp.delack_ticks
Number of ticks to delay sending an ACK β²οΈ.
tcp.do_loopback_cksum
Perform TCP checksum on loopback β .
tcp.init_win
A value indicating the TCP initial congestion window πͺ. The valid range is 0 to 10 (maximum specified by RFC6928), with a default of 4 (approximately 4K per RFC3390).
tcp.init_win_local
Like tcp.init_win, but used when communicating with hosts on a local network ποΈ.
tcp.keepcnt
Number of keepalive probes sent before declaring a connection dead π. If set to zero, there is no limit; keepalives will be sent until some kind of response is received from the peer.
tcp.keepidle
Time a connection must be idle before keepalives are sent (if keepalives are enabled for the connection) π΄. See also tcp.slowhz.
tcp.keepintvl
Time after a keepalive probe is sent until, in the absence of any response, another probe is sent π. See also tcp.slowhz.
tcp.log_refused
If set to 1, refused TCP connections to the host will be logged π.
tcp.keepinit
Timeout in seconds during connection establishment β³.
tcp.mss_ifmtuβ set this to1and TCP works out the outgoing maximum segment size from the MTU of the interface it's actually leaving through. Set it to0and it uses whichever is bigger: that interface's MTU, or the largest non-loopback interface MTU on the whole system.tcp.mssdfltβ the default maximum segment size, both the one we advertise to our peer and the one we use when the peer doesn't advertise an MSS to us during connection setup, or when Path MTU Discovery (ip.mtudisc) is disabled. π«Ά bestie please do not touch this value unless you literally know exactly what you're doing.tcp.recvspaceβ the default TCP receive buffer size.tcp.rfc1323β set to1and the RFC 1323 extensions to TCP are enabled. slay.tcp.rstppslimitβ the max number of outgoing TCP RST packets per second. Any TCP RST packet that goes over that value gets rate limited and will not leave the node. A negative value disables rate limitation entirely.tcp.identβ returns the user ID of a connected socket pair. (that's for RFC1413 Identification Protocol lookups, iykyk)tcp.dropβ drops a TCP socket pair connection. πtcp.sack.enableβ set to1and RFC 2018 Selective ACKnowledgement is on.tcp.sack.globalholesβ global number of TCP SACK holes.tcp.sack.globalmaxholesβ global maximum number of TCP SACK holes.tcp.sack.maxholesβ maximum number of TCP SACK holes allowed per connection.tcp.ecn.enableβ set to1and RFC 3168 Explicit Congestion Notification is enabled.tcp.ecn.maxretriesβ how many times to retry sending the ECN-setup packet.tcp.sendspaceβ the default TCP send buffer size.tcp.slowhzβ the unit fortcp.keepidleandtcp.keepintvl; those variables are in ticks of a clock that tickstcp.slowhztimes per second. (so like, divide their values bytcp.slowhzto get seconds. math era β¨)tcp.syn_bucket_limitβ the maximum number of entries allowed per hash bucket in the TCP compressed state engine.tcp.syn_cache_limitβ the maximum number of entries allowed in the TCP compressed state engine.tcp.timestampsβ ifrfc1323is enabled, a value of1means RFC 1323 time stamp options β the ones used for measuring TCP round trip times β are enabled.tcp.win_scaleβ ifrfc1323is enabled, a value of1means RFC 1323 window scale options, for increasing the TCP window size, are enabled.tcp.congctl.availableβ the available TCP congestion control algorithms.tcp.congctl.selectedβ the currently selected TCP congestion control algorithm.tcp.abc.enableβ set to1and we use RFC 3465 Appropriate Byte Counting (ABC). Set to0and it's traditional Packet Counting.tcp.abc.aggressiveβ picks the L parameter from RFC 3465. L is the maximumcwndincrease for an ack during slow start. Set to1βL=2*SMSS. Set to0βL=1*SMSS. It has no effect unlesstcp.abc.enableis set to1. πudp.checksumβ set to1and UDP checksums are being computed. Received non-zero UDP checksums are always checked, no matter what. Disabling UDP checksums is strongly discouraged.udp.recvspaceβ the default UDP receive buffer size.udp.sendspaceβ the default UDP send buffer size.
for thenet.*.ipsecvariables, go peek atipsec(4)bestie π«Ά
π net.inet6 (PF_INET6) π
Get or set various global info about IPv6 (Internet Protocol version 6). The third level name is the protocol, and the fourth level name is the variable name. The currently defined protocols and names are:
icmp6errppslimitβ integer, changeable: yesmtudisc_hiwatβ integer, changeable: yesmtudisc_lowatβ integer, changeable: yesnd6_debugβ integer, changeable: yesnd6_delayβ integer, changeable: yesnd6_maxnudhintβ integer, changeable: yesnd6_mmaxtriesβ integer, changeable: yesnd6_pruneβ integer, changeable: yesnd6_umaxtriesβ integer, changeable: yesnd6_useloopbackβ integer, changeable: yesnodeinfoβ integer, changeable: yesrediracceptβ integer, changeable: yesredirtimeoutβ integer, changeable: yesreflect_pmtuβ boolean, changeable: yesdynamic_rt_msgβ boolean, changeable: yes
ip6accept_rtadvβ integer, changeable: yesaddctlpolicyβ structin6_addrpolicy, changeable: noanonportalgo.selectedβ string, changeable: yesanonportalgo.availableβ string, changeable: yesanonportalgo.reserveβ struct, changeable: yesanonportmaxβ integer, changeable: yesanonportminβ integer, changeable: yesauto_flowlabelβ integer, changeable: yesdad_countβ integer, changeable: yesdefmcasthlimβ integer, changeable: yesforwardingβ integer, changeable: yesgifhlimβ integer, changeable: yeshashsizeβ integer, changeable: yeshlimβ integer, changeable: yeshdrnestlimitβ integer, changeable: yeskame_versionβ string, changeable: nokeepfaithβ integer, changeable: yeslog_intervalβ integer, changeable: yeslowportmaxβ integer, changeable: yeslowportminβ integer, changeable: yesmaxdynroutesβ integer, changeable: yesmaxifprefixesβ integer, changeable: yesmaxifdefroutersβ integer, changeable: yesmaxflowsβ integer, changeable: yesmaxfragpacketsβ integer, changeable: yesmaxfragsβ integer, changeable: yesneighborgcthreshβ integer, changeable: yesparam_rt_msgβ integer, changeable: yesredirectβ integer, changeable: yesrr_pruneβ integer, changeable: yesuse_deprecatedβ integer, changeable: yesv6onlyβ integer, changeable: yes
udp6do_loopback_cksumβ integer, changeable: yesrecvspaceβ integer, changeable: yessendspaceβ integer, changeable: yes
β¨ The variables, explained β¨
ip6.accept_rtadvβ set it to a non-zero value and the node will accept ICMPv6 router advertisement packets and autoconfigure address prefixes and default routers. Heads up: the node has to be a host (not a router) for this option to be meaningful.ip6.anonportalgo.availableβ the available RFC 6056 port randomization algorithms.ip6.anonportalgo.reserveβ a bitmask of ports that will not be used during anonymous or privileged port selection.ip6.anonportalgo.selectedβ the currently selected RFC 6056 port randomization algorithm; peeprfc6056(7)for the details. πip6.anonportmaxβ the highest port number to use for TCP and UDP ephemeral port allocation. Can't be set below1024or above65535, and it must be greater thanip6.anonportmin.ip6.anonportminβ the lowest port number to use for TCP and UDP ephemeral port allocation. Can't be set below1024or above65535.ip6.auto_flowlabelβ on connected transport protocol packets, fills the IPv6 flowlabel field to help intermediate routers identify packet flows.ip6.dad_countβ configures the number of IPv6 DAD (duplicated address detection) probe packets. These packets get generated when IPv6 interface addresses are configured.ip6.defmcasthlimβ the default hop limit value for an IPv6 multicast packet sourced by the node. Applies to all the transport protocols sitting on top of IPv6. There are APIs to override this value, as documented inip6(4).ip6.forwardingβ set to1and IPv6 forwarding is enabled for the node, meaning the node is acting as a router. Set to0and IPv6 forwarding is disabled, meaning the node is acting as a host. The IPv6 spec defines "router" case and "host" case node behavior quite differently, so changing this variable during operation may cause serious trouble. It is recommended to configure it at bootstrap time, and bootstrap time only. π
ip6.gifhlimβ the max hop limit value an IPv6 packet can have when it's generated by agif(4)tunnel interface πip6.hdrnestlimitβ how many IPv6 extension headers are allowed on incoming IPv6 packets. Set it to0and the node will accept as many extension headers as possible (yes, as many as possible, bestie, be careful with that one π).ip6.hashsizeβ the size of the IPv6 Fast Forward hash table. It must be a power of 2 (64,256, ...). Bigger table = fewer collisions. Also peepip6.maxflowsπip6.hlimβ the default hop limit value for an IPv6 unicast packet sourced by the node. This applies to all the transport protocols sitting on top of IPv6, and there are APIs to override it, as documented inip6(4)β¨ip6.kame_versionβ a string that identifies the version of the KAME IPv6 stack implemented in the kernel πip6.keepfaithβ set it to non-zero and it enables the βFAITHβ TCP relay IPv6-to-IPv4 translator code in the kernel. Refer tofaith(4)andfaithd(8)for the details π«Άip6.log_intervalβ controls the amount of logs generated by the IPv6 packet forwarding engine, by setting the interval between log output (in seconds) πip6.lowportmaxβ the highest port number to use for TCP and UDP reserved port allocation. Can't be set to less than0or greater than1024, and it must be greater thanip6.lowportmin. No cap on the drama, but there is a cap on this number πip6.lowportminβ the lowest port number to use for TCP and UDP reserved port allocation. Can't be set to less than0or greater than1024, and it must be smaller thanip6.lowportmax. It's giving "these two are literally a matched set" πip6.maxdynroutesβ maximum number of routes created by redirect. Set it to a negative value to disable. The default value is4096π₯ip6.maxifprefixesβ maximum number of prefixes created by route advertisements per interface. Set it to a negative value to disable. The default value is16βip6.maxifdefrouters 16β maximum number of default routers created by route advertisements per interface. Set it to a negative value to disable. The default value is16π¦ip6.maxflowsβ IPv6 Fast Forwarding is enabled by default. If set to0, IPv6 Fast Forwarding is disabled.ip6.maxflowscontrols the maximum amount of flows which can be created. The default value is256πip6.maxfragpacketsβ the maximum number of fragmented packets the node will accept.0means the node will not accept any fragmented packets.-1means the node will accept as many fragmented packets as it receives. This flag is provided basically for avoiding possible DoS attacks π‘οΈip6.maxfragsβ the maximum number of fragments the node will accept.0means the node will not accept any fragments.-1means the node will accept as many fragments as it receives. Same deal: the flag is provided basically for avoiding possible DoS attacks πip6.neighborgcthreshβ maximum number of entries in the neighbor cache per interface. Set to a negative value to disable. The default value is2048π§ip6.param_rt_msgβ if set to0, the parameter changing routing message is suppressed. If set to1, the parameter changing routing message is sent byRTM_NEWADDR. Other values are undefined yet β so like, don't. πip6.redirectβ if set to1, ICMPv6 redirects may be sent by the node. This option is ignored unless the node is routing IP packets, and it should normally be enabled on all systems πip6.rr_pruneβ specifies the interval between IPv6 router renumbering prefix babysitting, in seconds πΆip6.use_deprecatedβ controls use of deprecated address, as specified inRFC 2462 5.5.4πip6.v6onlyβ specifies the initial value for theIPV6_V6ONLYsocket option forAF_INET6sockets. Please refer toip6(4)for detail πicmp6.errppslimitβ specifies the maximum number of outgoing ICMPv6 error messages, per second. ICMPv6 error messages that exceeded the value are subject to rate limitation and will not go out from the node. A negative value disables rate limitation π¦icmp6.mtudisc_hiwat,icmp6.mtudisc_lowatβ these variables define the maximum number of routing table entries created due to path MTU discovery (which prevents denial-of-service attacks with ICMPv6 too big messages). When IPv6 path MTU discovery happens, we keep path MTU information in the routing table. If the number of routing table entries exceeds the value, the kernel will not attempt to keep the path MTU information.icmp6.mtudisc_hiwatis used when we have verified ICMPv6 too big messages.icmp6.mtudisc_lowatis used when we have unverified ICMPv6 too big messages. Verification is performed by using address/port pairs kept in connected pcbs. A negative value disables the upper limit πicmp6.nd6_debugβ if set to non-zero, the kernel IPv6 neighbor discovery code will generate debugging messages. Those debug outputs are useful to diagnose IPv6 interoperability issues. The flag must be set to0for normal operation β read that again, bestie β οΈicmp6.nd6_delayβ specifies theDELAY_FIRST_PROBE_TIMEtiming constant in the IPv6 neighbor discovery specification (RFC 2461), in seconds β³icmp6.nd6_maxnudhintβ neighbor discovery permits upper layer protocols to supply reachability hints, to avoid unnecessary neighbor discovery exchanges. This variable defines the number of consecutive hints the neighbor discovery layer will take. For example, by setting the variable to3, the neighbor discovery layer will take 3 consecutive hints in maximum. After receiving 3 hints, the neighbor discovery layer will perform the normal neighbor discovery process π‘icmp6.nd6_mmaxtriesβ specifies theMAX_MULTICAST_SOLICITconstant in the IPv6 neighbor discovery specification (RFC 2461) π’icmp6.nd6_pruneβ specifies the interval between IPv6 neighbor cache babysitting, in seconds π§Ήicmp6.nd6_umaxtriesβ specifies theMAX_UNICAST_SOLICITconstant in the IPv6 neighbor discovery specification (RFC 2461) π£icmp6.nd6_useloopbackβ if set to non-zero, the kernel IPv6 stack will use the loopback interface for local traffic πicmp6.nodeinfoβ enables responses to ICMPv6 node information queries. If you set it to0, responses will not be generated for ICMPv6 node information queries. Since node information queries can have a security impact, it's possible to fine tune which responses should be answered. Two separate bits can be set ποΈ1β respond to ICMPv6 FQDN queries, e.g.ping6 -w.2β respond to ICMPv6 node addresses queries, e.g.ping6 -a.
icmp6.rediracceptβ if set to non-zero, the host will accept ICMPv6 redirect packets. Note that IPv6 routers will never accept ICMPv6 redirect packets, and the variable is meaningful on IPv6 hosts (non-router) only π ββοΈicmp6.redirtimeoutβ specifies the lifetime of routing entries generated by incoming ICMPv6 redirect βicmp6.reflect_pmtuβ a boolean for whether icmpv6 reflecting uses path MTU discovery or not. When not, icmpv6 reflecting usesIPV6_MINMTUπͺicmp6.dynamic_rt_msgβ a boolean for whether the kernel sends a routing message forRTM_DYNAMICor not. If set to true, it sends such a routing message π¨udp6.do_loopback_cksumβ perform UDP checksum on loopback βudp6.recvspaceβ default UDP receive buffer size π₯udp6.sendspaceβ default UDP send buffer size π€
Variables net.inet6.tcp6.* and net.inet6.udp6.* have identical meanings to net.inet.tcp.* and net.inet.udp.*, respectively. Please refer to the PF_INET section above. For variables net.*.ipsec6, please refer to ipsec(4) π«‘
π net.key (PF_KEY)
Get or set various global information about the IPsec key management. The third level name is the variable name. The currently defined variable and names are:
Variable Type Changeable
debug integer yes
enabled integer yes
used integer no
spi_try integer yes
spi_min_value integer yes
spi_max_value integer yes
larval_lifetime integer yes
blockacq_count integer yes
blockacq_lifetime integer yes
esp_keymin integer yes
esp_auth integer yes
ah_keymin integer yes
allow_different_idtype boolean yes
The variables are as follows:
debugβ turns on debugging messages from inside the kernel β¨ the value is a bitmap, exactly as defined in<netipsec/key_debug.h>.enabledβ controls how IPsec control messages get processed π0β never allow IPsec processing1β allow IPsec processing when SPD policies are present2β force IPsec processing even when SPD policies are not present
usedβ shows whether IPsec is actually being used, based on whether IPsec is enabled and whether SPD rules exist. > β οΈ heads up bestie: currently, once IPsec is being used, it cannot be disabled. Like, ever. It's giving permanent commitment πspi_tryβ how many times the kernel will try to grab a unique SPI when it generates one from the random number generator π²spi_min_valueβ the minimum SPI value when the kernel generates one.spi_max_valueβ the maximum SPI value when the kernel generates one.larval_lifetimeβ lifetime for LARVAL SAD entries, in seconds β³blockacq_countβ the number of ACQUIRE PF_KEY messages to be blocked after an ACQUIRE message. It stops a whole flood of ACQUIRE PF_KEY messages from being sent from the kernel to the key management daemon πblockacq_lifetimeβ lifetime of an ACQUIRE PF_KEY message.esp_keyminβ minimum ESP key length, in bits. This value is used when the kernel creates the proposal payload on an ACQUIRE PF_KEY message.esp_authβ whether ESP authentication should be used or not. A non-zero value means yes, ESP authentication should be used π The value is used when the kernel creates the proposal payload on an ACQUIRE PF_KEY message.ah_keyminβ minimum AH key length, in bits. The value is used when the kernel creates the proposal payload on an ACQUIRE PF_KEY message.allow_different_idtypeβ a boolean that allows or disallows different identifier types on IDii and IDir. Allowing it can improve interconnectivity with some VPN appliances π«Ά
πΈ net.local (PF_LOCAL)
Get or set various global info about AF_LOCAL type sockets. For some variables, the third level name is the variable name, iconic behavior honestly:
inflightβ typeinteger, changeable: nodeferredβ typeinteger, changeable: no
The variables are as follows:
inflightβ the number of file descriptors currently passed between processes, i.e. "in flight" βοΈdeferredβ the number of file descriptors passed between processes that have been deferred for cleanup by a kernel task π§Ή
Other variables are specific to a socket type:
dgram/pcblistβ typestruct, changeable: nodgram/recvspaceβ typeinteger, changeable: yesdgram/sendspaceβ typeinteger, changeable: yesseqpacket/pcblistβ typestruct, changeable: nostream/pcblistβ typestruct, changeable: nostream/recvspaceβ typeinteger, changeable: yesstream/sendspaceβ typeinteger, changeable: yes
The variables are as follows:
dgram.pcblistβ the Protocol Control Block list structure for datagram sockets. Parsed bynetstat(1)orsockstat(1)πdgram.recvspaceβ the default datagram receive buffer size.dgram.sendspaceβ the default datagram send buffer size.seqpacket.pcblistβ the Protocol Control Block list structure for Sequential Packet sockets. Parsed bynetstat(1)orsockstat(1).stream.pcblistβ the Protocol Control Block list structure for stream sockets. Parsed bynetstat(1)orsockstat(1).stream.recvspaceβ the default stream receive buffer size.stream.sendspaceβ the default stream send buffer size.
π§ The proc.* subtree
The string and integer info available for the proc level is detailed below. The changeable column tells you whether a process with appropriate privilege may change the value. These values are per-process, so they can literally change from one process to another β main character energy, each process gets its own β¨ When a process is created, the default values are inherited from its parent. When a set-user-ID or set-group-ID binary is executed, the value of PROC_PID_CORENAME is reset to the system default value. The second level name is either the magic value PROC_CURPROC, which points to the current process, or the PID of the target process π―
proc.pid.corenameβ typestring, changeable: yesproc.pid.rlimitβ typenode, changeable: not applicableproc.pid.stopforkβ typeint, changeable: yesproc.pid.stopexecβ typeint, changeable: yesproc.pid.stopexitβ typeint, changeable: yesproc.pid.paxflagsβ typeint, changeable: no
π proc.pid.corename (PROC_PID_CORENAME)
The template used for the core dump file name (see core(5) for the deets). The base name must either be core or end with the suffix .core β the super-user may set arbitrary names, because of course they can π By default it points to KERN_DEFCORENAME.
π¦ proc.pid.rlimit (PROC_PID_LIMIT)
Returns resource limits, as defined for the getrlimit(2) and setrlimit(2) system calls. The fourth level name is one of:
proc.pid.rlimit.cputime(PROC_PID_LIMIT_CPU) β the maximum amount of CPU time (in seconds) to be used by each process β±οΈproc.pid.rlimit.filesize(PROC_PID_LIMIT_FSIZE) β the largest size (in bytes) file that may be created.proc.pid.rlimit.datasize(PROC_PID_LIMIT_DATA) β the maximum size (in bytes) of the data segment for a process; this defines how far a program may extend its break with thesbrk(2)system call.proc.pid.rlimit.stacksize(PROC_PID_LIMIT_STACK) β the maximum size (in bytes) of the stack segment for a process; this defines how far a program's stack segment may be extended. Stack extension is performed automatically by the system πͺproc.pid.rlimit.coredumpsize(PROC_PID_LIMIT_CORE) β the largest size (in bytes) core file that may be created.proc.pid.rlimit.memoryuse(PROC_PID_LIMIT_RSS) β the maximum size (in bytes) to which a process's resident set size may grow. This puts a limit on the amount of physical memory handed to a process; if memory is tight, the system will prefer to take memory from processes that are exceeding their declared resident set size πproc.pid.rlimit.memorylocked(PROC_PID_LIMIT_MEMLOCK) β the maximum size (in bytes) which a process may lock into memory using themlock(2)function.proc.pid.rlimit.maxproc(PROC_PID_LIMIT_NPROC) β the maximum number of simultaneous processes for this user id.proc.pid.rlimit.descriptors(PROC_PID_LIMIT_NOFILE) β the maximum number of open files for this process.proc.pid.rlimit.sbsize(PROC_PID_LIMIT_SBSIZE) β the maximum size (in bytes) of the socket buffers set by thesetsockopt(2)SO_RCVBUFandSO_SNDBUFoptions.proc.pid.rlimit.vmemoryuse(PROC_PID_LIMIT_AS) β the maximum size (in bytes) which a process can obtain.proc.pid.rlimit.maxlwp(PROC_PID_LIMIT_NTHR) β the maximum number of threads that can be created and running at one time in the process. The first thread of each process is not counted against this π§΅
The fifth level name is one of soft (PROC_PID_LIMIT_TYPE_SOFT) or hard (PROC_PID_LIMIT_TYPE_HARD), to select the soft or hard limit respectively. Both are of type integer.
π proc.pid.stopfork (PROC_PID_STOPFORK)
If non-zero, the process's children will be stopped after fork(2) calls. The children are created in the SSTOP state and are never scheduled for running before being stopped. This feature lets you attach to a process with a debugger such as gdb(1) before the process even gets the chance to actually do anything π
This value is inherited by the process's children, and it also applies to emulation specific system calls that fork a new process, such as sproc() or clone().
π proc.pid.stopexec (PROC_PID_STOPEXEC)
If non-zero, the process will be stopped on the next exec(3) call. The process created by exec(3) is created in the SSTOP state and is never scheduled for running before being stopped. This feature lets you attach to a process with a debugger such as gdb(1) before the process even gets the chance to actually do anything.
This value is inherited by the process's children.
π proc.pid.stopexit (PROC_PID_STOPEXIT)
If non-zero, the process will be stopped when it has cause to exit, either by calling exit(3), _exit(2), or by receiving a specific signal. The process is stopped before any of its resources or vm space is released, which lets you examine the termination state of the process before it disappears π This feature can be used to examine the final conditions of the process's vmspace via pmap(1) or its resource settings with sysctl(8) before it vanishes.
This value is also inherited by the process's children.
β proc.pid.paxflags (PROC_PID_PAXFLAGS)
This read-only variable returns the current value of the process's pax flags (see paxctl(8)).
π The user.* subtree (CTL_USER)
The string and integer info available for the user level is detailed below. The changeable column shows whether a process with appropriate privilege may change the value.
user.atexit_maxβinteger, not changeable β¨user.bc_base_maxβinteger, not changeableuser.bc_dim_maxβinteger, not changeableuser.bc_scale_maxβinteger, not changeableuser.bc_string_maxβinteger, not changeableuser.coll_weights_maxβinteger, not changeableuser.cs_pathβstring, not changeableuser.expr_nest_maxβinteger, not changeableuser.line_maxβinteger, not changeableuser.posix2_c_bindβinteger, not changeableuser.posix2_c_devβinteger, not changeableuser.posix2_char_termβinteger, not changeableuser.posix2_fort_devβinteger, not changeableuser.posix2_fort_runβinteger, not changeableuser.posix2_localedefβinteger, not changeableuser.posix2_sw_devβinteger, not changeableuser.posix2_upeβinteger, not changeableuser.posix2_versionβinteger, not changeableuser.re_dup_maxβinteger, not changeableuser.stream_maxβinteger, not changeableuser.stream_maxβinteger, not changeable (yes bestie it's listed twice in the original, I'm not editing the sacred text π )user.tzname_maxβinteger, not changeable
πΈ user.atexit_max (USER_ATEXIT_MAX)
The max number of functions you can register with atexit(3). Stack 'em up, but know your limit. π
πΈ user.bc_base_max (USER_BC_BASE_MAX)
The biggest ibase/obase values you can use in the bc(1) utility.
πΈ user.bc_dim_max (USER_BC_DIM_MAX)
The biggest array size in bc(1). Big arrays, but not infinite arrays, bestie.
πΈ user.bc_scale_max (USER_BC_SCALE_MAX)
The biggest scale value in bc(1).
πΈ user.bc_string_max (USER_BC_STRING_MAX)
The longest string length in bc(1).
πΈ user.coll_weights_max (USER_COLL_WEIGHTS_MAX)
The max number of weights you can assign to any single entry of the LC_COLLATE order keyword in the locale definition file. Locale girlies stay winning π
πΈ user.cs_path (USER_CS_PATH)
Returns a value for the PATH environment variable that finds all the standard utilities. It's giving "I know where everything is" energy.
πΈ user.expr_nest_max (USER_EXPR_NEST_MAX)
The max number of expressions the expr(1) utility can nest inside parentheses. Deep nesting: respected. Bottomless nesting: not a thing.
πΈ user.line_max (USER_LINE_MAX)
The maximum length in bytes of a text-processing utility's input line.
πΈ user.posix2_char_term (USER_POSIX2_CHAR_TERM)
Returns 1 if the system supports at least one terminal type capable of all operations described in IEEE Std 1003.2 (βPOSIX.2β), otherwise 0. Yes/no, no maybes π¦
πΈ user.posix2_c_bind (USER_POSIX2_C_BIND)
Returns 1 if the system's C-language development facilities support the C-Language Bindings Option, otherwise 0.
πΈ user.posix2_c_dev (USER_POSIX2_C_DEV)
Returns 1 if the system supports the C-Language Development Utilities Option, otherwise 0.
πΈ user.posix2_fort_dev (USER_POSIX2_FORT_DEV)
Returns 1 if the system supports the FORTRAN Development Utilities Option, otherwise 0. FORTRAN girlies, this one's for you π
πΈ user.posix2_fort_run (USER_POSIX2_FORT_RUN)
Returns 1 if the system supports the FORTRAN Runtime Utilities Option, otherwise 0.
πΈ user.posix2_localedef (USER_POSIX2_LOCALEDEF)
Returns 1 if the system supports the creation of locales, otherwise 0.
πΈ user.posix2_sw_dev (USER_POSIX2_SW_DEV)
Returns 1 if the system supports the Software Development Utilities Option, otherwise 0.
πΈ user.posix2_upe (USER_POSIX2_UPE)
Returns 1 if the system supports the User Portability Utilities Option, otherwise 0.
πΈ user.posix2_version (USER_POSIX2_VERSION)
The version of IEEE Std 1003.2 (βPOSIX.2β) that the system is attempting to comply with. "Attempting" is doing a lot of heavy lifting there and I respect the honesty π
πΈ user.re_dup_max (USER_RE_DUP_MAX)
The max number of repeated occurrences of a regular expression that's permitted when you use interval notation. Regex girlies, this is your ceiling π§
πΈ user.stream_max (USER_STREAM_MAX)
The minimum maximum number of streams a process may have open at any one time. Yes, "minimum maximum" β sit with it.
πΈ user.tzname_max (USER_TZNAME_MAX)
The minimum maximum number of bytes supported for the name of a timezone (that is, a timezone abbreviation). Like UTC or EST β short kings only π
π The vm.* subtree (CTL_VM) π
Okay bestie, this is the virtual memory corner of the sysctl universe and it is lowkey the main character. Here's the string + integer info available at the vm level, and the changeable column tells you whether a process with appropriate privilege can change the value.
vm.anonmaxβint, changeable: yesvm.anonminβint, changeable: yesvm.bufcacheβint, changeable: yesvm.bufmemβint, changeable: novm.bufmem_hiwaterβint, changeable: yesvm.bufmem_lowaterβint, changeable: yesvm.execmaxβint, changeable: yesvm.execminβint, changeable: yesvm.filemaxβint, changeable: yesvm.fileminβint, changeable: yesvm.loadavgβstruct loadavg, changeable: novm.maxslpβint, changeable: novm.nkmempagesβint, changeable: novm.uspaceβint, changeable: novm.uvmexpβstruct uvmexp, changeable: novm.uvmexp2βstruct uvmexp_sysctl, changeable: novm.vmmeterβstruct vmtotal, changeable: novm.proc.mapβstruct kinfo_vmentry, changeable: novm.guard_sizeβunsigned int, changeable: novm.thread_guard_sizeβunsigned int, changeable: yesvm.swap_encryptβbool, changeable: yes
π₯ vm.anonmax (VM_ANONMAX)
The percentage of physical memory that will be reclaimed from other types of memory usage so it can store anonymous application data. Reclaiming: it's a whole vibe.
π₯ vm.anonmin (VM_ANONMIN)
The percentage of physical memory that will always be available for anonymous application data. (The original says "will be always be" β I am but a humble messenger π«Ά)
π₯ vm.bufcache (VM_BUFCACHE)
The percentage of physical memory that will be available for the buffer cache.
π₯ vm.bufmem (VM_BUFMEM)
The amount of kernel memory currently being used by the buffer cache. Reading only, bestie β look, don't touch.
π₯ vm.bufmem_lowater (VM_BUFMEM_LOWATER)
The minimum amount of kernel memory to reserve for the buffer cache.
π₯ vm.bufmem_hiwater (VM_BUFMEM_HIWATER)
The maximum amount of kernel memory to be used for the buffer cache.
π₯ vm.execmax (VM_EXECMAX)
The percentage of physical memory that will be reclaimed from other types of memory usage to store cached executable data.
π₯ vm.execmin (VM_EXECMIN)
The percentage of physical memory that will always be available for cached executable data.
π₯ vm.filemax (VM_FILEMAX)
The percentage of physical memory that will be reclaimed from other types of memory usage to store cached file data.
π₯ vm.filemin (VM_FILEMIN)
The percentage of physical memory that will always be available for cached file data.
π₯ vm.loadavg (VM_LOADAVG)
Returns the load average history. The data that comes back is a struct loadavg. Uptime girlies know β¨
π₯ vm.maxslp (VM_MAXSLP)
The value of the maxslp kernel global variable.
π₯ vm.vmmeter (VM_METER)
Returns system wide virtual memory statistics. The returned data consists of a struct vmtotal.
π₯ vm.user_va0_disable
A flag that controls whether user processes can map virtual address 0. Literally address zero. The void. Respect it π³οΈ
π₯ vm.proc.map (VM_PROC)
So this one's a whole little ladder: the third level is VM_PROC_MAP, the fourth is the pid of the process you want the vm object entries for, and the fifth is the size of struct kinfo_vmentry. Returns an array of struct kinfo_vmentry objects. Nested like a set of matryoshka dolls, honestly π
π₯ vm.ubc_direct [EXPERIMENTAL, default off]
Uses direct map for UBC I/O, avoiding the need to map and unmap buffer memory. Speeds up operation for fast I/O devices like NVMe, especially on multi-CPU systems. Only available on some architectures.
β οΈ It's labelled EXPERIMENTAL and defaults to off β so like, proceed with the confidence of someone who read the label, not someone who didn't π
π₯ vm.uspace (VM_USPACE)
The number of bytes allocated for each kernel stack.
π₯ vm.uvmexp (VM_UVMEXP)
Returns system wide virtual memory statistics. The returned data consists of a struct uvmexp.
π₯ vm.uvmexp2 (VM_UVMEXP2)
Returns system wide virtual memory statistics. The returned data consists of a struct uvmexp_sysctl. Yes, there's a 2 β they're cousins, not twins π
π₯ vm.guard_size
Returns the system wide guard size for the main thread of a program.
π₯ vm.thread_guard_size
Returns the system wide default size for the guard area of all the other threads of a program. Main character gets vm.guard_size, the ensemble cast gets this one π
π₯ vm.swap_encrypt
If true, encrypt data while it's swapped out to disk. Iconic, security-conscious behaviour.
Each swap device maintains an independent AES-256 key, generated when the first page is swapped to that device. Each page is swapped independently using AES-CBC, with an initialization vector chosen by the encryption under the AES-256 key of the little-endian swap slot number padded to 128 bits with zeros. (This is essentially the cgd(4) βencblkno1β method.)
β οΈ Changes tovm.swap_encryptonly affect pages of swap newly written out. To force encrypting or decrypting all existing swap, or to rekey previously encrypted swap, you can remove the swap devices and re-add them withswapctl(8)β with the caveat that whatever pages were already written to disk unencrypted, or encrypted with a compromised key, may still be written to disk afterward. So yeah. That's a real caveat, not a vibe. Read it twice π
π οΈ The ddb.* subtree (CTL_DDB) π οΈ
Kernel debugger territory. The info available at the ddb level is below, and the changeable column tells you whether a process with appropriate privilege can change the value.
ddb.commandonenterβstring, changeable: yesddb.dumpstackβinteger, changeable: yesddb.fromconsoleβinteger, changeable: yesddb.linesβinteger, changeable: yesddb.maxoffβinteger, changeable: yesddb.maxwidthβinteger, changeable: yesddb.onpanicβinteger, changeable: yesddb.panicstackframesβinteger, changeable: yesddb.radixβinteger, changeable: yesddb.tabstopsβinteger, changeable: yesddb.tee_msgbufβinteger, changeable: yes
π§ ddb.commandonenter
If it's not empty, this string is used as the DDB command to be executed each time DDB is entered. Automatic on-entry behaviour? We love a self-starting queen π
π§ ddb.dumpstack
A value of 1 causes a stack trace to be printed on entering ddb from a panic. A value of 0 disables this behaviour. The default value is 1. So yes, by default you do get the receipts π
π§ ddb.fromconsole (DDBCTL_FROMCONSOLE)
If it's not zero, DDB may be entered by sending a break on a serial console, or by a special key sequence on a graphics console. Remote-entry energy π₯
π§ ddb.lines (DDBCTL_LINES)
Number of display lines.
ddb.maxoff(DDBCTL_MAXOFF) β the biggest symbol offset allowed. the ceiling, basically.ddb.maxwidth(DDBCTL_MAXWIDTH) β how wide an output line can get. no infinity scarves for your terminal.ddb.onpanic(DDBCTL_ONPANIC) β what DDB does when the kernel panics. if it's greater than zero, DDB gets entered on panic. a value of1means the system enters DDB on panic, a value of0means the kernel tries to print a stack trace first and then reboots, and-1means neither a stack trace gets printed nor DDB gets entered. pick your fighter πddb.panicstackframesβ how many stack frames get shown on a panic. lowkey a lifesaver, because it stops the interesting frames from scrolling off into the void on a glass tty. default is65535(like, all the frames), and a useful value is around10.ddb.radix(DDBCTL_RADIX) β the input and output radix. numbers, but make it base-whatever.ddb.tabstops(DDBCTL_TABSTOPS) β tab width. spacing is a love language πddb.tee_msgbufβ if it's not zero, DDB outputs to the kernel message buffer too. double-dipping, respectfully.
some of these MIB nodes are also available as variables from inside the debugger itself. check ddb(4) for the whole lore π«Ά
πΈ The security.* subtree (CTL_SECURITY) πΈ
the security level is where all the security-ish system settings live. here are the second level names, no cap:
security.curtainβ typeinteger, changeable yessecurity.modelsβ typenode, changeable not applicablesecurity.paxβ typenode, changeable not applicable
the settings themselves are all detailed below, bestie:
security.curtain if it's non-zero, it filters return objects based on the user ID asking about them, so users can't access objects they don't own. iconic gatekeeping, honestly.
right now it affects ps(1), netstat(1) (for PF_INET, PF_INET6, and PF_UNIX PCBs), and w(1).
security.models NetBSD supports pluggable security models. every security model in use β whether it's loaded as a module or built with the system β is required to add an entry to this node with at least one element, βnameβ, which indicates the name of the security model.
besides the name, any settings and other info private to the security model will be available under this node. see secmodel(9) for more π
security.pax the settings for PaX β the exploit mitigation features. for more on any of the PaX features, please see paxctl(8) and security(7). the available third and fourth level names are:
security.pax.aslr.enabledβinteger, changeable yessecurity.pax.aslr.globalβinteger, changeable yessecurity.pax.mprotect.enabledβinteger, changeable yessecurity.pax.mprotect.globalβinteger, changeable yessecurity.pax.mprotect.ptraceβinteger, changeable yessecurity.pax.segvguard.enabledβinteger, changeable yessecurity.pax.segvguard.expiry_timeoutβinteger, changeable yessecurity.pax.segvguard.globalβinteger, changeable yessecurity.pax.segvguard.max_crashesβinteger, changeable yessecurity.pax.segvguard.suspend_timeoutβinteger, changeable yes
security.pax.aslr.enabled enables PaX ASLR (Address Space Layout Randomization).
this knob must be non-zero for PaX ASLR to actually be enabled β even if a program is set to explicitly enable it. so like, the vibes have to match.
security.pax.aslr.global sets the default global policy for programs that don't have an explicit enable/disable flag.
when it's non-zero, all programs get PaX ASLR, except the ones exempted with paxctl(8). otherwise, no program gets PaX ASLR, except the ones specifically marked as such with paxctl(8). flipped logic, but we move.
security.pax.mprotect.enabled enables PaX MPROTECT restrictions.
these are mprotect(2) restrictions that enforce a W^X policy way better. this knob must be non-zero for PaX MPROTECT to be enabled, even if a program is set to explicitly enable it. same deal as above β¨
security.pax.mprotect.global sets the default global policy for programs without an explicit enable/disable flag.
when it's non-zero, all programs get the PaX MPROTECT restrictions, except those exempted with paxctl(8). otherwise, all programs don't get the PaX MPROTECT restrictions, except those specifically marked as such with paxctl(8).
security.pax.mprotect.ptrace this lets ptrace(2) override PaX MPROTECT permissions. it can be these values:
0β does not let override any permissions.1β disables PaX MPROTECT from processes that start executing while traced (this is the default).2β bypasses PaX MPROTECT for all processes being traced.
security.pax.segvguard.enabled enables PaX Segvguard.
PaX Segvguard can detect and prevent certain exploitation attempts β like when an attacker tries to brute-force function return addresses of respawning daemons. very much main character security energy π
Note: the NetBSD interface and implementation of the Segvguard is still experimental, and may change in future releases. so don't get too attached, bestie π
security.pax.segvguard.expiry_timeout if the max number wasn't reached within this timeout (in seconds), the entry expires. time limit, babes.
security.pax.segvguard.global sets the default global policy for programs without an explicit enable/disable flag.
when it's non-zero, all programs get the PaX Segvguard, except those exempted with paxctl(8). otherwise, no program gets the PaX Segvguard restrictions, except those specifically marked as such with paxctl(8).
security.pax.segvguard.max_crashes the maximum number of segfaults a program can receive before suspension. like a strike system but for segfaults π
security.pax.segvguard.suspend_timeout the number of seconds a user gets suspended from running a faulting program once the limit was exceeded. sit in the corner and think about what you did.
π The vendor.* subtree (CTL_VENDOR) π
the vendor toplevel name is reserved for vendors who want their own private MIB tree. the intended use is storing values under βvendor.<yourname>.*β. your tree, your rules, your name on it π
π SEE ALSO π
π°οΈ HISTORY π°οΈ
the sysctl variables first appeared in 4.4BSD. an absolute legend, fr fr β we been knew π
and that's a wrap on the whole page, bestie π«Ά this one's the Debian flavour, dated March 7, 2024 β go off, sysctl, you icon β¨
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms