[Comprehensive explanation of Linux commands] 139. Detailed explanation of the use of network tools arpping and ping

arping

Test the network by sending ARP protocol packets

Additional information

The arping command is a tool used to send arp requests to a neighboring host. arping uses arp packets to check the hardware address on the device through the ping command. Ability to test whether an IP address is already in use on the network and obtain more device information. The function is similar to ping.

grammar

arping [选项] [参数]

Options

  • -b: Used to send Ethernet broadcast frames (FFFFFFFFFFFF). arping uses the broadcast address initially and the unicast address after receiving the response.
  • -q: quiet output does not display any information;
  • -f: Indicates to exit after receiving the first response message;
  • -w timeout: Set a timeout in seconds. If the specified time is reached and arping has not fully received the response, it will exit;
  • -c count: Indicates that it will stop after sending the specified number of ARP request packets. If the deadline option is specified, arping will wait for the same number of arp response packets until timeout;
  • -s source: Set the value of the SPA field in the arp packet sent by arping. If it is empty, proceed as follows. If it is DAD mode (conflict address detection), it is set to 0.0.0.0. If it is Unsolicited ARP mode (Gratutious ARP), it is set to the target address, otherwise it is derived from the routing table;
  • -I interface: Set the network interface used by ping.

parameter

Destination host: Specify the destination host for sending ARP messages.

Example

[root@localhost ~]# arping www.baidu.com 
ARPING 220.181.111.147 from 173.231.43.132 eth0
Unicast reply from 220.181.111.147 00:D0:03:[bc:48:00]  1.666ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.677ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.691ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.728ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.626ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.292ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.429ms
Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  2.042ms
Sent 8 probes (1 broadcast(s))
Received 8 response(s) 

ping

Test network connectivity between hosts

Additional information

The ping command is used to test the network connectivity between hosts. Executing the ping command will use the ICMP transport protocol to send a message requesting a response. If there is no problem with the network function of the remote host, it will respond to the message, thus knowing that the host is operating normally.

grammar

ping [选项] [参数]

Options

  • -d: Use the SO_DEBUG function of Socket;
  • -c <Number of completions>: Set the number of times to complete the request response;
  • -f: limit detection;
  • -i<interval seconds>: Specify the interval between sending and receiving information;
  • -I<network interface>: Use the specified network interface to send data packets;
  • -l<preload>: Set the data packet to be sent before sending the required information;
  • -n: Output only numerical values;
  • -p<template style>: Set the template style for filling data packets;
  • -q: Do not display the instruction execution process, except related information at the beginning and end;
  • -r: Ignore the ordinary Routing Table and send the data packet directly to the remote host;
  • -R: record the routing process;
  • -s<packet size>: Set the size of the data packet;
  • -t<survival value>: Set the size of the survival value TTL;
  • -v: Display the execution process of the command in detail.
  • -w <timeout seconds>: No matter how many packets have been sent or received before, as long as this number of seconds is exceeded, the program will exit;

parameter

Destination host: Specify the destination host for sending ICMP messages.

Example

[root@AY1307311912260196fcZ ~]# ping www.jsdig.com
PING host.1.jsdig.com (100.42.212.8) 56(84) bytes of data.
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=1 ttl=50 time=177 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=2 ttl=50 time=178 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=3 ttl=50 time=174 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=4 ttl=50 time=177 ms
...按Ctrl+C结束

--- host.1.jsdig.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2998ms
rtt min/avg/max/mdev = 174.068/176.916/178.182/1.683 ms

Learn from scratchpython

[Learn python from scratch] 92. Use Python’s requests library to send HTTP requests and process responses
[Learn python from scratch] 91. Use decorators and dictionaries to manage request paths in a simple web application
[Learn python from scratch] 93. Use dictionary management Request path
[Learn python from scratch] 89. Use WSGI to build a simple and efficient Web server
[Learn python from scratch] 88. Detailed explanation of WSGI interface: realize simple and efficient web development
[Learn python from scratch] 87. Manually build an HTTP server in Python Implementation and multi-threaded concurrent processing
[Learn python from scratch] 86. In-depth understanding of the HTTP protocol and its role in browser and server communication
[Learn python from scratch] 85. Application of parallel computing technology in Python process pool
[Learn python from scratch] ] 84. In-depth understanding of threads and processes
[Learn python from scratch] 83. Python multi-process programming and the use of process pools
[Learn python from scratch] 82. Chat program implementation based on multi-threading
[Learn python from scratch] 81. Python more Application of thread communication and queue
[Learn python from scratch] 80. Thread access to global variables and thread safety issues
[Learn python from scratch] 79. Thread access to global variables and thread safety issues
[Learn python from scratch] 78. File download case
[ Learn python from scratch] 77. TCP server programming and precautions
[learn python from scratch] 76. Server and client: key components of network communication
[learn python from scratch] 75. TCP protocol: reliable connection-oriented transmission layer communication protocol
[Learn python from scratch] 74. UDP network program: Detailed explanation of port issues and binding information
[Learn python from scratch] 73. UDP network program - sending data
[Learn python from scratch] 72. In-depth understanding of Socket communication and creation of sockets Method
[Learn python from scratch] 71. Network ports and their functions
[Learn python from scratch] 70. Network communication methods and their applications: from direct communication to routers to connect multiple networks
[Learn python from scratch] 69. Network communication and IP address classification analysis
[Learn python from scratch] 68. Greedy and non-greedy modes in Python regular expressions
[Learn python from scratch] 67. The re module in Python: regular replacement and advanced matching technology
[Learn python from scratch] 66 .In-depth understanding of regular expressions: a powerful tool for pattern matching and text processing
[Learn python from scratch] 65. Detailed explanation of Python regular expression modifiers and their applications
[Learn python from scratch] 64. The re.compile method in Python regular expressions Detailed explanation of usage
[Learn python from scratch] 63. Introduction to the re.Match class and its attributes and methods in regular expressions
[Learn python from scratch] 62. Python regular expressions: a powerful string matching tool
[Learn python from scratch] 61. Detailed explanation and application examples of property attributes in Python
[Learn python from scratch] 60. Exploration generator: a flexible tool for iteration
[Learn python from scratch] 59. Iterator: An efficient tool for optimizing data traversal
[Learn python from scratch] 58. Custom exceptions in Python and methods of raising exceptions
[Learn python from scratch] 57. Use the with keyword in Python to correctly close resources
[Learn python from scratch] 56. The importance and application of exception handling in programming
[Learn python from scratch] 55. Serialization and sum in Python Deserialization, application of JSON and pickle modules
[Learn python from scratch] 54. Writing data in memory
[Learn python from scratch] 53. CSV files and Python’s CSV module
[Learn python from scratch] 52. Reading and writing files - Python file operation guide
[Learn python from scratch] 51. Opening and closing files and their applications in Python
[Learn python from scratch] 49. Object-related built-in functions in Python and their usage
[Learn python from scratch] 48 .Detailed explanation of inheritance and multiple inheritance in Python
[Learn python from scratch] 47. The concept and basic use of inheritance in object-oriented programming
[Learn python from scratch] 46. Analysis of __new__ and __init__ methods and singletons in Python Design Patterns
[Learn python from scratch] 45. Class methods and static methods in Python
[Learn python from scratch] 44. Private properties and methods in object-oriented programming
[Learn python from scratch] 43. Examples in Python object-oriented programming Properties and class attributes
[Learn python from scratch] 42. Built-in properties and methods in Python
[Learn python from scratch] 41. python magic method (2)
[Learn python from scratch] 40. python magic method (1)
[Learn python from scratch] 39. Basic object-oriented syntax and application examples
[Learn python from scratch] 38. How to use and import Python packages
[Learn python from scratch] 37. The use and precautions of Python custom modules
[Learn python from scratch] Learn python] 36. Methods and techniques of using pip for third-party package management in Python
[Learn python from scratch] 35. Python common system modules and their usage
[Learn python from scratch] 34. Detailed explanation of the import and use of Python modules
[ Learn python from scratch] 33. The role of decorators (2)
[Learn python from scratch] 32. The role of decorators (1)
[Learn python from scratch] 31. In-depth understanding of higher-order functions and closures in Python
[From Learn python from scratch】30. In-depth understanding of recursive functions and anonymous functions
【learn python from scratch】29. "Detailed explanation of function parameters" - understand the different uses of Python function parameters
【learn python from scratch】28. Local variables and global variables in Python Variables
[Learn python from scratch] 27. The use of Python functions and nested calls
[Learn python from scratch] 25. Functions: a tool to improve the efficiency of code writing
[Learn python from scratch] 24. String operations and traversal methods in Python
[Learn python from scratch] 23. How to use sets (set) and common operations in Python
[Learn python from scratch] 22. Add, delete, modify, and query dictionary variables in Python
[Learn python from scratch] 21. Python tuples and dictionaries
[Learn python from scratch] 20. Python list operation skills and examples
[Learn python from scratch] 19. Applications of looping through lists and list nesting
[Learn python from scratch] 18. Detailed explanation of the basic operations of Python lists (1)
[From Learning python from scratch】 17. The format method of Python strings (2)
【Learning python from scratch】 16. The format method of Python strings (1)
【Learning python from scratch】 15. In-depth understanding of strings and character set encoding
【From Learning python from scratch】14. Common operations on Python strings (2)
【Learning python from scratch】13. Common operations on Python strings (1)
【Learning python from scratch】12. Python string operations and applications
【Learning python from scratch】 11. Python loop statements and control flow
[Learn python from scratch] 10. Detailed explanation of Python conditional statements and if nesting
[Learn python from scratch] 09. Conditional judgment statements in Python
[Learn python from scratch] 08. Python understands bit operations operator, operator priority
[Learn python from scratch] 07. Detailed explanation of Python operators: assignment, comparison and logical operators
[Learn python from scratch] 06. Use arithmetic operators in Python for calculations and string concatenation
[Learn from scratch] python ] 05. Output and input in Python
[Learn python from scratch] 04. Basics of Python programming: variables, data types and identifiers
[Learn python from scratch] 03. Python interactive programming and detailed explanation of comments
[Learn python from scratch] 02. Introduction to development tools
[Learn python from scratch] 01. Install and configure python

Guess you like

Origin blog.csdn.net/qq_33681891/article/details/132896812