Fedora Virtualization Guide - en to zh_CN translation catalogue (56 entries)

note: Tag: title
en: Pre-Red Hat Enterprise Linux 5.4 Xen networking
zh_CN: 预红帽企业版 Linux 5.4 Xen 联网

note: Tag: para
en: This chapter covers special topics for networking and network configuration with the Xen hypervisor.
zh_CN: 本章论述了使用 Xen 管理程序进行联网和网络配置的具体课题。

note: Tag: para
en: Most guest network configuration occurs during the guest initialization and installation process. To learn about configuring networking during the guest installation process, read the relevant sections of the installation process, <xref linkend="chap-Virtualization-Virtualized_guest_installation_overview"/>.
zh_CN: 大多数客户端网络配置是在客户端初始化和安装过程中进行。要了解有关在安装客户端的过程中进行联网配置的信息，请阅读安装过程部分的有关内容：<xref linkend="chap-Virtualization-Virtualized_guest_installation_overview"/>。

note: Tag: para
en: Network configuration is also covered in the tool specific reference chapters for <command>virsh</command> (<xref linkend="chap-Virtualization-Managing_guests_with_virsh"/>) and <command>virt-manager</command> (<xref linkend="chap-Virtualization-Managing_guests_with_the_Virtual_Machine_Manager_virt_manager"/>). Those chapters provide a detailed description of the networking configuration tasks using both tools.
zh_CN: 网络配置还在 <command>virsh</command>（<xref linkend="chap-Virtualization-Managing_guests_with_virsh"/>）和 <command>virt-manager</command>（<xref linkend="chap-Virtualization-Managing_guests_with_the_Virtual_Machine_Manager_virt_manager"/>）具体工具参考章节中有所论述。那些章节对使用两种工具完成联网配置任务进行了详细论述。

note: Tag: title
en: <title>Tip</title>
zh_CN: <title>窍门</title>

note: Tag: para
en: Using para-virtualized network drivers improves performance on fully virtualized Linux guests. <xref linkend="chap-Virtualization-Xen_Para_virtualized_Drivers"/> explains how to utilize para-virtualized network drivers.
zh_CN: 使用半虚拟网络驱动程序改进了全虚拟 Linux 客户端的性能。在 <xref linkend="chap-Virtualization-Xen_Para_virtualized_Drivers"/> 章中解释了如何利用半虚拟网络驱动程序。

note: Tag: title
en: Configuring multiple guest network bridges to use multiple Ethernet cards
zh_CN: 将多客户端网络桥接配置为使用多以太网卡

note: Tag: para
en: Process to setup network bridges (with the Xen hypervisor):
zh_CN: 设置网络桥接（使用 Xen 管理程序）的步骤：

note: Tag: para
en: Configure another network interface using either the <command>system-config-network</command> application. Alternatively, create a new configuration file named <filename>ifcfg-ethX</filename> in the <filename>/etc/sysconfig/network-scripts/</filename> directory where <parameter>X</parameter> is any number not already in use. Below is an example configuration file for a second network interface called <computeroutput>eth1</computeroutput>
zh_CN: 请使用 <command>system-config-network</command> 应用程序配置另一个网络接口。另外还可以在 <filename>/etc/sysconfig/network-scripts/</filename> 目录中创建名为 <filename>ifcfg-ethX</filename> 的文件，其中 <parameter>X</parameter> 只要不是正在使用中的数字即可。以下是为第二个名为 <computeroutput>eth1</computeroutput> 的网络接口配置文件示例：

note: Tag: para
en: Copy the file, <filename>/etc/xen/scripts/network-bridge</filename>, to <filename>/etc/xen/scripts/network-bridge.xen</filename>.
zh_CN: 将文件 <filename>/etc/xen/scripts/network-bridge</filename> 复制到 <filename>/etc/xen/scripts/network-bridge.xen</filename> 中。

note: Tag: para
en: Comment out any existing network scripts in <filename>/etc/xen/xend-config.sxp</filename> and add the line <parameter>(network-xen-multi-bridge)</parameter>.
zh_CN: 在 <filename>/etc/xen/xend-config.sxp</filename> 中注释出所有现有网络脚本并添加行 <parameter>(network-xen-multi-bridge)</parameter>。

note: Tag: para
en: Create a custom script to create multiple network bridges. A sample scripts is below, this example script will create two Xen network bridges (xenbr0 and xenbr1) one will be attached to eth1 and the other one to eth0. If you want to create additional bridges just follow the example in the script and copy/paste the lines accordingly:
zh_CN: 创建定制脚本生成多个红帽虚拟化网络桥接。脚本示例如下，该示例脚本将生成两个 Xen 桥接（xenbr0 和 xenbr1），一个附加到 eth1，另一个附加到 eth0。如果您想要生成额外的桥接，您只需要按照脚本中的示例复制/粘贴相应的行即可：

note: Tag: title
en: Red Hat Enterprise Linux 5.0 Laptop network configuration
zh_CN: 红帽企业级 Linux 5.0 网络配置

note: Tag: title
en: For Red Hat Enterprise Linux 5.1 or newer
zh_CN: 红帽企业版 Linux 5.1 或者更新的版本

note: Tag: para
en: This section describes manually adding network bridges. This procedure is not required or recommended for all versions of Red Hat Enterprise Linux newer than version 5.0. For newer versions use "<guilabel>Virtual Network</guilabel>" adapters when creating guests in <command>virt-manager</command>. NetworkManager works with virtual network devices by default in Red Hat Enterprise Linux 5.1 and newer.
zh_CN: 这部分论述了如何手动添加网络桥接。在比红帽企业版 Linux 5.0 新的所有版本中不需要或者不建议使用这个步骤。在较新的版本中使用 <command>virt-manager</command> 创建客户端时请使用<guilabel>「虚拟网络」</guilabel>适配器。在红帽企业版 Linux 5.1 及更新的版本中，网络管理器默认可管理虚拟网络设备。

note: Tag: para
en: An example of a virsh XML configuration file virtual network device:
zh_CN: 一个虚拟网络设备 virsh XML 配置文件实例：

note: Tag: para
en: In <command>xm</command> configuration files, virtual network devices are labeled "<systemitem>vif</systemitem>".
zh_CN: 在 <command>xm</command> 配置文件中将虚拟网络设备标记为 "<systemitem>vif</systemitem>"。

note: Tag: para
en: The challenge in running the Xen hypervisor on a laptop is that most laptops will connected to the network via wireless network or wired connections. Often these connections are switched multiple times a day. In such an environment, the system assumes it has access to the same interface all the time and it also can perform <command>ifup</command> or <command>ifdown</command> calls to the network interface it is using. In addition wireless network cards do not work well in a virtualization environment due to Xen&#39;s (default) bridged network usage.
zh_CN: 在笔记本电脑中运行 Xen 管理设备的难点在于大多数笔记本电脑是通过无线网络或者有线连接连接到网络中的。通常这些连接每天会切换数次。在这种环境中，系统假设 每次都访问同一个接口，同时可对其正在使用的网络接口执行 <command>ifup</command> 和 <command>ifdown</command> 调用。另外无线网卡也无法在红帽虚拟化环境中良好工作，这是由 Xen 的（默认）桥接网络用法所致。

note: Tag: para
en: This setup will also enable you to run Xen in offline mode when you have no active network connection on your laptop. The easiest solution to run Xen on a laptop is to follow the procedure outlined below:
zh_CN: 这个设定还将允许您在笔记本电脑没有活跃网络连接的情况下以离线模式运行 Xen。在笔记本电脑中运行 Xen 的最简单方法是执行以下步骤：

note: Tag: para
en: You will be configuring a &#39;dummy&#39; network interface which will be used by Xen. In this example the interface is called <command>dummy0</command>. This will also allow you to use a hidden IP address space for your guests.
zh_CN: 首先您要配置 Xen 将要使用的 &#39;dummy&#39; 网络接口。在这个示例中，该接口是 <command> dummy0</command>。这样还将允许您在客户端中使用隐藏 IP 地址空间。

note: Tag: para
en: You will need to use static IP address as DHCP will not listen on the dummy interface for DHCP requests. You can compile your own version of DHCP to listen on dummy interfaces, however you may want to look into using dnsmasq for DNS, DHCP and tftpboot services in a Xen environment. Setup and configuration are explained further down in this section/chapter.
zh_CN: 您需要使用静态 IP地址，因为　DHCP 将无法为 DHCP 请求侦听 dummy 接口。您可以将您自己的 DHCP 版本编译为侦听 dummy 接口，但您需要了解在 DNS 中 dnsmasq 的使用、DHCP 以及 Xen 环境中的 tftpboot 服务。这部分/章节中进一步论述了其设定和配置。

note: Tag: para
en: You can also configure NAT and IP masquerading in order to enable access to the network from your guests.
zh_CN: 您还可以配置 NAT/IP 伪装以便允许从您的客户端访问该网络。

note: Tag: title
en: Configuring a dummy network interface
zh_CN: 配置 dummy 网络接口

note: Tag: para
en: Perform the following configuration steps on your host:
zh_CN: 在您的主机中执行以下配置步骤：

note: Tag: para
en: create a dummy0 network interface and assign it a static IP address. In our example I selected 10.1.1.1 to avoid routing problems in our environment. To enable dummy device support add the following lines to <filename>/etc/modprobe.conf</filename>
zh_CN: 创建 dummy0 网络接口并为其分配一个静态 IP 地址。在我们的示例中，我选择了地址 10.1.1.1 以避免在环境中出现路由问题。要启用 dummy 设备支持，请在 <filename>/etc/modprobe.conf</filename> 中添加以下行：

note: Tag: para
en: To configure networking for dummy0 edit/create <filename>/etc/sysconfig/network-scripts/ifcfg-dummy0</filename>:
zh_CN: 要为 dummy0 配置联网，请编辑/创建 <filename>/etc/sysconfig/network-scripts/ifcfg-dummy0</filename> 文件：

note: Tag: para
en: Bind <systemitem>xenbr0</systemitem> to <systemitem>dummy0</systemitem>, so you can use networking even when not connected to a physical network. Edit <filename>/etc/xen/xend-config.sxp</filename> to include the <computeroutput>netdev=dummy0</computeroutput> entry:
zh_CN: 将 xenbr0 绑定到 dummy0，这样您就可以在任何时间使用联网，即使没有连接到物理网络也可以。编辑 <filename>/etc/xen/xend-config.sxp</filename> 文件，使其包含条目 <computeroutput>netdev=dummy0</computeroutput>：

note: Tag: para
en: Open <filename>/etc/sysconfig/network</filename> in the guest and modify the default gateway to point to <systemitem>dummy0</systemitem>. If you are using a static IP, set the guest&#39;s IP address to exist on the same subnet as <systemitem>dummy0</systemitem>.
zh_CN: 在客户端中打开 <filename>/etc/sysconfig/network</filename> 文件，将默认网关指向 <systemitem>dummy0</systemitem>。如果您使用的是静态 IP，请在同一子网中将客户端的 IP 地址设为 <systemitem>dummy0</systemitem>。

note: Tag: para
en: Setting up NAT in the host will allow the guests access Internet, including with wireless, solving the Xen and wireless card issues. The script below will enable NAT based on the interface currently used for your network connection.
zh_CN: 在主机中设定 NAT 可允许客户端访问互联网，包括使用无线联网，这样就解决了 Xen 和无线网卡的问题。下面的脚本将启用基于您目前网络连接所使用接口的 NAT。

note: Tag: title
en: Configuring NAT for virtualized guests
zh_CN: 为虚拟客户端配置 NAT

note: Tag: para
en: Network address translation (NAT) allows multiple network address to connect through a single IP address by intercepting packets and passing them to the private IP addresses. You can copy the following script to <filename>/etc/init.d/xenLaptopNAT</filename> and create a soft link to <filename>/etc/rc3.d/S99xenLaptopNAT</filename>. this automatically starts NAT at boot time.
zh_CN: 网络地址转换（NAT）通过拦截数据包并将其发送到专用 IP 地址将多个网络地址与单一 IP 地址连接 。您可以将以下脚本复制到 <filename>/etc/init.d/xenLaptopNAT</filename> 中，并生成软链接 <filename>/etc/rc3.d/S99xenLaptopNAT</filename>。这样就可在引导时自动启动 NAT。

note: Tag: title
en: <application>NetworkManager</application> and wireless NAT
zh_CN: <application>NetworkManager</application> 以及无线 NAT

note: Tag: para
en: The script below may not work well with wireless network or <application>NetworkManager</application> due to start up delays. In this case run the script manually once the machine has booted.
zh_CN: 由于启动延迟，下面的脚本可能无法在无线网络或者 <application>NetworkManager</application> 中正常工作。在这种情况下，请在机器引导后立即手动运行该脚本。

note: Tag: title
en: Configuring dnsmasq for the DNS, DHCP and tftpboot services
zh_CN: 为 DNS、DHCP 和 tftpboot 服务配置 dnsmasq

note: Tag: para
en: One of the challenges in running virtualization on a laptop (or any other computer which is not connected by a single or stable network connection) is the change in network interfaces and availability. Using a dummy network interface helps to build a more stable environment but it also brings up new challenges in providing DHCP, DNS and tftpboot services to your virtual machines/guests. The default DHCP daemon shipped with Red Hat Enterprise Linux and Fedora Core will not listen on dummy interfaces, your DNS forwarded information may change as you connect to different networks and VPNs.
zh_CN: 在笔记本电脑（或者其它没有通过单一或者稳定网络连接连接的计算机）中运行虚拟化的一个难点在于网络接口的改变和可用性。使用 dummy 网络接口可帮助您建立一个更稳定的环境，但这样会造成其它问题，即为您的虚拟机/客户端提供 DHCP、DNS 和 tftpboot 服务的问题。默认 DHCP 守护进程是与红帽企业版 Linux 一同发布的，且 Fedora 核心不会在 dummy 接口进行侦听，这样您的 DNS 转发的信息就可能会发生变化，因为您连接的是不同的网络和 VPN。

note: Tag: para
en: One solution to the above challenges is to use dnsmasq which can provide all of the above service in a single package and will also allow you to control its service only being available to requests from your dummy interface. Below is a short write up on how to configure <command>dnsmasq</command> on a laptop running virtualization:
zh_CN: 对于以上难点的一个解决方案就是使用 dnsmasq，它可在一个软件包中提供以上所有服务，并允许您只在有当您的 dummy 接口发出请求时才使用其服务。以下是如何在运行虚拟化的笔记本电脑中配置 <command>dnsmasq</command> 的具体方法：

note: Tag: para
en: Get the latest version of dnsmasq from <ulink url="http://www.thekelleys.org.uk/dnsmasq/">here</ulink>.
zh_CN: 在 <ulink url="http://www.thekelleys.org.uk/dnsmasq/">这里</ulink> 获得 dnsmasq 的最新版本。

note: Tag: para
en: Document for dnsmasq can be found <ulink url="http://www.thekelleys.org.uk/dnsmasq/doc.html">here</ulink>.
zh_CN: dnsmasq 的文档在 <ulink url="http://www.thekelleys.org.uk/dnsmasq/doc.html">这里</ulink>。

note: Tag: para
en: Copy the other files referenced below from <ulink url="http://et.redhat.com/~jmh/tools/xen/"></ulink> and grab the file <filename>dnsmasq.tgz</filename>. The tar archive includes the following files:
zh_CN: 在 <ulink url="http://et.redhat.com/~jmh/tools/xen/"></ulink>复制其它参考文件，并找出文件 <filename>dnsmasq.tgz</filename>。Tar 归档包含以下文件：

note: Tag: para
en: <filename>nm-dnsmasq</filename> can be used as a dispatcher script for NetworkManager. It will be run every time NetworkManager detects a change in connectivity and force a restart/reload of dnsmasq. It should be copied to <filename>/etc/NetworkManager/dispatcher.d/nm-dnsmasq</filename>
zh_CN: <filename>nm-dnsmasq</filename> 可用于 NetworkManager 的调度程序脚本。它会在 NetworkManager 每次侦测到连接性改变时运行，并强制重启/重新载入 dnsmasq。应将其复制到 <filename>/etc/NetworkManager/dispatcher.d/nm-dnsmasq</filename> 中。

note: Tag: para
en: <filename>xenDNSmasq</filename> can be used as the main start up or shut down script for <filename>/etc/init.d/xenDNSmasq</filename>
zh_CN: <filename>xenDNSmasq</filename> 可作为 <filename>/etc/init.d/xenDNSmasq</filename> 的主要启动和关闭脚本。

note: Tag: para
en: <filename>dnsmasq.conf</filename> is a sample configuration file for <filename>/etc/dnsmasq.conf</filename>
zh_CN: <filename>dnsmasq.conf</filename> 是 <filename>/etc/dnsmasq.conf</filename> 的示例配置文件。

note: Tag: para
en: <filename>dnsmasq</filename> is the binary image for <filename>/usr/local/sbin/dnsmasq</filename>
zh_CN: <filename>dnsmasq</filename> 是 <filename>/usr/local/sbin/dnsmasq</filename> 的二进制映像。

note: Tag: para
en: Once you have unpacked and build dnsmasq (the default installation will be the binary into <filename>/usr/local/sbin/dnsmasq</filename>) you need to edit your dnsmasq configuration file. The file is located in <filename>/etc/dnsmaqs.conf</filename>
zh_CN: 您打开并创建 dnsmasq 后（默认安装是在 <filename>/usr/local/sbin/dnsmasq</filename> 中加入二进制码），您需要编辑您的 dnsmasq 配置文件。该文件位于 <filename>/etc/dnsmaqs.conf</filename>。

note: Tag: para
en: Edit the configuration to suit your local needs and requirements. The following parameters are likely the ones you want to modify:
zh_CN: 编辑配置文件使其适合您的本地需要和要求。以下是您可能需要修改的参数：

note: Tag: para
en: The <computeroutput>interface</computeroutput> parameter allows <systemitem class="service">dnsmasq</systemitem> to listen for <systemitem class="service">DHCP</systemitem> and <systemitem class="service">DNS</systemitem> requests only on specified interfaces. This could be dummy interfaces but not your public interfaces as well as the local loopback interface. Add another <computeroutput>interface</computeroutput> line for more than one interface. <computeroutput>interface=dummy0</computeroutput> is an example which listens on the <systemitem>dummy0</systemitem> interface.
zh_CN: <computeroutput>interface</computeroutput> 参数允许 <systemitem class="service">dnsmasq</systemitem> 只为 <systemitem class="service">DHCP</systemitem> 和 <systemitem class="service">DNS</systemitem> 请求在指定接口进行侦听。这可以是 dummy 接口，但不可以是您的公共接口或者本地回送接口。如果多于一个接口，请添加另一个 <computeroutput>interface</computeroutput> 行。<computeroutput>interface=dummy0</computeroutput> 是一个示例，即在 <systemitem>dummy0</systemitem> 接口中侦听。

note: Tag: para
en: <computeroutput>dhcp-range</computeroutput> to enable the integrated <systemitem class="service">DHCP</systemitem> server, you need to supply the range of addresses available for lease and optionally a lease time. If you have more than one network, you will need to repeat this for each network on which you want to supply <systemitem class="service">DHCP</systemitem> service. An example would be (for network 10.1.1.* and a lease time of 12hrs): <computeroutput>dhcp-range=10.1.1.10,10.1.1.50,255.255.255.0,12h</computeroutput>
zh_CN: <computeroutput>dhcp-range</computeroutput> 要启用整合的 <systemitem class="service">DHCP</systemitem> 服务器，您需要提供可租用的地址范围，有时还需要租用时间。如果您有多个网络，您将需要为每个需要提供 <systemitem class="service">DHCP</systemitem> 服务的网络重复此操作。例如（网络 10.1.1.*，租期 12 小时）：<computeroutput>dhcp-range=10.1.1.10,10.1.1.50,255.255.255.0,12h</computeroutput>。

note: Tag: para
en: <computeroutput>dhcp-option</computeroutput> to override the default route supplied by dnsmasq, which assumes the router is the same machine as the one running dnsmasq. An example would be <computeroutput>dhcp-option=3,10.1.1.1</computeroutput>
zh_CN: <computeroutput>dhcp-option</computeroutput> 可覆盖由 dnsmasq 提供的默认路由，即假设路由器与运行 dnsmasq 的机器是同一台机器。例如：<computeroutput>dhcp-option=3,10.1.1.1</computeroutput>

note: Tag: para
en: After configuring dnsmasq you can copy the script below as <filename>xenDNSmasq</filename> to <filename>/etc/init.d</filename>
zh_CN: 配置完 dnsmasq 之后，您可以将下面的脚本作为 <filename>xenDNSmasq</filename> 复制到 <filename>/etc/init.d</filename> 中

note: Tag: para
en: If you want to automatically start dnsmasq during system boot you should register it using chkconfig(8):
zh_CN: 如果您想要在系统引导的过程中自动启动 dnsmasq，您应该用 chkconfig(8) 对其进行注册：

note: Tag: para
en: Enable it for automatic start up:
zh_CN: 启用它的自动启动：

note: Tag: para
en: To configure <filename>dnsmasq</filename> to restart every time <application>NetworkManager</application> detects a change in connectivity you can use the supplied script <command>nm-dnsmasq</command>.
zh_CN: 要将 <filename>dnsmasq</filename> 配置为每次 <application>NetworkManager</application> 侦测到连接性改变时重新启动，您可以使用我们提供的脚本 <command>nm-dnsmasq</command>。

note: Tag: para
en: Copy the <filename>nm-dnsmasq</filename> script to <filename>/etc/NetworkManager/dispatcher.d/</filename>
zh_CN: 将 <filename>nm-dnsmasq</filename> 脚本复制到 <filename>/etc/NetworkManager/dispatcher.d/</filename> 中

note: Tag: para
en: The <application>NetworkManager</application> dispatcher will execute the script (in alphabetical order if you have other scripts in the same directory) every time there is a change in connectivity
zh_CN: 每次在连接性发生变化时，<application>NetworkManager</application> 调度程序都将执行该脚本（如果您在同一目录中有其它脚本，则将按照字母排列顺序执行）。

note: Tag: para
en: <filename>dnsmasq</filename> will also detect changes in your <filename>/etc/resolv.conf</filename> and automatically reload them (that is, if you start up a VPN session for example).
zh_CN: <filename>dnsmasq</filename> 还可探测您 <filename>/etc/resolv.conf</filename> 文件的改变，并自动重新载入它们（例如：如果您启动了 VPN 会话）。

note: Tag: para
en: Both the <filename>nm-dnsmasq</filename> and <filename>xenDNSmasq</filename> script will also set up NAT if you have your virtualized guests on a hidden network to allow them access to the public network.
zh_CN: 如果您在隐藏网络中有虚拟客户端，<filename>nm-dnsmasq</filename> 和 <filename>xenDNSmasq</filename> 脚本还将会设定 NAT，以便它们可以访问公共网络。
