CentOS에서 netstat 사용하는방법

2021. 9. 14. 15:08리눅스

반응형

Ubuntu에서 확인하던것과 동일하게 그냥 netstat 명령어로 포트나 여러가지 상태를 확인하고자 했는데 안되더라..

그래서 netstat를 사용하는방법을 찾아봤더니 

net-tools프로그램을 설치 해야지 동일하게 사용이 가능했다!

yum -y install net-tools

 

no package netstat available centos 7

netstat Command not found on CentOS 7 / RHEL 7 – Quick Fix

By Raj Last updated Oct 6, 2019

 0

 Share

netstat Command not found on CentOS 7

netstat is a command-line utility to view the statistics of network connection to/from the machines. With netstat, you can see network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

Are you wondering? netstat command not found after the installation of CentOS 7 / RHEL 7.

READ: CentOS 7 installation – Step by Step with screenshot – Part 1

READ: CentOS 7 installation – Step by Step with screenshot – Part 2

-bash: netstat: command not found

This small guide will help you to install the necessary packages for getting netstat command.

Let us see which package provides us with the netstat command.

yum whatprovides netstat

Output:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.chi.host-engine.com
 * epel: mirror.steadfast.net
 * extras: repo.us.bigstepcloud.com
 * updates: centos.chi.host-engine.com
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo        : base
Matched from:
Filename    : /bin/netstat

From the above command, you can see that the net-tools package provides you netstat command. So, install the net-tools package using the yum command.

yum -y install net-tools

Output:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.chi.host-engine.com
 * epel: mirror.steadfast.net
 * extras: repo.us.bigstepcloud.com
 * updates: centos.chi.host-engine.com
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

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

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

Total download size: 304 k
Installed size: 917 k
Downloading packages:
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm                                                                                                                                | 304 kB  00:00:00    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.17.20131004git.el7.x86_64                                                                                                                                        1/1
  Verifying  : net-tools-2.0-0.17.20131004git.el7.x86_64                                                                                                                                        1/1

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

Complete!

Once the installation is complete, run netstat to see whether it is available or not.

netstat

Output:

netstat Command not found on CentOS 7 – netstat command output

 

출처: <https://www.itzgeek.com/how-tos/mini-howtos/netstat-command-not-found-on-centos-7-rhel-7-quick-fix.html>

반응형