-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrc.conf.5.orig
4831 lines (4831 loc) · 102 KB
/
rc.conf.5.orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.\" Copyright (c) 1995
.\" Jordan K. Hubbard
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd December 2, 2022
.Dt RC.CONF 5
.Os
.Sh NAME
.Nm rc.conf
.Nd system configuration information
.Sh DESCRIPTION
The file
.Nm
contains descriptive information about the local host name, configuration
details for any potential network interfaces and which services should be
started up at system initial boot time.
In new installations, the
.Nm
file is generally initialized by the system installation utility.
.Pp
The purpose of
.Nm
is not to run commands or perform system startup actions
directly.
Instead, it is included by the
various generic startup scripts in
.Pa /etc
which conditionalize their
internal actions according to the settings found there.
.Pp
The
.Pa /etc/rc.conf
file is included from the file
.Pa /etc/defaults/rc.conf ,
which specifies the default settings for all the available options.
Options need only be specified in
.Pa /etc/rc.conf
when the system administrator wishes to override these defaults.
The file
.Pa /etc/defaults/vendor.conf
allows vendors to override
.Fx
defaults.
The file
.Pa /etc/rc.conf.local
is used to override settings in
.Pa /etc/rc.conf
for historical reasons.
.Pp
The sysrc(8) command provides a scripting interface to modify system
config files.
.Pp
In addition to
.Pa /etc/rc.conf.local
you can also place smaller configuration files for each
.Xr rc 8
script in the
.Pa /etc/rc.conf.d
directory or
.Ao Ar dir Ac Ns Pa /rc.conf.d
directories specified in
.Va local_startup ,
which will be included by the
.Va load_rc_config
function.
For jail configurations you could use the file
.Pa /etc/rc.conf.d/jail
to store jail-specific configuration options.
If
.Va local_startup
contains
.Pa /usr/local/etc/rc.d
and
.Pa /opt/conf ,
.Pa /usr/local/etc/rc.conf.d/jail
and
.Pa /opt/conf/rc.conf.d/jail
will be loaded.
If
.Ao Ar dir Ac Ns Pa /rc.conf.d/ Ns Ao Ar name Ac
is a directory,
all of files in the directory will be loaded.
Also see the
.Va rc_conf_files
variable below.
.Pp
Options are set with
.Dq Ar name Ns Li = Ns Ar value
assignments that use
.Xr sh 1
syntax.
The following list provides a name and short description for each
variable that can be set in the
.Nm
file:
.Bl -tag -width indent-two
.It Va rc_debug
.Pq Vt bool
If set to
.Dq Li YES ,
enable output of debug messages from rc scripts.
This variable can be helpful in diagnosing mistakes when
editing or integrating new scripts.
Beware that this produces copious output to the terminal and
.Xr syslog 3 .
.It Va rc_info
.Pq Vt bool
If set to
.Dq Li NO ,
disable informational messages from the rc scripts.
Informational messages are displayed when
a condition that is not serious enough to warrant a warning or
an error occurs.
.It Va rc_startmsgs
.Pq Vt bool
If set to
.Dq Li YES ,
show
.Dq Starting foo:
when faststart is used (e.g., at boot time).
.It Va early_late_divider
.Pq Vt str
The name of the script that should be used as the
delimiter between the
.Dq early
and
.Dq late
stages of the boot process.
The early stage should contain all the services needed to
get the disks (local or remote) mounted so that the late
stage can include scripts contained in the directories
listed in the
.Va local_startup
variable (see below).
Thus, the two likely candidates for this value are
.Pa mountcritlocal
for the typical system, and
.Pa mountcritremote
if the system needs remote file
systems mounted to get access to the
.Va local_startup
directories; for example when
.Pa /usr/local
is NFS mounted.
For
.Pa rc.conf
within a
.Xr jail 8
.Pa NETWORKING
is likely to be an appropriate value.
Extreme care should be taken when changing this value,
and before changing it one should ensure that there are
adequate provisions to recover from a failed boot
(such as physical contact with the machine,
or reliable remote console access).
.It Va always_force_depends
.Pq Vt bool
Various
.Pa rc.d
scripts use the force_depend function to check whether required
services are already running, and to start them if necessary.
By default during boot time this check is bypassed if the
required service is enabled in
.Pa /etc/rc.conf[.local] .
Setting this option will bypass that check at boot time and
always test whether or not the service is actually running.
Enabling this option is likely to increase your boot time if
services are enabled that utilize the force_depend check.
.It Ao Ar name Ac Ns Va _chroot
.Pq Vt str
.Xr chroot 8
to this directory before running the service.
.It Ao Ar name Ac Ns Va _fib
.Pq Vt int
The
.Xr setfib 1
value to run the service under.
.It Ao Ar name Ac Ns Va _group
.Pq Vt str
Run the chrooted service under this system group.
Unlike the
.Ao Ar name Ac Ns Va _user
setting, this setting has no effect if the service is not chrooted.
.It Ao Ar name Ac Ns Va _limits
.Pq Vt str
Resource limits to apply to the service using
.Xr limits 1 .
By default, resource limits are based on the login class defined in
.Ao Ar name Ac Ns Va _login_class .
.It Ao Ar name Ac Ns Va _login_class
.Pq Vt str
Login class to be used with
.Ao Ar name Ac Ns Va _limits .
Defaults to
.Dq Li daemon .
.It Ao Ar name Ac Ns Va _nice
.Pq Vt int
The
.Xr nice 1
value to run the service under.
.It Ao Ar name Ac Ns Va _oomprotect
.Pq Vt str
Use
.Xr protect 1
to prevent the service from being killed when swap space
is exhausted.
Use
.Dq Li YES
to protect only the service itself, and
.Dq Li ALL
to protect the service and all its child processes.
.Pp
Please note that rc scripts which redefine
.Dl ${argument}_cmd
.Pq see Xr rc.subr 8
such as PostgreSQL will not inherit the OOM killer protection.
.Pp
This variable has no effect on services running within a
.Xr jail 8 .
.It Ao Ar name Ac Ns Va _user
.Pq Vt str
Run the service under this user account.
.It Va apm_enable
.Pq Vt bool
If set to
.Dq Li YES ,
enable support for Automatic Power Management with
the
.Xr apm 8
command.
.It Va apmd_enable
.Pq Vt bool
Run
.Xr apmd 8
to handle APM event from userland.
This also enables support for APM.
.It Va apmd_flags
.Pq Vt str
If
.Va apmd_enable
is set to
.Dq Li YES ,
these are the flags to pass to the
.Xr apmd 8
daemon.
.It Va devd_enable
.Pq Vt bool
Run
.Xr devd 8
to handle device added, removed or unknown events from the kernel.
.It Va ddb_enable
.Pq Vt bool
Run
.Xr ddb 8
to install
.Xr ddb 4
scripts at boot time.
.It Va ddb_config
.Pq Vt str
Configuration file for
.Xr ddb 8 .
Default
.Pa /etc/ddb.conf .
.It Va devmatch_enable
.Pq Vt bool
If set to
.Dq Li NO ,
disable auto-loading of kernel modules with
.Xr devmatch 8 .
.It Va devmatch_blocklist
.Pq Vt str
A whitespace-separated list of kernel modules to be ignored by
.Xr devmatch 8 .
.It Va devmatch_blacklist
.Pq Vt str
This variable is deprecated.
Use
.Va devmatch_blocklist
instead.
A whitespace-separated list of kernel modules to be ignored by
.Xr devmatch 8 .
.It Va kld_list
.Pq Vt str
A whitespace-separated list of kernel modules to load right after
the local disks are mounted, without any
.Pa .ko
extension or path.
Loading modules at this point in the boot process is
much faster than doing it via
.Pa /boot/loader.conf
for those modules not necessary for mounting local disks.
.It Va kldxref_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
Set to
.Dq Li YES
to automatically rebuild
.Pa linker.hints
files with
.Xr kldxref 8
at boot time.
.It Va kldxref_clobber
.Pq Vt bool
Set to
.Dq Li NO
by default.
If
.Va kldxref_enable
is true,
setting to
.Dq Li YES
will overwrite existing
.Pa linker.hints
files at boot time.
Otherwise,
only missing
.Pa linker.hints
files are generated.
.It Va kldxref_module_path
.Pq Vt str
Empty by default.
A semi-colon
.Pq Ql \&;
delimited list of paths containing
.Xr kld 4
modules.
If empty,
the contents of the
.Va kern.module_path
.Xr sysctl 8
are used.
.It Va powerd_enable
.Pq Vt bool
If set to
.Dq Li YES ,
enable the system power control facility with the
.Xr powerd 8
daemon.
.It Va powerd_flags
.Pq Vt str
If
.Va powerd_enable
is set to
.Dq Li YES ,
these are the flags to pass to the
.Xr powerd 8
daemon.
.It Va tmpmfs
Controls the creation of a
.Pa /tmp
memory file system.
Always happens if set to
.Dq Li YES
and never happens if set to
.Dq Li NO .
If set to anything else, a memory file system is created if
.Pa /tmp
is not writable.
.It Va tmpsize
Controls the size of a created
.Pa /tmp
memory file system.
.It Va tmpmfs_flags
Extra options passed to the
.Xr mdmfs 8
utility when the memory file system for
.Pa /tmp
is created.
The default is
.Dq Li "-S" ,
which inhibits the use of softupdates on
.Pa /tmp
so that file system space is freed without delay
after file truncation or deletion.
See
.Xr mdmfs 8
for other options you can use in
.Va tmpmfs_flags .
.It Va varmfs
Controls the creation of a
.Pa /var
memory file system.
Always happens if set to
.Dq Li YES
and never happens if set to
.Dq Li NO .
If set to anything else, a memory file system is created if
.Pa /var
is not writable.
.It Va varsize
Controls the size of a created
.Pa /var
memory file system.
.It Va varmfs_flags
Extra options passed to the
.Xr mdmfs 8
utility when the memory file system for
.Pa /var
is created.
The default is
.Dq Li "-S" ,
which inhibits the use of softupdates on
.Pa /var
so that file system space is freed without delay
after file truncation or deletion.
See
.Xr mdmfs 8
for other options you can use in
.Va varmfs_flags .
.It Va populate_var
Controls the automatic population of the
.Pa /var
file system.
Always happens if set to
.Dq Li YES
and never happens if set to
.Dq Li NO .
If set to anything else, a memory file system is created if
.Pa /var
is not writable.
Note that this process requires access to certain commands in
.Pa /usr
before
.Pa /usr
is mounted on normal systems.
.It Va cleanvar_enable
.Pq Vt bool
Clean the
.Pa /var
directory.
.It Va var_run_enable
.Pq Vt bool
Set to "YES" to enable saving of the
.Pa /var/run
directory strcucture into an mtree file at shutdown and the reload of the
.Pa /var/run
directory structure at boot.
.It Va var_run_autosave
.Pq Vt bool
In some cases it may be undesirable to save
.Pa /var/run
at shutdown.
When set to "NO"
.Pa /var/run
is loaded at reboot but not saved at shutdown. Typically in this scenario
a
.Pa service
.Pa var_run
.Pa save
would be performed to save a copy of the
.Pa /var/run
directory structure once, to be reload during all subsequent reboots.
.It Va var_run_mtree
.Pq Vt str
Where to save the
.Pa /var/run
mtree. The default location is
.Pa /var/db/mtree/BSD.var-run.mtree .
.It Va local_startup
.Pq Vt str
List of directories to search for startup script files.
.It Va script_name_sep
.Pq Vt str
The field separator to use for breaking down the list of startup script files
into individual filenames.
The default is a space.
It is not necessary to change this unless there are startup scripts with names
containing spaces.
.It Va hostapd_enable
.Pq Vt bool
Set to
.Dq Li YES
to start
.Xr hostapd 8
at system boot time.
.It Va hostname
.Pq Vt str
The fully qualified domain name (FQDN) of this host on the network.
This should almost certainly be set to something meaningful, even if
there is no network connection.
If
.Xr dhclient 8
is used to set the hostname via DHCP,
this variable should be set to an empty string.
Within a
.Xr jail 8
the hostname is generally already set and this variable may be absent.
If this value remains unset when the system is done booting
your console login will display the default hostname of
.Dq Amnesiac .
.It Va nisdomainname
.Pq Vt str
The NIS domain name of this host, or
.Dq Li NO
if NIS is not used.
.It Va dhclient_program
.Pq Vt str
Path to the DHCP client program
.Pa ( /sbin/dhclient ,
the
.Ox
DHCP client,
is the default).
.It Va dhclient_flags
.Pq Vt str
Additional flags to pass to the DHCP client program.
For the
.Ox
DHCP client, see the
.Xr dhclient 8
manpage for a description of the command line options available.
.It Va dhclient_flags_ Ns Aq Ar iface
Additional flags to pass to the DHCP client program running on
.Ar iface
only.
When specified, this variable overrides
.Va dhclient_flags .
.It Va background_dhclient
.Pq Vt bool
Set to
.Dq Li YES
to start the DHCP client in background.
This can cause trouble with applications depending on
a working network, but it will provide a faster startup
in many cases.
.It Va background_dhclient_ Ns Aq Ar iface
When specified, this variable overrides the
.Va background_dhclient
variable for interface
.Ar iface
only.
.It Va synchronous_dhclient
.Pq Vt bool
Set to
.Dq Li YES
to start
.Xr dhclient 8
synchronously at startup.
This behavior can be overridden on a per-interface basis by replacing
the
.Dq Li DHCP
keyword in the
.Va ifconfig_ Ns Aq Ar interface
variable with
.Dq Li SYNCDHCP
or
.Dq Li NOSYNCDHCP .
.It Va defaultroute_delay
.Pq Vt int
When set to a positive value, wait up to this long after configuring
DHCP interfaces at startup to give the interfaces time to receive a lease.
.It Va firewall_enable
.Pq Vt bool
Set to
.Dq Li YES
to load firewall rules at startup.
If the kernel was not built with
.Cd "options IPFIREWALL" ,
the
.Pa ipfw.ko
kernel module will be loaded.
See also
.Va ipfilter_enable .
.It Va firewall_script
.Pq Vt str
This variable specifies the full path to the firewall script to run.
The default is
.Pa /etc/rc.firewall .
.It Va firewall_type
.Pq Vt str
Names the firewall type from the selection in
.Pa /etc/rc.firewall ,
or the file which contains the local firewall ruleset.
Valid selections from
.Pa /etc/rc.firewall
are:
.Pp
.Bl -tag -width ".Li simple" -compact
.It Li open
unrestricted IP access
.It Li closed
all IP services disabled, except via
.Dq Li lo0
.It Li client
basic protection for a workstation
.It Li simple
basic protection for a LAN.
.El
.Pp
If a filename is specified, the full path
must be given.
.It Va firewall_quiet
.Pq Vt bool
Set to
.Dq Li YES
to disable the display of firewall rules on the console during boot.
.It Va firewall_logging
.Pq Vt bool
Set to
.Dq Li YES
to enable firewall event logging.
This is equivalent to the
.Dv IPFIREWALL_VERBOSE
kernel option.
.It Va firewall_logif
.Pq Vt bool
Set to
.Dq Li YES
to create pseudo interface
.Li ipfw0
for logging.
For more details, see
.Xr ipfw 8
manual page.
.It Va firewall_flags
.Pq Vt str
Flags passed to
.Xr ipfw 8
if
.Va firewall_type
specifies a filename.
.It Va firewall_coscripts
.Pq Vt str
List of executables and/or rc scripts to run after firewall starts/stops.
Default is empty.
.\" ----- firewall_nat_enable setting --------------------------------
.It Va firewall_nat_enable
.Pq Vt bool
The
.Xr ipfw 8
equivalent of
.Va natd_enable .
Setting this to
.Dq Li YES
will automatically load the
.Xr ipfw 8
NAT kernel module if
.Va firewall_enable
is also set to
.Dq Li YES .
.It Va firewall_nat_interface
.Pq Vt str
The
.Xr ipfw 8
equivalent of
.Va natd_interface .
This is the name of the public interface or IP address on which
kernel NAT should run.
.It Va firewall_nat_flags
.Pq Vt str
Additional configuration parameters for kernel NAT should be placed here.
.It Va firewall_nat64_enable
.Pq Vt bool
Setting this to
.Dq Li YES
will automatically load the
.Xr ipfw 8
NAT64 kernel module if
.Va firewall_enable
is also set to
.Dq Li YES .
.It Va firewall_nptv6_enable
.Pq Vt bool
Setting this to
.Dq Li YES
will automatically load the
.Xr ipfw 8
NPTv6 kernel module if
.Va firewall_enable
is also set to
.Dq Li YES .
.It Va firewall_pmod_enable
.Pq Vt bool
Setting this to
.Dq Li YES
will automatically load the
.Xr ipfw 8
pmod kernel module if
.Va firewall_enable
is also set to
.Dq Li YES .
.It Va dummynet_enable
.Pq Vt bool
Setting this to
.Dq Li YES
will automatically load the
.Xr dummynet 4
module if
.Va firewall_enable
is also set to
.Dq Li YES .
.\" -------------------------------------------------------------------
.It Va ipfw_netflow_enable
.Pq Vt bool
Setting this to
.Dq Li YES
will enable netflow logging via
.Xr ng_netflow 4
.Pp
By default a ipfw rule is inserted and all packets are duplicated with
the ngtee command and netflow packets are sent to 127.0.0.1 on the netflow
port using protocol version 5.
.It Va ipfw_netflow_hook
.Pq Vt int
netflow hook name, must be numerical
(default
.Pa 9995 ) .
.It Va ipfw_netflow_rule
.Pq Vt int
ipfw rule number
(default
.Pa 1000 ) .
.It Va ipfw_netflow_ip
.Pq Vt str
Destination server ip for receiving netflow data
(default
.Pa 127.0.0.1 ) .
.It Va ipfw_netflow_port
.Pq Vt int
Destination server port for receiving netflow data
(default
.Pa 9995 ) .
.It Va ipfw_netflow_version
.Pq Vt int
Do not set for using version 5 of the netflow protocol, set it to 9 for using version 9.
.It Va ipfw_netflow_fib
.Pq Vt int
Only match packet in FIB
.Pa ipfw_netflow_fib
(default is undefined meaning all FIBs).
.It Va natd_program
.Pq Vt str
Path to
.Xr natd 8 .
.It Va natd_enable
.Pq Vt bool
Set to
.Dq Li YES
to enable
.Xr natd 8 .
.Va firewall_enable
must also be set to
.Dq Li YES ,
and
.Xr divert 4
sockets must be enabled in the kernel.
If the kernel was not built with
.Cd "options IPDIVERT" ,
the
.Pa ipdivert.ko
kernel module will be loaded.
.It Va natd_interface
.Pq Vt str
This is the name of the public interface on which
.Xr natd 8
should run.
The interface may be given as an interface name or as an IP address.
.It Va natd_flags
.Pq Vt str
Additional
.Xr natd 8
flags should be placed here.
The
.Fl n
or
.Fl a
flag is automatically added with the above
.Va natd_interface
as an argument.
.\" ----- ipfilter_enable setting --------------------------------
.It Va ipfilter_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
Setting this to
.Dq Li YES
enables
.Xr ipf 8
packet filtering.
.Pp
Typical usage will require putting
.Bd -literal
ipfilter_enable="YES"
ipnat_enable="YES"
ipmon_enable="YES"
ipfs_enable="YES"
.Ed
.Pp
into
.Pa /etc/rc.conf
and editing
.Pa /etc/ipf.rules
and
.Pa /etc/ipnat.rules
appropriately.
.Pp
Note that
.Va ipfilter_enable
and
.Va ipnat_enable
can be enabled independently.
.Va ipmon_enable
and
.Va ipfs_enable
both require at least one of
.Va ipfilter_enable
and
.Va ipnat_enable
to be enabled.
.Pp
Having
.Bd -literal
options IPFILTER
options IPFILTER_LOG
options IPFILTER_DEFAULT_BLOCK
.Ed
.Pp
in the kernel configuration file is a good idea, too.
.\" ----- ipfilter_program setting ------------------------------
.It Va ipfilter_program
.Pq Vt str
Path to
.Xr ipf 8
(default
.Pa /sbin/ipf ) .
.\" ----- ipfilter_rules setting --------------------------------
.It Va ipfilter_rules
.Pq Vt str
Set to
.Pa /etc/ipf.rules
by default.
This variable contains the name of the filter rule definition file.
The file is expected to be readable for the
.Xr ipf 8
command to execute.
.\" ----- ipv6_ipfilter_rules setting ---------------------------
.It Va ipv6_ipfilter_rules
.Pq Vt str
Set to
.Pa /etc/ipf6.rules
by default.
This variable contains the IPv6 filter rule definition file.
The file is expected to be readable for the
.Xr ipf 8
command to execute.
.\" ----- ipfilter_flags setting --------------------------------
.It Va ipfilter_flags
.Pq Vt str
Empty by default.
This variable contains flags passed to the
.Xr ipf 8
program.
.\" ----- ipnat_enable setting ----------------------------------
.It Va ipnat_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
Set it to
.Dq Li YES
to enable
.Xr ipnat 8
network address translation.
See
.Va ipfilter_enable
for a detailed discussion.
.\" ----- ipnat_program setting ---------------------------------
.It Va ipnat_program
.Pq Vt str
Path to
.Xr ipnat 8
(default
.Pa /sbin/ipnat ) .
.\" ----- ipnat_rules setting -----------------------------------
.It Va ipnat_rules
.Pq Vt str
Set to
.Pa /etc/ipnat.rules
by default.
This variable contains the name of the file
holding the network address translation definition.
This file is expected to be readable for the
.Xr ipnat 8
command to execute.
.\" ----- ipnat_flags setting -----------------------------------
.It Va ipnat_flags
.Pq Vt str
Empty by default.
This variable contains flags passed to the
.Xr ipnat 8
program.
.\" ----- ipmon_enable setting ----------------------------------
.It Va ipmon_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
Set it to
.Dq Li YES
to enable
.Xr ipmon 8
monitoring (logging
.Xr ipf 8
and
.Xr ipnat 8
events).
Setting this variable needs setting
.Va ipfilter_enable
or
.Va ipnat_enable
too.
See
.Va ipfilter_enable
for a detailed discussion.
.\" ----- ipmon_program setting ---------------------------------
.It Va ipmon_program
.Pq Vt str
Path to
.Xr ipmon 8
(default
.Pa /sbin/ipmon ) .
.\" ----- ipmon_flags setting -----------------------------------
.It Va ipmon_flags
.Pq Vt str
Set to
.Dq Li -Ds
by default.
This variable contains flags passed to the
.Xr ipmon 8
program.
Another typical example would be
.Dq Fl D Pa /var/log/ipflog
to have
.Xr ipmon 8
log directly to a file bypassing
.Xr syslogd 8 .
Make sure to adjust
.Pa /etc/newsyslog.conf
in such case like this:
.Bd -literal
/var/log/ipflog 640 10 100 * Z /var/run/ipmon.pid
.Ed
.\" ----- ipfs_enable setting -----------------------------------
.It Va ipfs_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
Set it to
.Dq Li YES
to enable
.Xr ipfs 8
saving the filter and NAT state tables during shutdown
and reloading them during startup again.
Setting this variable needs setting
.Va ipfilter_enable
or
.Va ipnat_enable
to
.Dq Li YES
too.
See
.Va ipfilter_enable
for a detailed discussion.
Note that if
.Va kern_securelevel
is set to 3,
.Va ipfs_enable
cannot be used
because the raised securelevel will prevent
.Xr ipfs 8
from saving the state tables at shutdown time.
.\" ----- ipfs_program setting ----------------------------------
.It Va ipfs_program
.Pq Vt str