-
2021-08-17 15:52:37
问题描述:在Vmware中装完centos虚拟机后想用FinalShell连接搭建好的虚拟机,但是无法使用ifconfig命令查询虚拟机IP,ifconfig命令提示commend not found。
问题分析:因为centos包内没有安装ifconfig包,所以我们可以通过yum命令来安装。
解决方案:使用yum search ifconfig 可以发现ifconfig命令在哪个包内;
我们知道ifconfig在net-tools.x86_64,所以(1)只需输入yum install net-tools.x86_64安装这个包就行了。安装过程中会需要确认,(2)全程输入y点击回车即可。
更多相关内容 -
解决安装centOS7无法使用ifconfig命令问题
2021-10-17 11:07:43今天安装了一个centOS7主要打算用来搭建RocketMq集群,安装成功后发现无法使用ifconfig命令查看网络信息。 解决办法如下 1.使用命令进入网络配置文件夹下 cd /etc/sysconfig/network-script/ eth0后面的编号可能不...今天安装了一个centOS7主要打算用来搭建RocketMq集群,安装成功后发现无法使用ifconfig命令查看网络信息。
解决办法如下
1.使用命令进入网络配置文件夹下cd /etc/sysconfig/network-script/
eth0后面的编号可能不相同
2. 编辑ifcfg-eth0 文件,将属性reboot的值由no改成yes
保存,然后使用下面命令重启网络service network restart
- 下载网络工具包
yum -y install wget yum install net-tools
安装成功之后就可以用了
-
CentOs7无法使用ifconfig命令,无法查看ip地址
2018-05-22 10:56:46原文地址:https://www.biaodianfu.com/centos-7-network-problem.htmlCentOS 发布已经...今天抽空在虚拟机上安装了CentOS 7,在安装完成后使用 yum update -y 进行系统更新,返回了错误信息:1234567891011121...原文地址:https://www.biaodianfu.com/centos-7-network-problem.html
CentOS 发布已经很久了,由于本次版本变动比较大,特别是systemd的加入,所以先前一直使用的是centos 6.7版本。今天抽空在虚拟机上安装了CentOS 7,在安装完成后使用 yum update -y 进行系统更新,返回了错误信息:
123456789101112131415161718192021222324252627282930313233Loaded plugins : fastestmirror , priorities , securitySetting up Update ProcessDetermining fastest mirrorsCould not retrieve mirrorlist http : //mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was14 : PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"Error : Cannot find a valid baseurl for repo : baseOne of the configured repositories failed ( Unknown ) , and yum doesn 'thave enough cached data to continue. At this point the only safething yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Disable the repository, so yum won' t use it by default . Yum will thenjust ignore the repository until you permanently enable it again or use-- enablerepo for temporary usage :yum - config - manager -- disable < repoid >4. Configure the failing repository to be skipped , if it is unavailable .Note that yum will try to contact the repo . when it runs most commands ,so will have to try and fail each time ( and thus . yum will be be muchslower ) . If it is a very temporary problem though , this is often a nicecompromise :yum - config - manager -- save -- setopt = < repoid > . skip_if_unavailable = trueCannot find a valid baseurl for repo : base / 7 / x86_64 `初步判断是网络问题,使用ifconfig查看下网络信息,但是发现:
1- bash : ifconfig : command not foundifconfig也不能使用了,Google了下发现ifconfig命令已经被ip命令给取代了。具体ip命令的使用方法如下:
123456789101112131415161718ip [选项 ] 操作对象 { link | addr | route . . . }# ip link show # 显示网络接口信息# ip link set eth0 upi # 开启网卡# ip link set eth0 down # 关闭网卡# ip link set eth0 promisc on # 开启网卡的混合模式# ip link set eth0 promisc offi # 关闭网卡的混个模式# ip link set eth0 txqueuelen 1200 # 设置网卡队列长度# ip link set eth0 mtu 1400 # 设置网卡最大传输单元# ip addr show # 显示网卡IP信息# ip addr add 192.168.0.1/24 dev eth0 # 设置eth0网卡IP地址192.168.0.1# ip addr del 192.168.0.1/24 dev eth0 # 删除eth0网卡IP地址# ip route list # 查看路由信息# ip route add 192.168.4.0/24 via 192.168.0.254 dev eth0 # 设置192.168.4.0网段的网关为192.168.0.254,数据走eth0接口# ip route add default via 192.168.0.254 dev eth0 # 设置默认网关为192.168.0.254# ip route del 192.168.4.0/24 # 删除192.168.4.0网段的网关# ip route del default # 删除默认路由按照方法,输入了 ip addr ,发现网卡eno16777736并没有IP地址。既然没有ip地址,那直接去/etc/sysconfig/network-scripts目录中看一下的网卡ip信息的配置文件。
12345678910111213141516171819202122232425262728293031323334[ root @ localhost ~ ] # cd /etc/sysconfig/network-scripts[ root @ localhost network - scripts ] # lltotal 196- rw - r -- r -- . 1 root root 288 Aug 18 22 : 36 ifcfg - eno16777736- rw - r -- r -- . 1 root root 254 Sep 16 2015 ifcfg - lolrwxrwxrwx . 1 root root 24 Aug 18 22 : 48 ifdown -> . . / . . / . . / usr / sbin / ifdown- rwxr - xr - x . 1 root root 627 Sep 16 2015 ifdown - bnep- rwxr - xr - x . 1 root root 5817 Sep 16 2015 ifdown - eth- rwxr - xr - x . 1 root root 781 Sep 16 2015 ifdown - ippp- rwxr - xr - x . 1 root root 4201 Sep 16 2015 ifdown - ipv6lrwxrwxrwx . 1 root root 11 Aug 18 22 : 48 ifdown - isdn -> ifdown - ippp- rwxr - xr - x . 1 root root 1642 Sep 16 2015 ifdown - post- rwxr - xr - x . 1 root root 1068 Sep 16 2015 ifdown - ppp- rwxr - xr - x . 1 root root 837 Sep 16 2015 ifdown - routes- rwxr - xr - x . 1 root root 1444 Sep 16 2015 ifdown - sit- rwxr - xr - x . 1 root root 1462 Sep 16 2015 ifdown - tunnellrwxrwxrwx . 1 root root 22 Aug 18 22 : 48 ifup -> . . / . . / . . / usr / sbin / ifup- rwxr - xr - x . 1 root root 12631 Sep 16 2015 ifup - aliases- rwxr - xr - x . 1 root root 859 Sep 16 2015 ifup - bnep- rwxr - xr - x . 1 root root 11721 Sep 16 2015 ifup - eth- rwxr - xr - x . 1 root root 12039 Sep 16 2015 ifup - ippp- rwxr - xr - x . 1 root root 10430 Sep 16 2015 ifup - ipv6lrwxrwxrwx . 1 root root 9 Aug 18 22 : 48 ifup - isdn -> ifup - ippp- rwxr - xr - x . 1 root root 642 Sep 16 2015 ifup - plip- rwxr - xr - x . 1 root root 1043 Sep 16 2015 ifup - plusb- rwxr - xr - x . 1 root root 2609 Sep 16 2015 ifup - post- rwxr - xr - x . 1 root root 4154 Sep 16 2015 ifup - ppp- rwxr - xr - x . 1 root root 1925 Sep 16 2015 ifup - routes- rwxr - xr - x . 1 root root 3263 Sep 16 2015 ifup - sit- rwxr - xr - x . 1 root root 2682 Sep 16 2015 ifup - tunnel- rwxr - xr - x . 1 root root 1740 Sep 16 2015 ifup - wireless- rwxr - xr - x . 1 root root 4623 Sep 16 2015 init . ipv6 - global- rw - r -- r -- . 1 root root 15376 Aug 3 00 : 15 network - functions- rw - r -- r -- . 1 root root 26134 Sep 16 2015 network - functions - ipv6可以看到network-scripts目录下面的ifcfg-eth0变成了ifcfg-eno16777736。使用cat命令查看下ifcfg-eno16777736的内容:
1234567891011121314151617[ root @ localhost network - scripts ] # cat ifcfg-eno16777736TYPE = EthernetBOOTPROTO = dhcpDEFROUTE = yesPEERDNS = yesPEERROUTES = yesIPV4_FAILURE_FATAL = noIPV6INIT = yesIPV6_AUTOCONF = yesIPV6_DEFROUTE = yesIPV6_PEERDNS = yesIPV6_PEERROUTES = yesIPV6_FAILURE_FATAL = noNAME = eno16777736UUID = ba6856dc - abf2 - 45e4 - 91d6 - 581eddab8d61DEVICE = eno16777736ONBOOT = no从上面的配置中有看到虽然BOOTPROTO=dhcp,但是ONBOOT=no,这里用vi将ONBOOT=no改成ONBOOT=yes,然后重新系统或者重启网络即可:
1systemctl restart network . service原文地址:https://www.biaodianfu.com/centos-7-network-problem.html
-
centos7最小安装后无法使用ifconfig
2019-06-02 17:56:29centos7最小安装后,是没有net-tools的,所以ifconfig是无法是使用的 首先,我们查看一下网络是否处于开启状态。这取决于你在安装是是否开启的网络。 ping一下百度,如果你的系统机器没有连接外网,可以ping一下...centos7最小安装后,是没有net-tools的,所以ifconfig是无法是使用的
首先,我们查看一下网络是否处于开启状态。这取决于你在安装是是否开启的网络。
ping一下百度,如果你的系统机器没有连接外网,可以ping一下内网在中的机器。
ping www.baidu.com无法ping通的,应该是网络服务没有开启
设置开机启动网络服务:在etc/sysconfig/network-scripts/ifcfg-ens33里面将ONBOOT=no改为yes
vi etc/sysconfig/network-scripts/ifcfg-ens33
这里要注意,如果是最小安装,是只有vi的,没有vim
重启
重启后再ping百度就能ping通了
安装vim(可直接跳过)
yum install vim
安装net-tools
yum install net-tools
使用ifconfig,可以补齐,看到熟悉的内容
-
CentOS7最小化安装,无法使用ifconfig命令解决方案_MQ
2021-11-30 17:51:21CentOS7最小化安装,无法使用ifconfig命令解决方案_MQ 一、问题记录: CentOS7最小化安装系统后,会发现执行ifconfig命令,提示命令未找到 二、解决方案 1、使用ip addr命令查看一下网卡配置信息是否分配了IP,... -
最小化安装的centos7,无法使用ifconfig命令
2019-02-01 20:46:25问题:安装centos7最小化系统后,会发现执行ifconfig命令,提示命令未找到。 解决方法: 使用Ip add 查看一下网卡配置信息是否分配了IP,结果显示网络信息未分配 然后我们进入网卡配置文件的目录。执行命令... -
centos7无法使用ifconfig且无法上网
2018-07-09 00:06:06(1)使用ip addr查看网卡分配情况,例如名称为:ens55(2) vi /etc/sysconfig/network-scripts/ifcfg-ens55,将ONBOOT=no 改为 ONBOOT=yes(3)重启网卡:service network restart (4)安装... -
新装centos7无法使用ifconfig
2017-09-04 14:08:17yum install net-tools不可用 先使用 ipaddr命令获取IP 通过SSH Secure File Transfer Client把net-toolsrpm包传输到Linux rpm -ivh *.rpm即可 ifconfig OK 自己做笔记 for myself ... -
Linux-----centOS7中ifconfig不能用
2021-10-15 11:20:21原因:因为安装的是最小化安装,所以没有ifconfig这个命令 解决方法: 1.首先确认是否是环境变量没有ifconfig引起 ls/sbin/ifconfig 如果它提示没有这个包,则进行第二步 2.安装ifconfig yum install ifconfig ... -
CentOS7 配置ifconfig命令的使用
2021-11-22 15:55:11安装centOS7时,使用ifconfig命令,显示不出来,如下图: 解决方案: 方法一:使用ip addr尝试一下 方法二:安装net-tools.x86_64 net-tools.x86_64 查找有没有ifconfig文件 yum search ifconfig yum -y ... -
新安装的CentOS7无法执行ifconfig命令解决办法
2020-08-27 18:42:50解决办法: 查看网卡,并编辑网卡文件ip addr cd /etc/sysconfig/...ifconfig 建议更新一下yum源 yum -y update:升bai级所du有包同时也zhi升级软件和系统内核; yum -y upgrade:只升级所有包,不升级软件. -
CentOs7_安装ifconfig命令
2020-11-20 16:39:08CentOs7_安装ifconfig命令 ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等命令,这时候你进入终端,运行... -
CentOS 7无法使用ifconfig命令修复
2015-05-07 22:25:18如果你不知道在哪里可以找到ifconfig命令,请按照以下简单的步骤来找到它...或者你也可以使用以下命令。 yum whatprovides ifconfig 这里,“provides”或者“whatprovides”开关用于找出某个包提供了某些功能或 -
CentOS 7之ifconfig
2021-10-27 18:19:092. yum install ifconfig, 又报错提示: Cannot find a valid baseurl for repo: base/7/x86_6 3. 修改网络配置文件,vi /etc/sysconfig/network-scripts/ifcfg-ens33,注意标红的位置名称可能会 不一样,我这里是 ... -
CentOS7不能ifconfig查看IP
2020-04-27 22:01:40虚拟机安装CentOS7后使用ifconfig命令查看IP地址时: ifconfig command not found 解决办法: yum install -y net-tools -
CentOS7中:安装ifconfig命令
2021-12-15 10:44:05没有安装ifconfig,无法使用命令。如图示: 查看ifconfig属于哪个软件包 : 安装ifconfig所属的软件包: 验证:ifconfig命令可用 -
Centos7系统出现ifconfig、yum命令不可用问题解决
2022-03-13 22:46:52Centos7刚安装好后,执行ifconfig出现命令无法找到问题,然后使用yum search ifconfig出现错误。其实主要的原因就是网卡没有配置好。这里其实很困惑,Centos6都是默认安装的,到Centos7虽然升级了,但是感觉还没有... -
VMware中的CentOS无法使用ifconfig这个命令
2019-05-25 14:27:021.VMware中安装好CentOS后配置ifconfig时,发现此命令没有。 ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等... -
Centos 7 安装 ifconfig命令
2022-02-12 17:05:14Centos 7在最小化安装时,系统默认没有安装 ifconfig 命令 如果直接运行 ifconfig 命令,会提示 -bash: ifconfig :command not found 运行 yum -y isntall ifconfig 命令时,结果显示: NO package ifconfig ... -
centos7 没有 ifconfig 命令解决办法
2022-01-20 18:12:04centos7 没有 ifconfig 命令解决办法 -
CentOS7没有ifconfig命令解决办法
2021-05-24 09:43:10问题: 输入ifconfig提示command not found: 原因: ifconfig是查看ip信息,Linux最小化安装是没有ifconfig,需要手动安装ifconfig。...提示没有ifconfig安装包,我们再使用yum search ifconfig来搜索下ifconfig的 -
centos7无法使用ifconfig、service、chkconfig等命令时需要安装的包
2016-05-05 23:08:002019独角兽企业重金招聘Python工程师标准>>> ... yum groupinstall base # 安装完后ifconfig、service、chkconfig等命令就都有了 转载于:https://my.oschina.net/jennerlo/blog/670612 -
Centos7 安装ifconfig命令
2020-01-27 09:29:59可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等命令, 这时候你进入终端,运行ifconfig命令就会出错 首先会想到是不是环境变量里没有ifconfig命令的路径,因为ifconfig是在/sbin路径下... -
Centos7使用ifconfig无法获取IPV4
2020-04-09 16:06:35第一步: [root@centos7 ~]# sudo vim /etc/sysconfig/network-scripts/ifcfg-ens33 第二步: 保存一下 ...[root@centos7 ~]# /etc/init.d/network restart ...然后使用ifconfig可以查看到IPV4了 ... -
centos7中输入ifconfig 没有IP地址
2021-07-24 01:16:49vmware中安装centos7 输入ifconfig 后 显示网卡名为ens33 and lo . 并且没有出现ip地址: 解决方法: 1.编辑网卡的配置文件 vi /etc/sysconfig/network-scripts/ifcfg-ens33 将里面的NAME和DEVICE项修改为eth0 [root... -
centos7 下 输入ifconfig 查看不到ip地址解决
2021-01-25 21:12:351.在linux下面打开终端输入:ifconfig 2.查看ens33网卡配置,输入:vi /etc/sysconfig/network-scripts/ifcfg-ens33 将ONBOOT权限改为yes 然后按Esc, 在输入:wq 退出 3.重启网络服务,输入 sudo service network ... -
CentOS7 ifconfig 命令无法使用 -bash: ifconfig: 未找到命令
2020-06-19 13:25:41Linux CentOS7系统 ,-bash: ifconfig: 未找到命令 解决方案 1.执行yum search ifconfig(搜索ifconfig在哪个安装包里面): yum search ifconfig 1.1若遇到下面的错误: 解决方案: vi /etc/resolv.conf 插入下面两行... -
CentOS7执行ifconfig命令无效的解决办法
2021-11-16 21:52:13安装CentOS7后ifconfig无效,你需要安装net-tools 使用命令yum -y install net-tools安装,net-tools工具里带有ifconfig命令,就可以正常使用了 在安装net-tools时有可能会报错:can not find a valid baseurl for ... -
centos不能使用ifconfig命令
2019-05-05 16:16:391.先搜索下版本信息 yum search ifconfig 2.安装对应版本 yum install net-tools.x86_64 -y 3.测试 :ifconfig -
Centos7中的ifconfig、netstat等命令被废弃,解决怎么在centos7中使用centos6的命令
2018-11-19 22:54:11在使用centos7中,首先要查看的是 ifconfig 一下,遗憾的是未找到命令;命令被更换成 ip addr 度娘说,使用以下命令安装回centos6的命令,最后测试; yum provides ifconfig yum whatprovides ifconfig yum install ...