Network command solution (2)

Source: Internet
Author: User
Tags ftp commands remote ftp server runique

Netstat command details

Netstat is used to display statistics related to IP, TCP, UDP, and ICMP protocols. It is generally used to check the network connection of each port on the local machine.

If the data packets received by our computer sometimes lead to data deletion or failure errors, we do not need to be surprised that TCP/IP can allow these types of errors and automatically resend the data packets. However, if the cumulative number of errors accounts for a considerable percentage of the received IP data packets, or the number of errors increases rapidly, then we should use netstat to check the cause.

1. Some common netstat options

· Netstat-S

This option displays statistical data for each protocol. If our applications (such as Web browsers) run slowly or cannot display data such as web pages, we can use this option to view the displayed information. We need to carefully check the rows of statistics, find the keyword of the error, and then determine the problem.

· Netstat-e

This option is used to display statistics about Ethernet. It lists items including the total number of bytes, number of errors, number of delimiters, number of datagram, and number of broadcasts. These statistics include both the number of sent and received data packets. This option can be used to calculate some basic network traffic ).

· Netstat-R

This option displays information about the route table, similar to the information shown later when you use the route print command. In addition to valid routes, valid connections are also displayed.

· Netstat-

This option displays a list of all valid connection information, including the established connections (established) and those that listen to the listening requests.

· Netstat-n

All established valid connections are displayed.

The following is an output example of netstat:

C:/> netstat-e

Interface statistics

Receivedsent

Bytes399582134047224622

Unicast packets120099131015

Non-Unicast packets7579544 3823

Discards 0 0

Errors 0 0

Unknown protocols363054211

C:/> netstat-

Active connections

PROTO local addressforeign address State

Tcpcorp1: 1572 172.16.48.10: nbsession established

Tcpcorp1: 1589 172.16.48.10: nbsession established

Tcpcorp1: 1606 172.16.105.245: nbsession established

Tcpcorp1: 1632 172.16.48.213: nbsessionestablished

Tcpcorp1: 1659 172.16.48.169: nbsessionestablished

Tcpcorp1: 1714 172.16.48.203: nbsessionestablished

Tcpcorp1: 1719 172.16.48.36: nbsession established

Tcpcorp1: 1241 172.16.48.101: nbsessionestablished

Udpcorp1: 1025 *:*

Udpcorp1: SNMP *:*

Udpcorp1: nbname *:*

Udpcorp1: nbdatagram *:*

Udpcorp1: nbname *:*

Udpcorp1: nbdatagram *:*

C:/> netstat-S

IP statistics

Packets received = 5378528

Inclued header errors = 738854

Received address errors = 23150

Required rams forwarded = 0

Unknown protocols committed ED = 0

Inclued packets discarded = 0

Received packets delivered = 4616524

Output requests = 132702

Routing discards = 157

Discarded output packets = 0

Output packet no route = 0

Reassembly required = 0

Reassembly successful = 0

Reassembly failures =

Required rams successfully fragmented = 0

Required rams failing fragmentation = 0

Fragments created = 0

ICMP statistics

Receivedsent

Messages 693 4

Errors 0 0

Destination unreachable685 0

Time exceeded0 0

Parameter problems 0 0

Source quenches0 0

Redirects0 0

Echoes 4 0

Echo replies 0 4

Timestamps 0 0

Timestamp replies0 0

Address masks0 0

Address Mask replies 0 0

TCP statistics

Active opens = 597

Passive opens = 135

Failed connection attempts = 107

Reset connections = 91

Current connections = 8

Segments received = 106770

Segments sent = 118431

Segments retransmitted = 461

UDP statistics

Required rams received = 4157136

No ports = 351928

Receiveerrors = 2

Required rams sent = 13809

2. The use of netstat

People who frequently access the Internet usually use ICQ. I wonder if we have been harassed by some annoying people. If we want to complain, we don't know how to get started? In fact, as long as we know the IP address of the other party, we can complain to its ISP. But how can I know the IP address of the other Party through ICQ? If the recipient chooses not to display the IP address when setting ICQ, we cannot see it in the Information bar. In fact, we only need to use netstat to easily achieve this: when he is connected to us through ICQ or other tools (for example, we send him an ICQ message or a message ), enter netstat-N or netstat-A at the DOS command prompt to view the IP address or ISP domain name used by the other party to access the Internet, and even the port used is completely exposed.

 

FTP commands

FTP commands are one of the most frequently used commands by Internet users. A large number of internal FTP commands are used in both dos and UNIX operating systems. Familiar with and flexible application of FTP Internal commands can greatly facilitate users and get twice the result with half the effort.

The FTP command line format is: ftp-v-d-I-n-g [host name], where-V displays all the response information of the remote server; -N indicates that FTP automatic logon is disabled ;. N etrc file;-D: Debug;-G: cancel the global file name.

The internal commands used by FTP are as follows (brackets indicate optional ):

1 .! [Cmd [ARGs]: Execute the interactive shell on the local machine and exit to return to the FTP environment, for example :! Ls *. Zip.

2. $ macro-Ame [ARGs]: Execute macro to define macro-name.

3. Account [Password]: Provide the password required to access system resources after logging on to the remote system.

4. append local-file [Remote-file]: append the local file to the remote system host. If the remote system file name is not specified, the local file name is used.

5. ASCII: Use the ASCII type transmission method.

6. Bell: after each command is executed, the computer rings once.

7. Bin: Binary File Transfer Mode.

8. Bye: exit the FTP session.

9. Case: when using mget, convert uppercase letters in the remote host file name to lowercase letters.

10. CD remote-Dir: Enter the remote host directory.

11. cdup: Enter the parent directory of the remote host directory.

12. chmod mode file-Name: Set the file-name access mode of the remote host file to mode, for example, chmod 777 A. Out.

13. Close: interrupt the FTP session with the remote server (corresponding to open ).

14. Cr: When a file is transmitted using asscii, the carriage return line is converted into a return line.

15. Delete remote-file: delete remote host files.

16. debug [debug-value]: sets the debugging mode to display each command order sent to the remote host, for example, Deb up 3. If it is set to 0, the debug is canceled.

17. dir [Remote-Dir] [local-file]: displays the remote host directory and stores the result in local-file.

18. Disconnection: Same as close.

19. Form Format: sets the file transmission mode to format. The default mode is file.

20. Get remote-file [local-file]: transfers the remote-file of the remote host to the local-file of the local hard disk.

21. glob: Set the extension of the mdelete, mget, and mput file names, which is the same as the-G parameter in the command line.

22. Hash: A hash symbol (#) is displayed for every 1024 bytes transferred (#).

23. Help [cmd]: displays the help information of the FTP Internal Command cmd, for example, help get.

24. idle [seconds]: Set the Sleep timer of the remote server to [seconds] seconds.

25. Image: sets the binary transmission mode (the same as binary ).

26. LCD [dir]: Switch the local working directory to Dir.

27. ls [Remote-Dir] [local-file]: displays remote-dir in the remote directory and stores local-file in the local file.

28. macdef macro-Name: defines a macro. When an empty row under macdef is encountered, the macro defines the end.

29. mdelete [Remote-file]: delete remote host files.

30. mdir remote-files local-file: similar to Dir, but multiple remote files can be specified, such as mdir *. O. *. zipoutfile.

31. mget remote-Files: Transfers multiple remote files.

32. mkdir Dir-Name: create a directory on the remote host.

33. MLS remote-File Local-file: Same as NLIST, but multiple file names can be specified.

34. mode [modename]: sets the file transmission mode to modename. The default format is stream.

35. modtime file-Name: displays the last modification time of the remote host file.

36. mput local-file: Transfers multiple files to the remote host.

37. Newer file-Name: if the modification time of file-name on the remote machine is closer than that of the same name file on the local hard disk, the file is retransmitted.

38. NLIST [Remote-Dir] [local-file]: displays the list of files in the remote host directory and stores the local-file on the local hard disk.

39. NMAP [inpattern outpattern]: sets the file name ing mechanism so that some characters in the file are converted to each other during file transmission, such as NMAP $1. $2. $3 [$1, $2]. [$2, $3], transfer the file a1.a2. when A3, the file name is changed to a1, a2. This command is especially applicable when the remote host is not a unix host.

40. ntrans [inchars [outchars]: sets the file name character translation mechanism, for example, ntrans 1R, then the file name lll will change to Rrr.

41. Open host [port]: Specifies the FTP server connection. You can specify the connection port.

42. Passive: enters the passive transmission mode.

43. Prompt: Set interaction prompts when multiple files are transferred.

44. Proxy FTP-cmd: Execute an FTP command in the secondary control connection. This command allows two FTP servers to be connected to transfer files between the two servers. The first FTP command must be open to first establish a connection between two servers.

45. put local-file [Remote-file]: transfers the local file to the remote master.

46. pwd: displays the current working directory of the remote host.

47. Quit: Same as bye, quit the FTP session.

48. Quote arg1, arg2. ..: Send the parameter to the remote FTP server, for example, quote syst.

49. Recv remote-file [local-file]: Same as get.

50. reget remote-file [local-file]: similar to get. However, if local-file exists, it will be resumed from the last transmission interruption.

51. rhelp [cmd-name]: request for help from the remote host.

52. rstatus [file-name]: If no file name is specified, the remote host status is displayed. If no, the file status is displayed.

53. RENAME [from] [to]: Change the remote host file name.

54. Reset: Clear the answer queue.

55. Restart marker: Start get or put again from the specified mark marker, for example, restart 130.

56. rmdir Dir-Name: Delete the remote host directory.

57. runique: Set the unique storage of file names. If the file exists, add the suffix... 1 and. 2 after the original file.

58. Send local-file [Remote-file]: Same as put.

59. sendport: Set the PORT command.

60. Site arg1, arg2. ..: Send the parameter to the remote FTP host as the site command.

61. Size file-Name: displays the file size of the remote host, for example, site idle 7200.

62. Status: displays the current FTP status.

63. struct [struct-name]: sets the file transmission structure to struct-name, and uses the stream structure due to lack of time.

64. sunique: Set the remote host file name storage to unique (corresponding to runique ).

65. System: displays the operating system type of the remote host.

66. tenex: Set the file transfer type to the required type of the tenex server.

67. Tick: sets the byte counter during transmission.

68. Trace: Set package tracing.

69. Type [type-name]: sets the file transfer type to type-name. The default value is ASCII, for example, Type Binary. Sets the binary transfer mode.

70. umask [newmask]: Set the default umask of the remote server to newmask, for example, umask 3.

71. User user-name [Password] [account]: indicates your identity to the remote host. If you need a password, enter the password, for example, USER anonymous my @ email.

72. verbose: Same as the-V parameter of the command line, that is, set the detailed report mode. All responses of the FTP server will be displayed to the user. The default value is on.

73 .? [Cmd]: Same as help.

 

ARP command details

ARP
Displays and modifies the items in the "Address Resolution Protocol (ARP)" cache. The ARP cache contains one or more tables, which are used to store IP addresses and Their resolved physical IP addresses over Ethernet or card rings. Each Ethernet or ring network adapter installed on the computer has its own independent table. If no parameters are available, the ARP command displays help information.

Syntax
ARP [-A [inetaddr] [-N ifaceaddr] [-G [inetaddr] [-N ifaceaddr] [-D inetaddr [ifaceaddr] [-s inetaddr etheraddr [ifaceaddr]

Parameters
-A [inetaddr] [-N ifaceaddr]

Displays the current ARP cache table for all interfaces. To display ARP cache items for a specific IP address, use ARP-A with the inetaddr parameter. inetaddr here represents the IP address. If inetaddr is not specified, the first applicable interface is used. To display the ARP cache table for a specific interface, use the-n ifaceaddr parameter with the-a parameter. ifaceaddr here represents the IP address assigned to the interface. The-N parameter is case sensitive.

-G [inetaddr] [-N ifaceaddr]

Same as-.

-D inetaddr [ifaceaddr]

Delete the specified IP address. inetaddr here represents the IP address. To delete an item in a table for the specified interface, use the ifaceaddr parameter. ifaceaddr here represents the IP address assigned to the interface. To delete all items, use the asterisk (*) wildcard to replace inetaddr.

-S inetaddr etheraddr [ifaceaddr]

Add a static entry that parses the IP address inetaddr into the physical address etheraddr to the ARP cache. To add a static ARP cache entry to the table of the specified interface, use the ifaceaddr parameter. ifaceaddr here represents the IP address assigned to the interface.

/?

Display help at a command prompt.

Note
? The IP addresses of inetaddr and ifaceaddr are represented in decimal notation with dots.

? The physical address of etheraddr consists of six bytes, which are expressed in hexadecimal notation and separated by a hyphen (for example, 00-aa-00-4f-2a-9c ).

? The items added through the-S parameter are static items that do not time out during ARP cache. If the TCP/IP protocol is terminated and then started, these items will be deleted. To create a permanent static ARP cache entry, place the appropriate ARP command in a batch file and run the batch file at startup using the "Task Plan.

Example
To display the ARP cache tables for all interfaces, type:

ARP-

For an interface with the assigned IP address 10.0.0.99, to display its ARP cache table, type:

ARP-a-n 10.0.0.99

To add a static ARP cache entry that resolves the IP address 10.0.0.80 to the physical address 00-aa-00-4f-2a-9c, type:

ARP-s 10.0.0.80 00-aa-00-4f-2a-9c

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.