Install/Network/zh-cn

From Funtoo
Jump to navigation Jump to search
This page is a translated version of the page Install/Network and the translation is 65% complete.
Other languages:
English • ‎español • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎

安装指南:网络

Install Guide, Chapter 15 < Prev Next >

重启系统之前,要确保能够连接网络。可以从 NetworkManager,dhcpcd,Funtoo Linux Networking 脚本这三个中自由选择。下面讲解如何通过想要设置的网络类型选择合适的方式。

Wi-Fi

   Note

If using the gnome or other desktop install image, linux-firmware and NetworkManager are already installed and available. You can use nmtui to get Wi-Fi going if you need network connectivity prior to getting X and GNOME fully up and running. In addition, desktop stage3's have ZeroConf/Bonjour multicast DNS lookups enabled by default. Both these things will not be set up yet if you are using the basic stage3 image.

For laptop/mobile systems where you will be using Wi-Fi, roaming, and connecting to various networks, NetworkManager is strongly recommended. Since Wi-Fi cards require firmware to operate, it is also recommended that you emerge the linux-firmware ebuild if you have not done so already:

chroot # emerge linux-firmware networkmanager
chroot # rc-update add NetworkManager default

The above command will ensure that NetworkManager starts after you boot into Funtoo Linux. Once you've completed these installation steps and have booted into Funtoo Linux, you can use the nmtui command (which has an easy-to-use console-based interface) to configure NetworkManager so that it will connect (and automatically reconnect, after reboot) to a Wi-Fi access point:

chroot # nmtui

For more information about NetworkManager, see the NetworkManager package page.

桌面(有线 DHCP 连接)

对于一个使用 DHCP 进行有线网络连接的家庭电脑或者是工作站,最简单有效的启用网络方式,就是将 dhcpcd 添加至默认的 runlevel:

chroot # rc-update add dhcpcd default

重启系统后,dhcpcd 会在后台运行,管理所有的网络接口,并且通过 DHCP 服务从 DHCP 服务器获得网络地址。

如果你的 DHCP 上游的服务器是 dnsmasq,那么它可以设置为通过 MAC 地址给终端分配地址,这样就能使用 DHCP 上的服务器。

服务器(静态 IP)

For servers, the Funtoo Linux Networking scripts are the supported option for network configuration, and they have their own documentation. They are optimized for static configurations and things like virtual Ethernet bridging for virtualization setups. See Funtoo Linux Networking for information on how to use Funtoo Linux's template-based network configuration system.

Hostname

By default Funtoo uses "localhost" as hostname. Although the system will work perfectly fine using this name, some ebuilds refuse to install when detecting localhost as hostname. It also may create confusion if several systems use the same hostname. Therefore, it is advised to change it to a more meaningful name. The hostname itself is arbitrary, meaning you can choose almost any combination of characters, as long as it makes sense to the system administrator. To change the hostname, edit

chroot # nano /etc/conf.d/hostname

修改以主机名开头的行。保存文件,下一次 Funtoo Linux 启动的时候就将使用新的主机名。

   Warning

Hostnames can be up to 63 characters long and may use the following characters: a-z, 0-9 and hyphens (-). However, the hyphen may not be the first or last character.

Install Guide, Chapter 15 < Prev Next >