sanyk's Blog

Happy coding

ifconfig man 手册页的详细中文翻译

sanyk posted @ 2010年2月03日 01:56 in linux man 文档翻译 with tags ifconfig man ifconfig linux man 文档翻译 , 16169 阅读

原文地址
=========
以下是本文档完整版本地址:http://sanyk.is-programmer.com/posts/15344
(nt: 出现这一提示是为了避免一些网络蜘蛛把文章分成几个页面给查看带来不悦)

 

中文版

========

 IFCONFIG(8)        Linux 程序员参考手册         IFCONFIG(8)
 
 
NAME
       ifconfig - 配置网络接口
 
 
用法概览
       ifconfig [-v] [-a] [-s] [interface]
       ifconfig [-v] interface [aftype] options | address
 


描述
       Ifconfig 可用来配置由内核支持的网络接口.
       在系统启动时可根据需要使用ifconfig 来配置网络接口,系统启动之后,通常只有在网络调试或系统调整的时候
       才会用到ifconfig.
 
       如果启动时不带参数, ifconfig 会显示当前系统中所有活跃的网络接口的状态. 如果启动时的参数为单一的
       网络接口名字, ifconfig 只会显示指定的网络接口的状态; 而如果指定的参数为 -a, ifconfig 会显示所有
       网络的状态, 甚至包括不活跃的网络接口. 对于其他参数形式,ifconfig 会根据这些参数来配置网络接口.
 


地址族
       如果interface 后面的第一个参数是被支持的地址族, 那么此地址族将被用于解析及显示所遇到的各种协议地址.
       目前支持的地址族包括: inet(IP网络,默认网络层协议为ipv4),inet6(IP网络, 但网络层协议为ipv6),
       ax25(分组交换无线电网络), ddp  (Appletalk 网络), ipx (Novell 网络, 网络层采用IPX 协议) and netrom (分组交换无线电网络).
       (nt: 其中 ax25 与 netrom 的区别另需补充)
 


选项
       -a     显示当前所有的网络接口, 包括没有激活的接口
 
       -s     以简短形式显示系统中的网络接口(nt: 与netstat -i 结果一致, 从实际结果来看, 只是显示系统中活跃的网络接口)
 
       -v     出错时会显示更详细的一些信息
 
       interface
              接口的名字. 通常是一个设备名后跟一个编号(nt: unit number, 单元编号, 可理解为 '此设备单元的编号'+,
              即此处的'编号'). 比如, eth0 表示第一个网络接口(nt: 后文所说的'主网络接口', 而后文eth0:0).
              如果内核支持接口别名, 可以用以下方式给接口赋予别名:eth0:0 表示是对eth0 的第一个
              别名. 可按此规则给接口赋予其他的别名. 如果要删除一个别名接口, 比如要删除eth0:0,
              可在终端中输入以下命令:ifconfig eth0:0 down. 注意: 如果把主网络接口(nt: 比如eth0)关闭了,
              其上任何别名接口都将被删除(包括与主网络接口在同一个网段的接口, 也包括不在同一个网段的接口)
 
       up
              这个选项使得该接口被激活. 实际上, 当通过ifconfig 给指定网络接口赋予地址时, 该接口默认被激活.
 
       down
              这个选项使得该接口被停用.
 
       [-]arp
              是否开启该接口上的ARP协议(地址解析协议)相关支持(nt: 如果带有'-'表示不开启, 不带'-'表示开启).
 
       [-]promisc
 
              是否开启网络接口上的混杂监听模式. 如果开启了, 网络上所有数据包都会被此接口截获(nt:
              如果带有'-'表示不开启, 不带'-'表示开启).
 
       [-]allmulti
              开启或关闭接口的多播送模式. 如果开启, 网络上所有的多播数据包都会被接口接收.(nt:
              可理解为, 在IP 网络中, IP地址224.0.0.0至239.255.255.255之间为多播地址(就是D类IP地址),
              源或目的地址在此范围的数据包就是多播数据包, 多播地址可用于同时向网络内一组特定主机发送信息,
              这区别于单播地址(用于向网络内一个特定主机发送信息), 以及广播地址(用于向网络内所有对象发送消息)).
 
       metric N
              此参数可以设置本接口的'代价计数'(nt: metric, 代价计数, 即通常所说'跃点数'.
              可理解为, metric 是对从此接口向外发送数据包的一个代价综合衡量,值越小表示代价越小,
              内核选择路由时会优先考虑从这个接口往外发送数据包. (nt: 辅助理解, 需回看)实际上,
              metric 可被简化理解为, 此接口占用'传输路径中多少个节点',
              通常都是1, 表示占用一个节点. )
 
       mtu N
              此参数用来设置接口的'最大传输单元'的大小(nt: 可用十进制表达, 单位是字节).
 
       dstaddr addr
              把点对点链路上对方的IP 设置为addr. 此关键字现在已被废弃, 可使用pointtopoint 关键字来代替.
 
       netmask addr
 
              设置接口的网络掩码. 接口的默认网络掩码是由接口IP地址类别决定的, 并与相应IP类别对应,分为A, B
              或C类网络掩码.用户通过此选项可将网络掩码设置为指定值.
 
       add addr/prefixlen
              为接口增加一个由addr/prefixlen指定的IPv6网络地址(nt: ipv6 网络地址格式采用addr/prefixlen 表达, 如
              3ffe:ffff:0:f101::1/64, prefixlen 表示其中网络标识部分所占用的长度, 剩下的比特用于标识节点).
 
       del addr/prefixlen
              删除接口上由addr/prefixlen指定的IPv6网络地址(nt: ipv6 网络地址格式采用addr/prefixlen 表达).
 
       tunnel aa.bb.cc.dd
              创建一个SIT 网络接口(nt: SIT, 简单网络转换, Simple Internet Transition).
              即通常所说的IPv6-in-IPv4 隧道网络接口(nt: IPv6-in-IPv4 可理解为,
              在支持ipv4 地址的网络中传输使用ipv6 地址的数据包). 此隧道的对端ipv4地址为aa.bb.cc.dd.
              (nt: 隧道本地端ipv4的地址设置方法未知, 另需补充)
 
       irq addr
              设置此接口所使用的中断线编号.  不是所有接口都能动态改变中断线.(nt: 具体限制未知, 另需补充)
       io_addr addr
              设置此接口所使用的I/O地址空间的起始地址.
       mem_start addr
              设置此接口所使用的共享内存的起始地址, 只是一小部分接口需要这个操作.
 
       media type
              设置网络接口最底层所使用的物理媒介. 不是所有的的网络接口都能改变此选项, 并且不同网络接口
              所支持的type 会有所不同. 典型的type 取值为10base2(细缆以太网, 2代表传播距离是200米),
              10baseT(双绞线10mbps以太网), AUI(nt: 对应的传输媒质为粗同轴电缆, 在令牌环网中使用), 等等.
              有一个特殊的取值为auto, 其含义为: 网络接口将自动识别所在的物理媒质类型. 同样,
              这不是所有的网络接口都支持自动识别.
 
       [-]broadcast [addr]
              如果给定 addr参数, 可以设置网络接口的广播地址(nt: 此时不带-). 如果不给定addr 参数,
              此选项可用来设置或者清除接口的IFF_BROADCAST标志(nt: 加-表示清除, 不加-表示设置
 
       [-]pointopoint [addr]
              此关键字可用来开启网络接口的点对点模式.
              这通常意味着, 两台机器之间通过接口进行直接连接(nt : 接口底层可通过多种方式, 比如SLIP(串口),
              PLIP(并口)方式, 这需要特定驱动程序的支持), 并没有其他人可对此连接进行监听.
 
              如果给定addr, 可设置连接对方的地址, 这也是被废弃使用的关键字dstaddr 所实现的功能.
              如果不给定addr 参数, 此选项可用来设置或者清除接口的IFF_POINTOPOINT标志
              (nt: 加-表示清除, 不加-表示设置).
 
       hw class address
              设置网络接口的物理地址(前提是设备驱动程序支持此操作). 关键字hw 之后为class, 其后紧随ascii码表示的
              相应物理类型的address. 目前支持的硬件地址类型包括ether(以太网),
              ax25(nt | rt: 分组交换无线电网络, 需补充), ARCnet(nt | rt: 未知, 需补充),
              netrom(nt | rt: 分组交换无线电网络) .
 
       multicast
              设置网络接口的多播标志. 一般不需要更改网络接口的此标志, 其驱动程序会自动对其进行配置.
 
       address
              表示为此网络接口指定的IP 地址.
 
       txqueuelen length
              设置网络接口的发送队列的长度. 对于建立在慢速网络设备上的网络接口(如建立在猫或ISDN卡上的接口(nt:
              ISDN接口卡, 综合业务数据网络接口卡)), 设置较小的length 值可防止快速传输数据的应用程序对需要经常
              与用户交互数据的应用造成过大延迟. 


注意
       自2.2版内核以后, ifconfig 不再对别名网络接口单独地显示其统计信息(nt: 如接收到的数据包, 发送的数据包等).
       所有别名网络接口的统计信息都来源于对应的原始网络接口. 如果想要得到这些别名网络接口的单独统计信息,
       需要通过ipchains(8) 或者 iptables(8)命令来为此别名网络接口所对应的网络地址添加计数规则.
 
       以太网络接口驱动程序的中断处理程序中会产生一些错误, 并且返回错误编号为EGAIN(并提示为:SIOCSIIFLAGS:
       Resource  temporarily unavailable(资源暂时不可用). nt: SIOCSIIFLAGS 含义未知, 需补充).
       这很有可能是由于中断冲突造成的. 可以通过http://www.scyld.com/expert/irq-conflict.html获取更多信息.
 
 
相关文件
       /proc/net/socket
       /proc/net/dev
       /proc/net/if_inet6
 


已知缺陷
       不能正确修改给定的appletalk DDP 和 IPX 网络地址(nt: 前者可理解为appletalk 网络中的网络层协议, 后者
       可理解为novell 网络中的网络层协议, 都与tcp/ip 网络中的ip 网络层相对应, 并且都有自己的网络地址格式).
 
 
相关参考
       route(8), netstat(8), arp(8), rarp(8), ipchains(8), iptables(8), ifup(8), interfaces(5).
       http://physics.nist.gov/cuu/Units/binary.html - 各种2乘幂的首字母表达.(nt: 可理解为对多种数量级别
       的2次方的字母描述, 如Ki 表示 2的10次方, Mi 表示 2的20次方)
 
作者
       Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
       Alan Cox, <Alan.Cox@linux.org>
       Phil Blundell, <Philip.Blundell@pobox.com>
       Andi Kleen
       Bernd Eckenfels, <net-tools@lina.inka.de>
 
net-tools                                          2007-12-02                                       IFCONFIG(8)
 

 

英文版

========

IFCONFIG(8)                                Linux Programmer's Manual                                IFCONFIG(8)



NAME
       ifconfig - configure a network interface

SYNOPSIS
       ifconfig [-v] [-a] [-s] [interface]
       ifconfig [-v] interface [aftype] options | address ...

DESCRIPTION
       Ifconfig is used to configure the kernel-resident network interfaces.  It is used at boot time to set up
       interfaces as necessary.  After that, it is usually only needed when debugging or when system tuning  is
       needed.

       If no arguments are given, ifconfig displays the status of the currently active interfaces.  If a single
       interface argument is given, it displays the status of the given interface only; if a single -a argument
       is  given, it displays the status of all interfaces, even those that are down.  Otherwise, it configures
       an interface.


Address Families
       If the first argument after the interface name is recognized as the name of a supported address  family,
       that  address  family  is  used for decoding and displaying all protocol addresses.  Currently supported
       address families include inet (TCP/IP, default), inet6 (IPv6), ax25 (AMPR Packet Radio), ddp  (Appletalk
       Phase 2), ipx (Novell IPX) and netrom (AMPR Packet radio).

OPTIONS
       -a     display all interfaces which are currently available, even if down

       -s     display a short list (like netstat -i)

       -v     be more verbose for some error conditions

       interface
              The  name of the interface.  This is usually a driver name followed by a unit number, for example
              eth0 for the first Ethernet interface. If your kernel supports alias interfaces, you can  specify
              them  with  eth0:0  for  the first alias of eth0. You can use them to assign a second address. To
              delete an alias interface use ifconfig eth0:0 down.  Note: for every scope (i.e.  same  net  with
              address/netmask combination) all aliases are deleted, if you delete the first (primary).

       up     This  flag  causes  the  interface  to be activated.  It is implicitly specified if an address is
              assigned to the interface.

       down   This flag causes the driver for this interface to be shut down.

       [-]arp Enable or disable the use of the ARP protocol on this interface.

       [-]promisc
              Enable or disable the promiscuous mode of the interface.  If selected, all packets on the network
              will be received by the interface.

       [-]allmulti
              Enable  or disable all-multicast mode.  If selected, all multicast packets on the network will be
              received by the interface.

       metric N
              This parameter sets the interface metric.

       mtu N  This parameter sets the Maximum Transfer Unit (MTU) of an interface.

       dstaddr addr
              Set the remote IP address for a point-to-point link (such as PPP).  This keyword is now obsolete;
              use the pointopoint keyword instead.

       netmask addr
              Set  the  IP  network  mask for this interface.  This value defaults to the usual class A, B or C
              network mask (as derived from the interface IP address), but it can be set to any value.

       add addr/prefixlen
              Add an IPv6 address to an interface.

       del addr/prefixlen
              Remove an IPv6 address from an interface.

       tunnel aa.bb.cc.dd
              Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.

       irq addr
              Set the interrupt line used by this device.  Not all devices can  dynamically  change  their  IRQ
              setting.

       io_addr addr
              Set the start address in I/O space for this device.

       mem_start addr
              Set the start address for shared memory used by this device.  Only a few devices need this.

       media type
              Set  the  physical port or medium type to be used by the device.  Not all devices can change this
              setting, and those that can vary in what values  they  support.   Typical  values  for  type  are
              10base2  (thin  Ethernet), 10baseT (twisted-pair 10Mbps Ethernet), AUI (external transceiver) and
              so on.  The special medium type of auto can be used to tell the driver to auto-sense  the  media.
              Again, not all drivers can do this.

       [-]broadcast [addr]
              If  the address argument is given, set the protocol broadcast address for this interface.  Other-
              wise, set (or clear) the IFF_BROADCAST flag for the interface.

       [-]pointopoint [addr]
              This keyword enables the point-to-point mode of an interface, meaning that it is  a  direct  link
              between two machines with nobody else listening on it.
              If  the  address  argument is also given, set the protocol address of the other side of the link,
              just like the obsolete dstaddr keyword does.  Otherwise, set or clear  the  IFF_POINTOPOINT  flag
              for the interface.

       hw class address
              Set  the  hardware  address of this interface, if the device driver supports this operation.  The
              keyword must be followed by the name of the hardware class and the printable ASCII equivalent  of
              the  hardware address.  Hardware classes currently supported include ether (Ethernet), ax25 (AMPR
              AX.25), ARCnet and netrom (AMPR NET/ROM).

       multicast
              Set the multicast flag on the interface. This should not normally be needed as  the  drivers  set
              the flag correctly themselves.

       address
              The IP address to be assigned to this interface.

       txqueuelen length
              Set  the length of the transmit queue of the device. It is useful to set this to small values for
              slower devices with a high latency (modem links, ISDN) to prevent fast bulk transfers  from  dis-
              turbing interactive traffic like telnet too much.

NOTES
       Since  kernel  release  2.2 there are no explicit interface statistics for alias interfaces anymore. The
       statistics printed for the original address are shared with all alias addresses on the same  device.  If
       you  want  per-address  statistics  you  should  add explicit accounting rules for the address using the
       ipchains(8) or iptables(8) command.

       Interrupt problems with Ethernet device drivers fail with  EAGAIN  (SIOCSIIFLAGS:  Resource  temporarily
       unavailable)  it  is most likely a interrupt conflict. See http://www.scyld.com/expert/irq-conflict.html
       for more information.

FILES
       /proc/net/socket
       /proc/net/dev
       /proc/net/if_inet6

BUGS
       While appletalk DDP and IPX addresses will be displayed they cannot be altered by this command.

SEE ALSO
       route(8), netstat(8), arp(8), rarp(8), ipchains(8), iptables(8), ifup(8), interfaces(5).
       http://physics.nist.gov/cuu/Units/binary.html - Prefixes for binary multiples

AUTHORS
       Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
       Alan Cox, <Alan.Cox@linux.org>
       Phil Blundell, <Philip.Blundell@pobox.com>
       Andi Kleen
       Bernd Eckenfels, <net-tools@lina.inka.de>



net-tools                                          2007-12-02                                       IFCONFIG(8)
 

 

符号约定
========
 
越少越好(目前只有一个):
nt:  即note的缩写, 表示翻译时的补充说明部分

 


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter