CentOS之——-CentOS 8查看IP报错:bash: ifconfig: command not found

在CentOS8中执行ifconfig查看当前服务器的IP地址时报错,如下所示。

[root@binghe ~]# ifconfig
-bash: ifconfig: command not found

此时,需要执行如下命令安装net-tools工具,如下所示。

yum -y install net-tools

安装成功后,再次输入ifconfig命令即可查看当前服务器的IP地址,如下所示。

[root@binghe ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.175.101  netmask 255.255.255.0  broadcast 192.168.175.255
        inet6 fe80::5fb5:feaa:ee7e:f874  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:73:f0:90  txqueuelen 1000  (Ethernet)
        RX packets 10922  bytes 13205518 (12.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4431  bytes 306191 (299.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (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
发布了1353 篇原创文章 · 获赞 2379 · 访问量 543万+

猜你喜欢

转载自blog.csdn.net/l1028386804/article/details/105479827