<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-iproute2" role="wrap">
  <?dbhtml filename="iproute2.html"?>

  <sect1info condition="script">
    <productname>iproute2</productname>
    <productnumber>&iproute2-version;</productnumber>
    <address>&iproute2-url;</address>
  </sect1info>

  <title>IPRoute2-&iproute2-version;</title>

  <indexterm zone="ch-system-iproute2">
    <primary sortas="a-IPRoute2">IPRoute2</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>IPRoute2 软件包包含基于 IPv4 的基本和高级网络程序。</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&iproute2-ch6-sbu;</seg>
        <seg>&iproute2-ch6-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>安装 IPRoute2</title>

    <!--para>The <command>arpd</command> program included in this package will not
    be built since it is dependent on Berkeley DB, which is not installed in
    LFS. However, a directory for <command>arpd</command> and a man page will still 
    be installed. Prevent this by running the commands below. 
    If the <command>arpd</command> binary is needed,
    instructions for compiling Berkeley DB can be found in the BLFS Book at
    <ulink url="&blfs-book;server/databases.html#db"/>.
    </para-->
    <para>该软件包中的 <command>arpd</command> 程序依赖于 LFS 不安装的
		Berkeley DB，因此不会被构建。然而，用于 <command>arpd</command>
		的一个目录和它的 man 页面仍会被安装，运行以下命令以防止它们的安装。
		如果需要使用 <command>arpd</command> 二进制程序，
		参考 BLFS 手册中的 Berkeley DB 编译说明，它位于
		<ulink url="&blfs-book;server/databases.html#db"/>。
	</para>

<screen><userinput remap="pre">sed -i /ARPD/d Makefile
rm -fv man/man8/arpd.8</userinput></screen>

	<para>还需要禁用两个需要
		<ulink url="&blfs-book;postlfs/iptables.html"/> 的模块：</para>

<screen><userinput remap="pre">sed -i 's/.m_ipt.o//' tc/Makefile</userinput></screen>

    <para>编译该软件包：</para>

<screen><userinput remap="make">make</userinput></screen>

    <para>该软件包没有能够工作的测试套件。</para>
<!-- currently not useful, no tests actually run
    <para>This package comes with a test suite, but due to assumptions it makes,
    it is not possible to reliably run these tests from within the chroot
    environment. If you wish to run these tests after booting into your new LFS
    system, ensure you enable <filename>/proc/config.gz</filename> support
    in your kernel (&quot;General setup&quot; -> &quot;Enable access to
    .config through /proc/config.gz&quot; [CONFIG_IKCONFIG_PROC]), then run
    'make alltests' from the <filename class="directory">testsuite/</filename>
    subdirectory.</para>-->

    <para>安装该软件包：</para>

<screen><userinput remap="install">make DOCDIR=/usr/share/doc/iproute2-&iproute2-version; install</userinput></screen>

  </sect2>

  <sect2 id="contents-iproute2" role="content">
    <title>IPRoute2 的内容</title>

    <segmentedlist>
      <segtitle>安装的程序</segtitle>
      <segtitle>安装的目录</segtitle>

      <seglistitem>
        <seg>bridge, ctstat (到 lnstat 的链接), genl, ifcfg, ifstat, ip, lnstat,
        nstat, routef, routel, rtacct, rtmon, rtpr, rtstat (到 lnstat 的链接), ss,
        以及 tc</seg>
        <seg>/etc/iproute2, /usr/lib/tc, 以及 /usr/share/doc/iproute2-&iproute2-version;,
        </seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">简要描述</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="bridge">
        <term><command>bridge</command></term>
        <listitem>
          <para>配置网桥</para>
          <indexterm zone="ch-system-iproute2 bridge">
            <primary sortas="b-bridge">bridge</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ctstat">
        <term><command>ctstat</command></term>
        <listitem>
          <para>连接状态工具</para>
          <indexterm zone="ch-system-iproute2 ctstat">
            <primary sortas="b-ctstat">ctstat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="genl">
        <term><command>genl</command></term>
        <listitem>
          <para>通用网络连接工具前端</para>
          <indexterm zone="ch-system-iproute2 genl">
            <primary sortas="b-genl">genl</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ifcfg">
        <term><command>ifcfg</command></term>
        <listitem>
          <para>一个封装 <command>ip</command> 命令的脚本
          [注意它需要 <command>arping</command> 和
          <command>rdisk</command> 程序，它们来自于
		  iputils 软件包，可以在
		  <ulink url="http://www.skbuff.net/iputils/"/>找到。]</para>
          <indexterm zone="ch-system-iproute2 ifcfg">
            <primary sortas="b-ifcfg">ifcfg</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ifstat">
        <term><command>ifstat</command></term>
        <listitem>
          <para>显示网络接口统计，包括接口上发送和接收的数据包数量</para>
          <indexterm zone="ch-system-iproute2 ifstat">
            <primary sortas="b-ifstat">ifstat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ip">
        <term><command>ip</command></term>
        <listitem>
          <para>该软件包的主程序，包含以下不同的功能：</para>

          <para><command>ip link <replaceable>&lt;device&gt;</replaceable></command>
          允许用户查看和修改设备状态</para>

          <para><command>ip addr</command> 允许用户查看网络地址及其属性，
          添加新地址或删除旧地址</para>
	  
          <para><command>ip neigh</command> 允许用户查看 ARP
			  近邻绑定及其属性，增加新近邻项，或删除旧项</para>

          <para><command>ip rule</command> 允许用户查看或修改路由策略</para>

          <para><command>ip route</command>
          	  允许用户查看路由表或修改路由表规则</para>

          <para><command>ip tunnel</command> 允许用户查看 IP 隧道及其属性，
          或修改它们</para>

          <para><command>ip maddr</command> 允许用户查看多播地址及其属性，
          或修改它们</para>

          <para><command>ip mroute</command> 允许用户设定、
          	  修改或删除多播路由</para>

		  <para><command>ip monitor</command> 允许用户连续地监视设备、
		  	  地址和路由的状态</para>
          <indexterm zone="ch-system-iproute2 ip">
            <primary sortas="b-ip">ip</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="lnstat">
        <term><command>lnstat</command></term>
        <listitem>
          <para>提供 Linux 网络统计；它是旧的<command>rtstat</command>
          的更通用、功能更完备的替代品</para>
          <indexterm zone="ch-system-iproute2 lnstat">
            <primary sortas="b-lnstat">lnstat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="nstat">
        <term><command>nstat</command></term>
        <listitem>
          <para>显示网络统计</para>
          <indexterm zone="ch-system-iproute2 nstat">
            <primary sortas="b-nstat">nstat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="routef">
        <term><command>routef</command></term>
        <listitem>
          <para><command>ip route</command> 的一个组件。用于刷新路由表
          </para>
          <indexterm zone="ch-system-iproute2 routef">
            <primary sortas="b-routef">routef</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="routel">
        <term><command>routel</command></term>
        <listitem>
          <para><command>ip route</command> 的一个组件。用于显示路由表
          </para>
          <indexterm zone="ch-system-iproute2 routel">
            <primary sortas="b-routel">routel</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rtacct">
        <term><command>rtacct</command></term>
        <listitem>
          <para>显示
          <filename>/proc/net/rt_acct</filename> 的内容</para>
          <indexterm zone="ch-system-iproute2 rtacct">
            <primary sortas="b-rtacct">rtacct</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rtmon">
        <term><command>rtmon</command></term>
        <listitem>
          <para>路由监视工具</para>
          <indexterm zone="ch-system-iproute2 rtmon">
            <primary sortas="b-rtmon">rtmon</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rtpr">
        <term><command>rtpr</command></term>
        <listitem>
          <para>将 <command>ip -o</command> 的输出转换为可读形式</para>
          <indexterm zone="ch-system-iproute2 rtpr">
            <primary sortas="b-rtpr">rtpr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rtstat">
        <term><command>rtstat</command></term>
        <listitem>
          <para>路由状态工具</para>
          <indexterm zone="ch-system-iproute2 rtstat">
            <primary sortas="b-rtstat">rtstat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ss">
        <term><command>ss</command></term>
        <listitem>
          <para>与 <command>netstat</command> 命令相似；显示活动连接</para>
          <indexterm zone="ch-system-iproute2 ss">
            <primary sortas="b-ss">ss</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tc">
        <term><command>tc</command></term>
        <listitem>
          <para>流量管制可执行程序；用于实现服务质量（QOS）和服务类型（COS)
          协议</para>

          <para><command>tc qdisc</command> 允许用户设定排队规则</para>

          <para><command>tc class</command>
          	  允许用户设定基于排队规则调度的调度类</para>

          <para><command>tc estimator</command> 允许用户预计进入网络的流量
          </para>

          <para><command>tc filter</command> 允许用户设定 QOS/COS 数据包过滤
          </para>

		  <para><command>tc policy</command> 允许用户设定 QOS/COS
		  	  策略</para>
          <indexterm zone="ch-system-iproute2 ss">
            <primary sortas="b-tc">tc</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
