Skip to content

Latest commit

 

History

History
496 lines (262 loc) · 29.9 KB

File metadata and controls

496 lines (262 loc) · 29.9 KB

一、设置环境

欢迎来到 Linux 网络的世界! 这本书将是你完善你的 Linux 网络管理技能的指南。 在本章中,我们将讨论启动和运行环境需要做些什么。 我们将讨论几个 Linux 发行版感兴趣的企业网络,要记住的事情而设置在家里或办公室的环境,这样你就可以跟随这本书,和一些最佳实践设置几个 Linux 安装中我们将使用这本书。 基本上,我们会为你的技能发展打下基础。

在本章中,我们将介绍:

  • 开始
  • 分布考虑
  • 物理机器和虚拟机器
  • 设置和配置 VirtualBox
  • 获取并安装 Debian 8
  • 获取并安装 CentOS 7

开始

Linux 下的网络管理是一个有趣的、多样的、不断变化的领域。 而核心组件通常保持不变在年(如TCP / IP 协议),如何管理这些服务在每一代进化,比如的崛起 systemd**。 Linux 绝对是令人兴奋的。**

在本章中,我们将看到如何设置您的环境。 根据您的经验水平,您可以直接跳到第二章重温 Linux 网络基础。 如果您已经适应在物理或虚拟机**上设置一两个发行版,那么您已经具备了入门所需的知识。 在这里,我们将讨论如何安装本书练习中感兴趣的几个发行版和一些一般的指示。

简而言之,您必须使用的 Linux 安装越多越好。 在实践网络概念时,最好拥有尽可能多的节点,这样您就可以测试配置更改对环境的影响。 如果您已经习惯了安装 Linux,请随意设置一些节点,然后我们将在下一章中见面。

要考虑的分布

目前存在的 Linux 发行版有一百多个。 这些发行版包括专门针对工作站或服务器(或者两者都是)的发行版和专门解决特定任务的发行版,如 Kali、Mythbuntu 和 Clonezilla。 自然地,当研究网络管理之类的概念时,人们可能会遇到的第一个问题是从哪个发行版开始。

我们不关注任何一个分布。 在企业中,没有两个数据中心是相同的。 一些使用 Linux 的组织可能会对特定的发行版集(例如 Ubuntu 和 Ubuntu Server)进行标准化,尽管在中混合使用一个或多个发行版更为常见。 分布等SUSE Linux 企业,Red Hat Enterprise Linux,Ubuntu 服务器【显示】,CentOS,Debian【病人】非常普遍在基于 Linux 的服务器网络。 根据我的经验,我经常看到 Debian(及其衍生物)和基于 Red hat 的发行版的使用。

我们鼓励您试验和混合您可能喜欢的发行版本。 有很多候选人,像www.distrowatch.com这样的网站会给你一个可能性列表。 特别是为了本书中的例子,推荐您使用 CentOS 和 Debian。 实际上,这两个发行版是很好的开始。 您将熟悉包管理(rpmdeb包)的两种不同形式,并熟悉两个最流行的发行版。 关于 Debian,有相当多的发行版是基于它的(UbuntuLinux Mint,以及其他)。 通过学习如何管理 Debian 安装,如果您考虑切换到其他发行版,那么这些知识也可以转移到其他发行版上。 CentOS 也是如此,它是基于 Red Hat 的。 Red Hat 是一个非常流行的发行版,因为 CentOS 是由它的源创建的,所以基本上你也在学习它。 虽然Fedora比 Red Hat 或 CentOS 更加先进,但其中的许多知识也将在那里非常有用; Fedora 作为工作站发行版很受欢迎。

本书中的例子在 CentOS 和 Debian 中都进行了测试。 每当一个指令是针对一个特定的分布,我会让你知道。 有一个 CentOS 和 Debian 安装将适合您的目的,这本书,但请自由试验。 就这些发行版的各个版本而言,CentOS 7 和 Debian 8 都是使用的。 将这些安装在您的环境或家庭实验室中。

物理机 vs 虚拟机

在一本网络书籍中看到关于虚拟机的节可能会让人感到有些惊讶。 说句公道话,这当然是不合时宜的。 除了作为一个重要的企业平台之外,虚拟化也是一个非常宝贵的学习工具。 在真实的网络中,技术人员可以在虚拟机中测试服务,然后将其推出到环境中。 例如,一个新的DNS服务器可能作为VM开始,然后在测试和验证之后,将其转移到一个环境中供组织使用。 这种方法的一个好处是,您可以在开发解决方案时使用多个快照,如果您搞砸了或破坏了它,您可以恢复快照,并从已知的工作状态开始。

就掌握 Linux 网络技能而言,虚拟机允许您测试一个过程在不同发行版之间的差异。 启动虚拟机很容易,销毁它就更容易了。 如果您受到物理硬件的限制,那么虚拟机可以为您提供构建小型虚拟网络的机会。 当然,虚拟机的权衡是它们使用多少 RAM。 然而,在没有 GUI 的情况下,大多数 Linux 发行版在 512 MB RAM 的情况下也能轻松运行。 现在,有相当多的计算机提供了 8gb 甚至 16gb 的 RAM,所以即使在目前可用的廉价计算机上,您也应该能够运行多个 vm。

公平地说,使用虚拟机进行实践和学习并不总是理想的。 事实上,在学习网络时,物理设备通常是首选。 虽然您可以通过运行在 VM 中的 Apache 练习设置和提供网页,但是您不能在这样的环境中练习机架交换机和路由器。 只要有可能,尽量使用物理设备。 但是,虚拟机为您提供了一个独特的机会,可以创建一小群节点来维护您的网络。

当然,并不是每个人都有一堆戴尔塔坐在壁橱里,准备好等待一个闪亮的新 Linux 安装。 您可以使用所有物理机器,也可以同时使用物理和虚拟机器。 在这本书中,没有对你的库存做任何假设。 游戏的名称是管理节点,所以设置尽可能多的节点。

在这本书中,我们讨论了VirtualBox。 然而,它绝不是创建虚拟机的唯一解决方案。 也有其他的解决方案,如KVMXenVMware等。 VirtualBox 具有免费、开源和跨平台的优点(它可用于 Linux、Mac OS X 和 Windows),所以它很有可能在您的环境中工作。 在大多数情况下,它甚至比 KVM 或 Xen 更容易设置(但可能没有 KVM 或 Xen 那么酷)。 你不需要使用 VirtualBox(甚至是虚拟机)来阅读这本书。 使用任何你喜欢的解决方案。 在这本书中,我尝试不将说明限制在任何一个特定的解决方案中,所以内容适用于尽可能多的人。

设置和配置 VirtualBox

如果你已经决定在你的环境中使用 VirtualBox(无论是为了学习、测试发行版,还是在实现之前评估网络服务),我们将在这个活动中设置我们的 VirtualBox 主机。

获取 VirtualBox

下载并安装 VirtualBox 其实相当简单,但每个平台都有其独特之处。 在 Windows 中,初始安装只是导航到以下站点并下载安装文件并通过安装向导运行:

https://www.virtualbox.org/wiki/Downloads

安装后,您需要做的就是跳到本章的下载和安装扩展包部分。 在 Mac OS X 上安装也很简单。

对于 Linux,有几种方法来安装 VirtualBox。 一种方法是使用您的包管理器,如果您的发行版在其存储库中已经有了它。 不幸的是,取决于您发行版的版本,可能包含的 VirtualBox 版本很可能已经过时了。 例如,Debian 通常在其存储库中包含较旧的包,但是像 Arch 这样的前沿发行版更有可能包含最新最好的包。

也许获取 VirtualBox 更好的方法是将 VirtualBox 本身提供的存储库导入到您的系统中。 下面的 URL 有一个 Debian 存储库的列表,甚至还有一个为基于 rpm 的发行版(Fedora、Red Hat 等)添加存储库的方法:

https://www.virtualbox.org/wiki/Linux_Downloads

例如,使用页面上的说明作为指南,我们可以在基于 debian 的系统上运行以下过程。 然而,Oracle 可能随时更改其指令和存储库列表; 总是在安装之前咨询之前的 URL,看看过程是否改变了。

为了验证我们将添加正确的版本,我们需要确定使用哪个存储库。 这取决于您运行的发行版,所以一定要参考 VirtualBox 网站上的文档,以确保您导入了正确的存储库。

对于 Debian 8“Jessie”,我们将使用以下代码:

deb http://download.virtualbox.org/virtualbox/debian jessie contrib

要将这个存储库添加到我们的 Debian 系统中,我们将使用以下命令:

# echo "deb http://download.virtualbox.org/virtualbox/debian jessie contrib" > /etc/apt/sources.list.d/virtualbox.list

然后,我们可以使用以下命令添加存储库的公钥:

# wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | apt-key add -

从开始,我们可以在存储库中找到 Oracle 的 VirtualBox 包并安装它。 为此,让我们首先用下面的命令(作为根用户)更新我们的包列表:

# apt-get update

然后用以下命令安装 VirtualBox:

# apt-get install dkms virtualbox-4.3

注意事项

同样的安装过程也适用于 Ubuntu,只要你选择了合适的匹配库。

对于像 Fedora,Red Hat Enterprise Linux(RHEL)和 openSUSE 这样的发行版,Oracle 提供了类似的说明。

公钥可以通过以下命令下载:

# wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | rpm --import -

为了将存储库添加到 Fedora 系统中,执行以下命令:

# wget -P /etc/yum/repos.d/ http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo

添加存储库后,可以使用以下命令安装 VirtualBox:

# yum install VirtualBox-4.3

在中,OpenSUSE 和 RHEL 的说明也可以在 VirtualBox 网站上找到。 详情请访问 VirtualBox 网站https://www.virtualbox.org

下载并安装扩展包

Oracle 提供了Extension Pack,可以将 USB 支持为,并支持预引导执行环境(PXE)引导。 您可能需要,也可能不需要这些特性。 如果您认为能够在主机 PC 上插入一个闪存驱动器并从 VM 中访问它,那么安装这个包可能是一个好主意。

注意事项

由于许可问题,VirtualBox 没有内置扩展包。 如果你想了解更多,请随时咨询 VirtualBox 许可证。

不管您的主机计算机运行的是 Linux、Windows 还是 Mac OS x,扩展包的安装过程基本上是相同的。但是,如果您的主机运行的是 Linux,则添加一个步骤,即将您的用户帐户添加到vboxusers组。

  1. 当你第一次安装 VirtualBox 时,它应该已经创建了这个组。 执行以下命令进行验证:

    cat /etc/group |grep vboxusers
    
  2. 您应该看到类似于以下输出:

  3. 如果没有看到输出,请使用以下命令创建组:

    # groupadd vboxusers
    
  4. 然后,把你自己加入这个组:

    # usermod -aG vboxusers yourusername
    

注意事项

在将自己加入vboxusers组生效之前,需要注销并登录。

现在,您可以安装扩展包了。 同样,无论您的底层操作系统是什么,这个过程都应该是相同的。 首先,从以下 URL 下载扩展包并保存到本地:

https://www.virtualbox.org/wiki/Downloads

下载完成后,请执行以下步骤:

  1. Open VirtualBox and go to File | Preferences....

    Downloading and installing the Extension Pack

    在 VirtualBox 中访问文件菜单

  2. Next, click on Extensions and then click on the green triangle icon on the right-hand side.

    Downloading and installing the Extension Pack

    VirtualBox 设置

  3. Select the extension pack that you downloaded earlier and click on Open.

    Downloading and installing the Extension Pack

    扩展包选择

  4. You'll then be asked to confirm the installation. Click on Install.

    Downloading and installing the Extension Pack

    扩展包安装确认

  5. The VirtualBox license agreement will be displayed. Feel free to check it. Then, scroll to the bottom and click on I Agree to confirm it.

    Downloading and installing the Extension Pack

    VirtualBox 许可协议

  6. If you're running Linux, you may be asked for the root or sudo password. If you do, enter it and continue. After authenticating, you should see confirmation that you've successfully installed the extension pack.

    Downloading and installing the Extension Pack

    成功安装 VirtualBox 扩展包的确认

在这个过程之后,VirtualBox 将在您的机器上启动并运行。

注意事项

在一些发行版中,密码提示符可能不会出现,导致扩展包安装失败。 如果出现这种情况,使用下面的命令以 root 权限运行 VirtualBox:

sudo VirtualBox

然后,尝试再次安装扩展包。 完成后,关闭 VirtualBox,然后以普通用户的身份重新打开它,然后继续。

获取和安装 Debian 8

为了安装 Debian,我们首先需要获取一个ISO****镜像文件。 要做到这一点,去以下网址:

http://www.debian.org/distrib/netinst

有几个可供下载的选项,但是netinstISO 将是我们的目标。 对于大多数计算机,64 位(amd64)版本应该足够了——除非您确定您的计算机不支持 64 位。 netinst 和完整的安装映像之间的主要区别是,netinst 版本将通过 Internet 从 Debian 的服务器下载所需的内容。 只要您不在一个带宽受限的区域内,这应该不是一个问题。

当然,ISO 文件本身是没有用的,除非您将其附加到虚拟机。 如果是,那你就准备好了。 如果您正在设置一台物理机器,您将需要创建一个可引导 CD 和一个您选择的光盘掌握工具,或者创建一个可引导闪存驱动器。

注意事项

因为有许多不同的掌握光盘的实用程序可用,所以不可能完整地演练如何在您的环境中创建可引导 CD。 在大多数情况下,您的实用程序应该在其菜单中有一个刻录 ISO 映像的选项。 如果您只是创建一个数据磁盘,那么该磁盘将不能作为 Debian 安装介质。

安装 Debian 8 的步骤如下:

  1. 在 Linux 系统中,您可以使用以下命令创建一个可引导的 Debian 闪存驱动器:

    # cp name-of-debian.iso /dev/sd? && sync
    
  2. 实际上,我们将下载的 ISO 映像直接复制到闪存驱动器中。 当然,要将文件名和目标更改为与您的系统相关的文件名和目标。 要确定要使用的设备节点,请执行以下命令:

    # fdisk -l
    
  3. 在输出中,您应该看到您的闪存驱动器的节点指定。 该命令的输出将如下所示:

  4. Then, /dev/sdb would be the device to use to create the flash drive. Putting it all together, we would create the flash drive with the following command:

    # cp name-of-debian.iso /dev/sdb && sync
    

    提示

    下载示例代码

    您可以从您的帐户http://www.packtpub.com下载您购买的所有 Packt Publishing 图书的示例代码文件。 如果您在其他地方购买这本书,您可以访问http://www.packtpub.com/support并注册,将文件直接通过电子邮件发送给您。

  5. Once you have created bootable media, insert it into your computer and follow your computer's specific directives to access the boot menu and select your Debian media. After it finishes loading, the first screen will ask you to select your language. Choose your language, then click on Continue.

    Acquiring and installing Debian 8

    Debian 安装程序的语言选择屏幕

  6. After selecting your language, the next screen will have you choose your location. Select it and then click on Continue.

    Acquiring and installing Debian 8

    Debian 安装程序中的语言选择

  7. Similarly, choose a keymap that fits your keyboard and click on Continue.

    Acquiring and installing Debian 8

    Debian 安装程序的键盘选择屏幕

  8. At this point, the Debian installer will detect your hardware, and then allow you to configure your host name. For this option, choose a unique host name that will identify your device on the network. When finished, click on Continue.

    Acquiring and installing Debian 8

    在安装 Debian 时选择一个主机名

  9. The installer will then ask for your domain name. Enter your domain name here if you have one; otherwise, just leave it blank. Click on Continue.

    Acquiring and installing Debian 8

    安装 Debian 时的域名配置

  10. Next, you'll be asked to set a password for the root account. For this, you should create a unique (and preferably randomly generated) password. As you probably know, the root account has full access to the system. After setting the password, click on Continue.

![Acquiring and installing Debian 8](img/B03919_01_12.jpg)

安装 Debian 时输入 Root 密码
  1. In the next three screens, you'll set up your user account. First, you'll enter your first and last name, and then click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_13.jpg)

设置主用户帐户的第一个屏幕
  1. Then, type in username and click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_14.jpg)

创建一个用户名
  1. The final portion of the user setup section will ask you to create a password. When done, click on Continue again.
![Acquiring and installing Debian 8](img/B03919_01_15.jpg)

设置主用户的密码
  1. Next, Debian will try to use Network Time Protocol (NTP), if available, to configure your clock. Then, you'll be presented with a screen to select your time zone. Make sure your time zone is highlighted, and click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_16.jpg)

配置您的位置,为时区
  1. Now, we'll partition our disk. Feel free to partition your disk any way you want, as there are no partitioning requirements as far as this book is concerned. For the sake of this instruction, Guided - use entire disk, the default for Debian, is chosen. If you have a preferred partitioning scheme, feel free to use it. When finished, click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_17.jpg)

Debian 安装的分区部分的第一个屏幕
  1. Next, you'll have to select the hard disk on which to install Debian. In this example, there is only one hard disk available in the VM that was used to capture the procedure. If you have more than one disk, select the appropriate disk for installation and click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_18.jpg)

为 Debian 选择目标磁盘
  1. In the next section, the Debian installer will ask if you would like to have a separate /home partition (recommended if you wish to retain files between installations), separate /home, /var, and /tmp partitions, or all files in one partition. This book has no partitioning requirements, so choose the one that best fits your preference. When you've made your selection, click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_19.jpg)

磁盘分区的选择
  1. Next, Debian will display a summary of the changes it's about to make. If these changes look good to you, ensure Finish partitioning and write changes to disk is highlighted and click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_20.jpg)

分区概述
  1. Then, you'll have to confirm the details again. Select Yes and then click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_21.jpg)

确认对分区的更改
  1. The base system will be installed next; this might take a little while depending on the speed of your computer and hard disk. Afterwards, you'll be presented with a screen where you'll select the country nearest you in order to set up Debian's package manager.
![Acquiring and installing Debian 8](img/B03919_01_22.jpg)

为包管理器选择一个位置
  1. Next, you'll select a mirror for Debian's package archives. In most cases, the default selection is usually accurate. So unless it guessed incorrectly, leave the default selection as-is and click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_23.jpg)

为 Debian 的包归档选择一个镜像
  1. In the next screen, Debian will give you a chance to configure an HTTP proxy, if you have one. If not, leave it blank.
![Acquiring and installing Debian 8](img/B03919_01_24.jpg)

HTTP 代理配置
  1. Next, Debian will configure your package manager and update your sources. After a few progress bars scroll by, you'll see a new screen asking you whether or not you'd like to submit usage statistics to Debian. This information is helpful to Debian's developers, but it's not required. Make your choice and click on Continue.
![Acquiring and installing Debian 8](img/B03919_01_25.jpg)

选择是否向 Debian 开发人员提供匿名统计信息

下一个屏幕的将为我们提供额外的软件包,我们可以将其添加到我们的系统中,但这些不是必需的(不过,让标准系统实用程序启用是一个好主意)。 提供的大多数选项允许我们选择**桌面环境**,但是您不需要安装一个。 通常,服务器不会安装在桌面环境中。 然而,如果你正在设置一个工作站 PC,它可能是有益的。

*   **GNOME**:它是 Debian 的默认桌面环境。 GNOME 是最先进的,它为与计算机交互提供了一个独特的范例。 GNOME 大量使用虚拟工作区,这允许您在多个桌面之间分割工作流。 不幸的是,GNOME 对硬件加速的要求相对较低; 这意味着如果你没有现代显卡,它就不能正常工作。
*   **Xfce**:它是 GNOME 的一个非常轻量级的替代,并且已经存在很长一段时间了。 Xfce 非常适合具有低端处理能力的计算机。 现在,Xfce 没有看到太多的积极的开发,所以它没有太大的变化。 这意味着在很多情况下它更稳定,尽管那些喜欢具有现代特性的东西的人可能不会对它感兴趣。
*   **KDE**:它是一个像 GNOME 一样的现代桌面环境,但它类似于 Windows 的用户界面。 与 GNOME 一样,KDE 也有相对适度的硬件要求,尽管没有 GNOME 那么糟糕。 KDE 具有**海豚**文件管理器,受到 Linux 用户的尊重。
*   Cinnamon**:它最初是作为 GNOME 的一个分支创建的,但是它已经发展成为自己的桌面环境,其中包含很少的 GNOME 依赖。 肉桂提供了更传统的桌面风格,带有 GNOME 的现代感觉。**
***   **MATE**:它是老 2 的延续。 GNOME 的 x 版本。 因此,MATE 在旧机器上运行得很好,并且比 Xfce 得到了更多的开发。 它可能不像 Xfce 那样稳定,但也很接近。*   **LXDEL**:对于较老的计算机,它也是一个很好的选择,它与 Xfce 类似,但没有 Xfce 那么流行。** **除了桌面环境选择,建议从这个列表中选择**SSH 服务器**。 也可以选择**Web 服务器**,但是您最好等到我们阅读到讨论 Apache 的那一部分,因为我们将详细介绍 Apache 的安装过程。

![Acquiring and installing Debian 8](img/B03919_01_26.jpg)

Debian 软件选择** 

*** Make your selections and then wait for the rest of the installation procedure to finish, as Debian installs the software you selected in the previous step. Then, it's time to configure GRUB. GRUB is an acronym for Grand Unified Bootloader and is necessary in order for us to boot our system. You'll be asked whether you'd like to install GRUB into the master boot record (which you more than likely will want to do), so ensure the Yes radio box is checked and click on Continue.

![Acquiring and installing Debian 8](img/B03919_01_27.jpg)

GRUB 配置

*   Next, select a target on which GRUB should be installed. In most cases, this will be `/dev/sda`.

![Acquiring and installing Debian 8](img/B03919_01_28.jpg)

GRUB 目标选择

*   Whew! We are finally ready to reboot into our new Debian environment. Click on **Continue** one last time and we're off to the races!

![Acquiring and installing Debian 8](img/B03919_01_29.jpg)

Debian 安装过程的最后一个屏幕** 

**# 获取和安装 CentOS 7

在这个活动中,我们安装了 CentOS 7(它的步骤比 Debian 少得多)。 下载 ISO 文件,请浏览以下网址:

https://www.centos.org/download/

DVD 的 ISO 链接应该能满足我们的需要。

就像 Debian 演练一样,我们需要创建一个引导盘或闪存驱动器来开始安装。 与 Debian 安装程序不同的是,现在我们需要一个 DVD-R 光盘,因为映像太大了,无法装入 CD-R。

如果你是通过闪存盘安装,下面的 URL 来自 CentOS 的 wiki 描述了这个过程:

http://wiki.centos.org/HowTos/InstallFromUSBkey

在之后,从安装介质启动,执行以下步骤:

  1. You'll first see a screen asking you to select the language to be used during installation. Choose your language and click on Continue.

    Acquiring and installing CentOS 7

    CentOS 安装过程中的语言选择

  2. The next screen that appears is one of two main sections of the installation. The items shown here (DATE & TIME, KEYBOARD, LANGUAGE SUPPORT, INSTALLATION SOURCE, SOFTWARE SELECTION, INSTALLATION DESTINATION, and NETWORK & HOSTNAME) can be completed in any order. As you can see in the screenshot, only one section (INSTALLATION DESTINATION) is actually required. Basically, you can go through each section listed and complete its task and then click on Begin Installation when you're finished. If you choose not to complete a section, its defaults will be used.

    Acquiring and installing CentOS 7

    第一节主要介绍 CentOS 的安装过程

  3. For LANGUAGE SUPPORT, you'll choose your language. When finished, click on the icon labeled Done on the top-left corner.

    Acquiring and installing CentOS 7

    语言选择

  4. Don't skip the NETWORK & HOSTNAME section. By default, networking isn't even enabled at all, so you can enable it by clicking on the toggle switch next to your interface. Near the bottom, you can type in the desired host name of your computer. When finished, click on Done.

    Acquiring and installing CentOS 7

    安装 CentOS 时的组网配置

  5. In the DATE & TIME section, you can set up your clock and location. Keep in mind that if you didn't enable your network interface in the NETWORK & HOSTNAME section, you'll be unable to utilize NTP.

    Acquiring and installing CentOS 7

    日期和时间配置

  6. Completing the INSTALLATION DESTINATION section is compulsory. Here, you will select which disk to install CentOS onto, as well as your partitioning scheme. In this walkthrough, we'll select a disk and keep the default partitions, but feel free to customize the partition scheme if you prefer.

    Acquiring and installing CentOS 7

    CentOS 安装程序中的磁盘配置部分

  7. By default, CentOS will be a Minimal Install. This means that there will be no graphical user interface, just the default packages. If you prefer, you can opt for a desktop environment such as GNOME or KDE by selecting the corresponding option.

    Acquiring and installing CentOS 7

    CentOS 软件选择

  8. After you click on Begin Installation, you'll be brought to the second main section of the installation procedure while CentOS installs itself onto your system in the background. This section is much smaller and has just two steps. We'll set our root password and create a standard user account.

    Acquiring and installing CentOS 7

    CentOS 用户配置

  9. For the root password, choose something secure. A password meter will show the presumed strength of the password. Click on Done when finished.

    Acquiring and installing CentOS 7

    根密码输入

  10. Finally, we'll create a standard user. On this screen, we'll enter the values in the Full name and Username fields, and choose a strong value for Password. You can also tick the box labeled Make this user administrator, if necessary.

![Acquiring and installing CentOS 7](img/B03919_01_39.jpg)

CentOS 用户创建
  1. Finally, when installation is complete, click on Reboot and we're all set.
![Acquiring and installing CentOS 7](img/B03919_01_40.jpg)

完成 CentOS 安装的确认

完成这些之后,您可以随意设置您可能需要的 Linux 安装。 在以后的章节中,我们将使用这些安装来配置网络并提高我们的知识。

总结

在本章中,我们完成了设置我们的环境。 我们讨论了虚拟机和物理机作为网络节点,我们甚至安装了一两个 Debian 和 CentOS。

现在我们已经设置了环境,现在可以开始了。 在第二章中,我们将介绍我们在这次旅程中所需要的所有命令,例如,配置网络接口,手动连接到网络,以及设置网络管理器。 请继续关注!****