2.9. 安装后的配置
安装成功后, 就可以进行进一步的配置了。 引导新安装的 FreeBSD 系统之后, 使用 sysinstall (/stand/sysinstall 如果您使用的是 FreeBSD 5.2 之前的版本), 并选择 Configure。
2.9.1. 配置网卡
如果您之前配置用 PPP 通过 FTP 安装,那么这个画面将不会出现;正像所说的那样,您可以稍后再做配置。
如果想更多的了解网卡或将FreeBSD配置为网关或路由器,请参考
Advanced Networking
的相关文章。 User Confirmation Requested
Would you like to configure any Ethernet or SLIP/PPP network devices?
[ Yes ] No
如果要配置网卡,请选择 [ Yes ] 然后按 Enter。 否则请选择 [ No ] 继续。
Figure 2-31. 选择网卡设备

用方向键选择您要配置的网卡接口,然后按Enter。 User Confirmation Requested
Do you want to try IPv6 configuration of the interface?
Yes [ No ]
目录私人区域网络IP协议IPv4已经足够,所以选择 [ No ] 然后按 Enter。
如果想试试新的IP通信协议 IPv6 ,使用 RA 服务,请选择 [ Yes ] 然后按 Enter。 寻找 RA 服务器将会花费几秒的时间。 User Confirmation Requested
Do you want to try DHCP configuration of the interface?
Yes [ No ]
如果您不需要 DHCP (Dynamic Host Configuration Protocol 动态主机配置协议) ,选择 [ No ] 然后按Enter。
选择 [ Yes ] 会执行dhclient, 如果成功,它会自动将网络配置信息填上。更多的信息请参考
第 23.5 节
。
下面的网络配置显示了怎样把以太网设备配置成区域网络网关的角色。
Figure 2-32. 配置 ed0接口

使用Tab 键可以在各个栏目之间进行切换,请输入适当 的信息:
Host(机器名称)
完整的机器名称,例如本例中的 k6-2.example.com 。
Domain(域名)
您机器所在的域名称,如本例的 example.com
IPv4 Gateway(IPv4网关)
输入将数据包传送到远端网络的机器IP地址。只有当机器是网络上的一个接点时才要输入。如果这台机器要作为您局域网的网关, 请将此处设为空白。IPv4网关,也被称作默认网关或默认路由器。
域名服务器
本地网络中的域名服务器的IP地址。本例中假设机器所在的网络中没有域名服务器,所以填入的是ISP提供的域名服务器地址 (208.163.10.2。)
IPv4 地址
本机所使用的IP地址。本例为 192.168.0.1。
子网掩码
本范例中的IP地址属于一个C类地址 (192.168.0.0 - 192.168.255.255)。默认的子网掩码为 (255.255.255.0)。
ifconfig 额外参数设定
任何ifconfig命令跟网卡接口有关的参数。 本范例中没有。
使用 Tab 键选择 [ OK ]然后按 Enter键。 User Confirmation Requested
Would you like to Bring Up the ed0 interface right now?
[ Yes ] No
选择 [ Yes ] 然后按 Enter 将会将机器的网卡转为启用状态。机器下次启动 的时候即可使用。
2.9.2. 配置网关 User Confirmation Requested
Do you want this machine to function as a network gateway?
[ Yes ] No
如果这台机器要作为本地网络和其它机器之间传送数据包的网关,请选择 [ Yes ] 然后按 Enter。如果这台机器只是网络上的一个节点主,请选择 [ No ] 并按Enter 继续。
2.9.3. 配置网络服务 User Confirmation Requested
Do you want to configure inetd and the network services that it provides?
Yes [ No ]
如果选择 [ No ] ,许多网络服务,如 telnetd 将不会启用。这表示远端用户将无法 telnet 进入这台机器。本机器上的用户还是可以 telnet到远端机器的。
这些服务可以在安装完成后修改/etc/inetd.conf 配置文件来启用它们。请参阅
第 23.2.1 节
以获得更多的信息。
如果您想现在就配置这些网络服务,请选择[ Yes ] ,然后会看到下面的信息: User Confirmation Requested
The Internet Super Server (inetd) allows a number of simple Internet
services to be enabled, including finger, ftp and telnetd. Enabling
these services may increase risk of security problems by increasing
the exposure of your system.
With this in mind, do you wish to enable inetd?
[ Yes ] No
选择 [ Yes ] 继续。 User Confirmation Requested
inetd(8) relies on its configuration file, /etc/inetd.conf, to determine
which of its Internet services will be available. The default FreeBSD
inetd.conf(5) leaves all services disabled by default, so they must be
specifically enabled in the configuration file before they will
function, even once inetd(8) is enabled. Note that services for
IPv6 must be separately enabled from IPv4 services.
Select [Yes] now to invoke an editor on /etc/inetd.conf, or [No] to
use the current settings.
[ Yes ] No
选择 [ Yes ] 将允许您添加网络服务(将相应网络服务每行开头的#除掉即呆。
Figure 2-33. 编辑 inetd.conf配置文件

在加入您想启用的服务后,按下 Esc键会出现一个对话框可以让您离开以及保存修改。
2.9.4. 匿名 FTP User Confirmation Requested
Do you want to have anonymous FTP access to this machine?
Yes [ No ]
2.9.4.1. 不允许匿名 FTP访问
选择默认的 [ No ] 并按下 Enter 键将仍然可以让在这台机器上有账号的用户访问 FTP。
2.9.4.2. 允许匿名 FTP访问
如果您选择允许匿名 FTP 存取,那么网络中任何人都可以使用FTP来访问您的机器。在启用匿名访问之前应该考虑网络的安全问题。如果要知道更多有关网络安全的信息,请参阅
第 14 章
。
要启用FTP匿名访问,用方向键选择 [ Yes ] 然后按 Enter键。您会看到下面(或类似)的画面:
Figure 2-34. 默认的匿名 FTP 配置

按 F1 键可以查看在线帮助文档:This screen allows you to configure the anonymous FTP user.
The following configuration values are editable:
UID: The user ID you wish to assign to the anonymous FTP user.
All files uploaded will be owned by this ID.
Group: Which group you wish the anonymous FTP user to be in.
Comment: String describing this user in /etc/passwd
FTP Root Directory:
Where files available for anonymous FTP will be kept.
Upload subdirectory:
Where files uploaded by anonymous FTP users will go.
默认的FTP根目录将放在 /var目录下。如果您的/var目录空间不足以应付您的FTP需求,您可以将FTP的根目录改为 /usr 目录下的 /usr/ftp 目录。
当您对一切配置都满意后,请按 Enter 键继续。 User Confirmation Requested
Create a welcome message file for anonymous FTP users?
[ Yes ] No
如果您选择 [ Yes ] 并按下 Enter键,系统会自动打开文本编辑器让您编辑FTP的欢迎信息。
Figure 2-35. 编辑FTP欢迎信息

此文本编辑器叫做 ee。按照指示修改信息文本或是稍后再用您喜爱的文本编辑器来修改。请记住画面下方显示的文件位置。
按 Esc 将弹出一个默认为 a) leave editor的对话框。按 Enter 退出并继续。再次按 Enter 将保存修改。
2.9.5. 配置网络文件系统
网络文件系统 (NFS) 可以让您可以在网络上共享您的文件。一台机器可以配置成NFS服务器、客户端或两者并存。请参考
第 23.3 节
以获得更多的信息。
2.9.5.1. NFS 服务器 User Confirmation Requested
Do you want to configure this machine as an NFS server?
Yes [ No ]
如果您不想安装网络文件系统,请选择 [ No ] 然后按 Enter键。
如果您选择 [ Yes ] 将会出现一个对话框提醒您必须先建立一个 exports 文件。 Message
Operating as an NFS server means that you must first configure an
/etc/exports file to indicate which hosts are allowed certain kinds of
access to your local filesystems.
Press [Enter] now to invoke an editor on /etc/exports
[ OK ]
按 Enter 键继续。系统会启动文本编辑器让您编辑 exports 文件。
Figure 2-36. 编辑 exports文件

按照指示加入真实输出的文件目录或是稍后用您喜爱的编辑器自行编辑。请记下画面下方显示的文件名称及位置。
按下 Esc 键会出现一具对话框,默认选项是 a) leave editor。按下 Enter 离开并继续。
2.9.5.2. NFS 客户端
NFS 客户端允许您的机器访问NFS服务器。 User Confirmation Requested
Do you want to configure this machine as an NFS client?
Yes [ No ]
按照您的需要,选择 [ Yes ] 或 [ No ] 然后按 Enter。