netstat в CentOS

Содержание
Introduction
Установка
Пример

Introduction

Установка

Если вы применяете netstat и получаете ошибку

-bash: netstat: command not found

Значит не установлен пакет net-tools, в состав которого входит netstat.

sudo yum install -y net-tools

Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.far.fi * extras: centos.mirror.far.fi * updates: centos.mirror.far.fi Resolving Dependencies --> Running transaction check ---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================== Package Arch Version Repository Size ======================================================================================================================== Installing: net-tools x86_64 2.0-0.25.20131004git.el7 base 306 k Transaction Summary ======================================================================================================================== Install 1 Package Total download size: 306 k Installed size: 917 k Downloading packages: net-tools-2.0-0.25.20131004git.el7.x86_64.rpm | 306 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1 Verifying : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1 Installed: net-tools.x86_64 0:2.0-0.25.20131004git.el7 Complete!

Примеры

Какие порты слушаются

netstat -ltn

Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 ::1:25 :::* LISTEN

Какие сервисы слушают

netstat -lt

Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN tcp6 0 0 [::]:ssh [::]:* LISTEN tcp6 0 0 localhost:smtp [::]:* LISTEN

Article author: Andrei Olegovich

Похожие статьи
Network Configuration в CentOS
Create new interface
CentOS
Networks
ip
hostname
DNS
Firewall
netstat
iftop: Network monitoring
nethogs: Network monitoring
tc: Traffic contorl
iperf: Network performance
uuidgen: uuid for network interface
SCP: File exchange
SSH: Remote access
Sockets in C

Search this site

Subscribe to Telegram channel @aofeed to follow new articles and updates to old ones

Go to channel

@aofeed

Ask a question in the Telegram group

@aofeedchat

Contacts and cooperation:
I recommend our hosting beget.ru
Write to info@urn.su, info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: