Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use ping, traceroute, ss and netstat command tools in linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use ping, traceroute, ss and netstat command tools in linux. I hope you will get something after reading this article. Let's discuss it together.

Netstat ss ping traceroute mtr

1. Ping command

The ping command uses the icmp protocol and can be used to test connected communication on the network.

Ping [options] IP

-c #

-w deadline: test execution time

# ping-c 2 172.16.0.1

2. Traceroute trace route

Gets all the gateways from the current host to the target host

Common examples:

Example 1

Traceroute www.baidu.com

Example 2 shows only the first 10 hops in numeric format

# traceroute-n-m 10 www.qq.com

3. Mtr network connectivity judgment tool

A tool for combining ping and traceroute

Common option

-n is displayed in digital format

-c how many packets are sent

-- report results are displayed, but not dynamically

# mtr-n-c 10-- report www.2345.com

Or dynamic display without any options.

# mtr www.2345.com

2. Netstat is used to display all kinds of network related information.

Common options:

-t: connection of tcp protocol (default is connection in ESTABLISHED establishment)

-u: udp protocol connections are generally not displayed because they are udp stateless connections

-l: connection in listening state (LISTEN status)

-a: connections for all statu

-p: connect related processes

-n: display in digital format

-r: displays the routing table, similar to route or ip route show

Common combination

# netstat-tan\\ displays all connections to tcp, displays # netstat-tunl\\ shows connections in tcp and udp snooping status, and displays # netstat-rn\\ to view the routing table in digital format

3. Ss: it is much faster than netstat to display all kinds of network-related information.

Common option

-t: tcp related connections

-u: udp related connections

-a: all connections to related protocols

-l: socket for monitoring statu

-e: display extended information

-m: displays memory information used by socket connections

-p: process and PID

-n: numeric format address and port

-o state {established}

Ethtool

Ethtool Interface: displays device interface properti

Ethtool-S Interface: displays statistics for device interfaces

Commonly used vulnerability scanning tools

Nmap: scanner

Tcpdump: sniffer

Wireshark: sniffer

Tshark: character interface

After reading this article, I believe you have a certain understanding of "how to use ping, traceroute, ss, netstat command tools in linux". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report