CentOS7 安装ifconfig
As we all know, “ifconfig” command is used to configure a network interfaces in GNU/Linux systems. It displays the details of a network interface card like IP address, MAC Address, and the status of a network interface card etc. But, this command is obsolete, and is not found in the minimal versions of RHEL 7 and its clones like CentOS 7, Oracle Linux 7, and Scientific Linux 7.
How do I find IP and other details of a network interface In CentOS Minimal server?
CentOS 7 minimal systems, use the commands “ip addr” and “ip link” to find the details of a network interface card. To know the statistics use “ip -s link”.
To view the details of the network interface cards, enter the following commands:
ip addr
Sample output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/void
inet 127.0.0.1/32 scope host venet0
inet 192.168.1.101/32 brd 192.168.1.101 scope global venet0:0
To view the statistics of your network interfaces, enter the command:
ip link
Sample output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT
link/void
OR
ip -s link
Sample output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT
link/void
RX: bytes packets errors dropped overrun mcast
8515667 6667 0 0 0 0
TX: bytes packets errors dropped carrier collsns
300403 4249 0 0 0 0
How do I enable and use “ifconfig” Command in CentOS 7 minimal servers?
If you don’t know where to find the ifconfig command, follow the simple steps provided below. First let us find out which packages will provide ifconfig command. To do that , enter the following command:
yum provides ifconfig
Sample Output:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.aol.in
* extras: centos.aol.in
* updates: centos.aol.in
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo : @base
Matched from:
Filename : /usr/sbin/ifconfig
Or you can use the following command too.
yum whatprovides ifconfig
Here, “provides” or “whatprovides” switches are used to find out which package provides some feature or file.
As you see in the above output, the net-tools package provides the ifconfig command. So, let us install net-tools package to use ifconfig command.
yum install net-tools
Now, you’ll be able to use the command ifconfig as usual.
ifconfig -a
Sample output:
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 venet0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500
inet 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0 destination 127.0.0.1
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
RX packets 7073 bytes 8549159 (8.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4611 bytes 359201 (350.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 venet0:0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500
inet 192.168.1.101 netmask 255.255.255.255 broadcast 192.168.1.101 destination 192.168.1.101
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
Enjoy!
CentOS7 安装ifconfig的更多相关文章
- centos7安装ifconfig命令
ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等命令,这时候你进入终端,运行ifc ...
- centos7安装ifconfig
1,找出哪个包提供了ifconfig命令 yum provides ifconfig 2,通过输出,发现是net-tools提供了ifconfig命令 yum install net-tools
- centos7 更新源 安装ifconfig
centos7最小化安装后,ifconfig是不可用的,可以使用ip addr或ip link查看网络信息. 更新源之前,先确定网络是否连通.我用的虚拟机,因为桥接受公司ip限制,换成了NAT模式,确 ...
- VMware下CentOS7安装后,还原虚拟网络后,敲ifconfig不显示局域网ip解决方法
VMware下CentOS7安装后,还原虚拟网络后,敲ifconfig不显示局域网ip,没有出现eth0网卡,不能上网,SSH不能连接,输入ifconfig后如下图: 解决方法: 1.编辑网卡的配置文 ...
- centos7中没有安装ifconfig命令的解决方法
初装centos 7时,运行config报 command not found 错误,我在网上找了大量资料,下面的资料中查找原因和解决方式最详细,能很好的解决这个问题. ifconfig命令是设置或显 ...
- centos7没有安装ifconfig命令的解决方法
ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等命令,这时候你进入终端,运行ifc ...
- centos7没有安装ifconfig命令的解决方法(转)
ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等命令,这时候你进入终端,运行ifc ...
- CentOS7安装问题及解决方案记录
CentOS7系统已安装好: 一.我想要实现系统桌面化. 需要运行 yum 命令. 出现第一个error: 1.提示错误:can not find a valid baseurl 86_X64.... ...
- centos7 安装步骤
这里选择64位 32位没有找到网卡... 注:这里是网络类型分配,网络类型分配分为三种,Bridge,NAT和Host-Only,大概区别是 1 BRIDGE 桥接:相当于主机和虚拟机连接到同一个h ...
随机推荐
- Linux一键安装web环境全攻略(阿里云ECS服务器)
摘自阿里云服务器官网,此处 一键安装包下载: 点此下载 安装须知 1.此安装包可在阿里云所有linux系统上部署安装,此安装包包含的软件及版本为: nginx:1.0.15.1.2.5.1.4.4 a ...
- less本地环境输出hello-world
在学任何东西之前, 我就是有个习惯, 先搞定这个东西最最简单的使用方法. 然后在 深入学习, 毫无疑问hello-world一直是那么简单. 准备环境 较新版的高级浏览器. WAMP环境. less. ...
- python中self cls init的理解
原创文章,未经允许禁止转载! python中self cls init的理解 python中self cls init的理解
- C# 并行 反射 去掉实体属性多余空格
有时会遇到很多不合理的数据附件到实体后有大量空格需要处理,这里提供一个方法,通过并行反射的方式高效清理空格. Code: //清除字符串空格 public static object ...
- service 需要注意的地方
@service标记的class,只能用于标记了@controller的类,用于其他的会出错 mybatis查询查询到返回记录,查询不到返回null
- 从零到一创建ionic移动app:创建第一个app
新建一个空项目,让它能够在你的虚拟机/手机上跑起来 第一步 新建工程 ionic start myApp blank 一个简单的Web应用我们已经创建完成了,接下来我们就要做一些部署到移动端之前的 ...
- 执行用例,并生成报告——discover,HTMLRunner
HTMLRunner需要下载Python3的格式,懒人链接:http://pan.baidu.com/s/1tp3Ts 参考:http://bbs.chinaunix.net/thread-41547 ...
- Loopback接口的作用
Loopback接口是虚拟接口,是一种纯软件性质的虚拟接口.任何送到该接口的网络数据报文都会被认为是送往设备自身的.大多数平台都支持使用这种接口来模拟真正的接口.这样做的好处是虚拟接口不会像物理接口那 ...
- MPU6050工作原理及STM32控制MPU6050
源:MPU6050工作原理及STM32控制MPU6050 MPU6050 介绍
- Dubbo与微服务
http访问到服务器要经过的内容:Nginx —Tomcat –db,nginx就是一个负载均衡左右.又一次面试问到了我nginx的反向代理.现在想了想面试官要问的应该是 域名的反向代理,就是使用一个 ...