CentOS 7&8 没有ifconfig命令

CentOS 7 & 8 最小化安装,没有ifconfig ,netstat 命令

我们可以直接使用下列命令安装

CentOS 7 & CentOS 8

yum install -y net-tools

CentOS 8

dnf install -y net-tools

ifconfig

[root@localhost ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.1.1.233  netmask 255.255.254.0  broadcast 10.86.1.255
        inet6 fe80::63f0:a292:5d15:8166  prefixlen 64  scopeid 0x20<link>
        ether 00:15:5d:0c:31:0c  txqueuelen 1000  (Ethernet)
        RX packets 121218  bytes 16065578 (15.3 MiB)
        RX errors 0  dropped 1112  overruns 0  frame 0
        TX packets 769  bytes 442919 (432.5 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 206  bytes 12180 (11.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 206  bytes 12180 (11.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost ~]# 

netstat命令

[root@localhost ~]# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      894/sshd            
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      917/zabbix_agentd   
tcp6       0      0 :::80                   :::*                    LISTEN      904/httpd           
tcp6       0      0 :::22                   :::*                    LISTEN      894/sshd            
tcp6       0      0 :::10050                :::*                    LISTEN      917/zabbix_agentd   
tcp6       0      0 :::3306                 :::*                    LISTEN      992/mysqld          
udp        0      0 127.0.0.1:323           0.0.0.0:*                           881/chronyd         
udp6       0      0 ::1:323                 :::*                                881/chronyd         
[root@localhost ~]# 

Was this article helpful?

Related Articles