Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | www.huuphan.com

This Blog is protected by DMCA.com

huuphan.com. Powered by Blogger.

netstat command not found in CentOS 7 / RHEL 7

Netstat command is tool to check the network configure and activity. The default centos 7 and RHEL 7 not found netstat command.

How to use netstat command on Centos 7 and RHEL 7

To find out which package provides "netstat" command.

yum provides */netstat
Or
yum whatprovides */netstat

The output screen as below
net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo        : @base
Matched from:
Filename    : /bin/netstat

Install netstat command

# yum install net-tools


The output screen as below:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.jaist.ac.jp
 * epel: mirror.ehost.vn
 * extras: ftp.jaist.ac.jp
 * updates: ftp.jaist.ac.jp
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.22.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch         Version                          Repository  Size
================================================================================
Installing:
 net-tools       x86_64       2.0-0.22.20131004git.el7         base       305 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 305 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.22.20131004git.el7.x86_64.rpm              | 305 kB   00:01    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.22.20131004git.el7.x86_64                    1/1
  Verifying  : net-tools-2.0-0.22.20131004git.el7.x86_64                    1/1

Installed:
  net-tools.x86_64 0:2.0-0.22.20131004git.el7                                  

Complete!

 The result, netstat command as below
[[email protected] ~]# netstat -nplt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      925/master         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      813/sshd           
tcp6       0      0 :::2233                 :::*                    LISTEN      1338/docker-proxy-c
tcp6       0      0 ::1:25                  :::*                    LISTEN      925/master         
tcp6       0      0 :::2234                 :::*                    LISTEN      2819/docker-proxy-c
tcp6       0      0 :::33306                :::*                    LISTEN      2809/docker-proxy-c
tcp6       0      0 :::8443                 :::*                    LISTEN      1328/docker-proxy-c
tcp6       0      0 :::8080                 :::*                    LISTEN      956/java           
tcp6       0      0 :::22                   :::*                    LISTEN      813/sshd           
tcp6       0      0 :::8888                 :::*                    LISTEN      1318/docker-proxy-c

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command | www.huuphan.com