| 
                            
 就像我们所知道的,“ifconfig”命令用于配置GNU/Linux系统的网络接口。它显示网络接口卡的详细信息,包括IP地址,MAC地址,以及网络接口卡状态之类。但是,该命令已经过时了,而且在最小化版本的RHEL 7以及它的克隆版本CentOS 7,Oracle Linux 7和Scientific Linux 7中也找不到该命令。  
 
 在CentOS最小化服务器版本中如何查找网卡IP和其它详细信息? 
 CentOS 7最小化系统,使用“ip addr”和“ip link”命令来查找网卡详情。要知道统计数据,可以使用“ip -s link”。  
 要查看网卡细节,输入以下命令:  
 
 
  
  - ip addr
 
 
    
 输出样例:  
  
   1: lo <LOOPBACK,UPLOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
  
   link/loopback 00:00 brd 00
  
   inet 127.0.0.1/8 scope host lo
  
   inet6 ::128 scope host 
  
   valid_lft forever preferred_lft forever
  
  2 venet0BROADCASTPOINTOPOINTNOARP1500 qdisc noqueue state UNKNOWN 
  
  /void 
  
  32 scope host venet0
  
  192.1681.1011.101 scope global0
 
  
 要查看网络接口统计数据,输入命令:  
link
 
   
 qdisc noqueue state UNKNOWN mode DEFAULT 
  
   00
  
   qdisc noqueue state UNKNOWN mode DEFAULT 
  
  void
 
  
 或者  
-s  RX bytes packets errors dropped overrun mcast 
  
    0 
  
   TX bytes packets errors dropped carrier collsns 
  
   
  
   qdisc noqueue state UNKNOWN mode DEFAULT 
  
   
  
   bytes packets errors dropped overrun mcast 
  
  85156676667 
  
   bytes packets errors dropped carrier collsns 
  
  30040342490
 
  
 在CentOS 7最小化服务器版本中如何启用并使用“ifconfig”命令? 
 如果你不知道在哪里可以找到ifconfig命令,请按照以下简单的步骤来找到它。首先,让我们找出哪个包提供了ifconfig命令。要完成这项任务,输入以下命令:  
yum provides ifconfig
 
   
  
   Loaded plugins fastestmirror
  
  Loading mirror speeds from cached hostfile
  
  * base centos.aol.in
  
   extrasin
  
   updatesin
  
  nettools-2.00.1720131004gitel7x86_64  Basic networking tools
  
  Repo@base
  
  Matchedfrom:
  
  Filename /usr/sbin 或者你也可以使用以下命令。 
 whatprovides  这里,“provides”或者“whatprovides”开关用于找出某个包提供了某些功能或文件。 
 就像你在上面的输出中所看到的,net-tools包提供了ifconfig命令。因此,让我们安装net-tools包来使用ifconfig命令。  
 install nettools  
 
  
 现在,你就可以像以往一样使用ifconfig命令了。  
ifconfiga
 
   
  
   lo flags=73RUNNING16436
  
  0.1 netmask 255.00.0
  
  1 prefixlen  scopeid 0x10host>
  
   loop txqueuelen (LocalLoopback)
  
   RX packets  bytes (0.0 B)
  
   RX errors  dropped  overruns  frame 0
  
   TX packets )
  
   TX errors  carrier  collisions 0
  
  
  
  venet02111500
  
  255.255255.255 broadcast 0.0 destination 0.1
  
   unspec  txqueuelen (UNSPEC)
  
  707385491598.1MiB)
  
  0
  
  4611359201350.7KiB
  
  01500
  
  1.101
  
  )
 
  
 尽情享受吧!                         (编辑:莱芜站长网) 
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! 
                     |