1.
/Etc/rc. d
Services started during system initialization, usually third-party application services, such as sshd,
Use start, stop, and restart.
2.
/Etc/rc. conf
Permit the service to be started in/etc/rc. d
3.
Whether/etc/rc. conf is permitted or not, if you want to force start a service using/etc/rc. d, run the following command:
#/Etc/rc. CONF/xxx onerestart
Add "one" before the startup command"
4.
You can use the rcvar command to check whether the service started with the/etc/rc. conf script is enabled.
#/Etc/rc. d/sshd rcvar
# Sshd
$ Sshd_enable = Yes
5.
Reload service, force reload some services, not all services can.
#/Etc/rc. d/sshd reload
6.
Network Interface "alias", add in/etc/rc. conf
For example:
The alias record of an fxp0 is similar:
Ifconfig_fxp0_alias0 = "Inet XXX. XXX netmask XXX. XXX"
Remember that the alias records must start from alias0 and increase sequentially (for example, _ alias1 and _ alias2 ). The provisioner stops at the first missing number.
For example, assume that fxp0 is used to connect to two networks: 10.1.1.0, The subnet mask is 255.255.255.0, and 202.0.75.16. The subnet mask is 255.255.255.255.255.240. We hope that the addresses from 10.1.1.1 to 10.1.1.5 and from 202.0.75.17 to 202.0.75.20 can access each other. As mentioned above, only the first addresses in the two network segments (10.0.1.1 and 202.0.75.17 in this example) should use the actual subnet mask; the remaining addresses (10.1.1.2 to 10.1.1.5 and 202.0.75.18 to 202.0.75.20) you must use 255.255.255.255.255 as the subnet mask.
The/etc/rc. conf configuration is as follows:
Ifconfig_fxp0 = "Inet 10.1.1.1 netmask 255.255.255.0"
Ifconfig_fxp0_alias0 = "Inet 10.1.1.2 netmask 255.255.255.255"
Ifconfig_fxp0_alias1 = "Inet 10.1.1.3 netmask 255.255.255.255"
Ifconfig_fxp0_alias2 = "Inet 10.1.1.4 netmask 255.255.255.255"
Ifconfig_fxp0_alias3 = "Inet 10.1.1.5 netmask 255.255.255.255"
Ifconfig_fxp0_alias4 = "Inet 202.0.75.17 netmask implements 255.255.255.240"
Ifconfig_fxp0_alias5 = "Inet 202.0.75.18 netmask 255.255.255.255"
Ifconfig_fxp0_alias6 = "Inet 202.0.75.19 netmask 255.255.255.255"
Ifconfig_fxp0_alias7 = "Inet 202.0.75.20 netmask 255.255.255.255"
7.
/Etc Layout
There are many directories in the configuration information, including:
/Etc general system configuration information. The data here is related to a specific system.
The default version of the/etc/defaults system configuration file.
/Etc/mail additional Sendmail (8) configuration information, other MTA configuration files.
/Etc/PPP is used for user-level and kernel-level PPP program configuration.
The default location of/etc/namedb named (8) data. Generally, named. conf and regional files are stored here.
/Usr/local/etc is the application configuration file installed. See the subdirectories of each application.
The/usr/local/etc/rc. d script is started/stopped by the installer.
/Var/database files automatically generated by a specific database system, such as the package database and the location database.
8. Host Name
1)/etc/resolv. conf
/Etc/resolv. conf indicates how FreeBSD accesses the Domain Name System (DNS ).
The most common record in resolv. conf is:
Nameserver: the IP address of the name server to be queried in sequence. A maximum of three IP addresses can be queried.
Search for the list of machine names. This is usually determined by the domain of the Local Machine name.
Domain Local Domain Name.
A typical resolv. conf file:
Search example.com
Nameserver 147.11.1.11
Nameserver 147.11.100.30
Note: Only one search and domain option can be used.
If you are using DHCP, dhclient (8) often uses the information received from the DHCP server to override resolv. conf.
2)/etc/hosts
/Etc/hosts is a simple text database used in the early days of the Internet. It works with DNS and NIS to provide a ing between names and IP addresses. /Etc/hosts can also provide a local record of the Internet name to relieve the burden of external queries.
9. Log File Configuration
Syslog. conf is the configuration file of syslogd (8) program. It specifies which syslog information type is stored in a specific log file.