July 16, 2023
Network Commands a Strong Network Engineer Should Know
As a powerful low current engineer, you must be proficient in various network commands, although it seems that those who work with low current do not seem to need these commands. It simply means that you haven't learned enough. A low current can include a network, and network itself is a kind of low current project. Therefore, network commands should be necessary knowledge.
1. ipconfig (display IP configuration value)
IPConfig can be used to display current TCP/IP configuration settings.
In short, ipconfig command allows us to quickly obtain information such as current IP address, subnet mask, and default gateway of a computer, which is essential for testing and troubleshooting. At same time, this command can also clear DNS cache (DNS cache).
Alternatively, if your computer and LAN it is on use DHCP, you can use ipconfig command to see if your computer has successfully leased an IP address. What address, including network configuration information such as IP address, subnet mask, and default gateway.
The most common options are listed below:
When using ipconfig command without parameter options, display IP address, subnet mask, and default gateway value for each configured interface.
When using all option, ipconfig can display all additional information it has configured and used for DNS and WINS servers, and can also display physical address (MAC) embedded in local network card. If IP address is leased from a DHCP server, ipconfig will display IP address assigned by DHCP server and leased address's expected expiration date. The picture shows result window of ipconfig /all command.
ipconfig /release and ipconfig /renew
These two advanced options can only be used on computers that lease IP addresses from a DHCP server. If you type ipconfig /release, then leased IP addresses of all interfaces will be redelivered to DHCP server (return an IP address). If user types ipconfig /renew, local computer tries to contact DHCP server and lease an IP address. In most cases, network adapter will be reassigned same IP address as before.
2. nslookup (server/domain name query)
nslookup is name of a program that allows an Internet server administrator or any computer user to enter a hostname (such as "www.toutiao.com") and look up corresponding IP address. This will also change name lookup to find hostname for IP address you specified.
Using nslookup parameter:
nslookup [-opt ...] # Use default server interactive mode
nslookup [-opt ...] - server # use "server" interactive mode
nslookup [-opt ...] host # only lookup "host" using default server
nslookup [-opt ...] host server # only lookup "host" using "server"
Use nslookup command to reverse lookup header address
traceroute is a tool used to determine number of gateways traversed between sending host and receiving host of a data packet. The principle of traceroute is to try to send a probe packet with lowest TTL value to track gateway through which data packet reaches target host, and then listen for an ICMP response from gateway. The default send packet size is 38 bytes.
The program uses incremental Time To Live (TTL) values to achieve its functionality. Each time a packet passes through a router, its lifetime is reduced by 1. When its survival time is 0, host cancels data packet and sends an ICMPTTL data packet to sender of original data packet.
The TTL value of first 3 data packets sent by program is 1, next 3 is 2, and so on, program will receive a series of data packet paths. Note that IP protocol does not guarantee that every packet will go through same path.
traceroute command options
Usage: Traceroute [options] [data size]
Note. On a Windows system, tracert command is used.
4, ping command
ping IP -t: Continuously ping an IP address until it is aborted by user with Ctrl C.
ping IP -l 2000: Specify a specific data length in ping command (here 2000 bytes) instead of default 32 bytes.
ping IP -n 20: ping a specified number of times (here 20).
Illustrate under what circumstances this command is used. For example, immediately after project is accepted, customer calls you on third day and says that display of some camera is “intermittent”, that is, it is not stable. Currently, you can use this command to check network status and you can fix this problem without even going to site.
Remote client computer, that is, following operations are based on operation of remote client computer;
Find IP address of failed camera, assuming IP address of failed camera is 192.168.1.3;
On the client computer, type ping 192.168.1.3 -t in [Command Prompt] and press Enter as shown below:
Two common network check commands for network monitoring
The solution is to change camera's baud rate to full duplex 10M.
5, network command
Understand functions of network services and learn how to use network service commands to solve network problems.
Type net help at command prompt for syntax help for net command at command prompt. For example, to get help on net account command, type "net help account".
All net commands accept /y and /n command-line options. For example, net stop server command is used to prompt user to confirm stop of all dependent server services, and net stop server/y means to confirm stop and shutdown of server service.
The following table lists main NET commands and what they do:
NET commands are in many ways similar to results produced by other Windows Server 2003 management tools. However, NET commands can provide all information in one place and can redirect results to a printer or to a standard text file.
The network commands used by many services start with net, and these network commands share some common attributes. To see a list of all available network commands, type net /? receive.
6. nbtstat command
Use nbtstat command to view some network configuration information on a computer. Use this command to find out some personal information about other people's computers. If you want to view network information on your computer, you can run nbtstat -n to get your workgroup, computer name, network card address, etc.; if you want to view other computers on network, run nbtstat -a *. *.*.* where *.*.*.* is replaced by an IP address will return to get some information about that host.
Learn how to use netstat command to determine current network status.
The netstat command can display active TCP connections, ports computer is listening on, Ethernet statistics, IP routing tables, IPv4 statistics (for IP, ICMP, TCP, and UDP), and IPv6 statistics (for IPv6, ICMPv6, TCP, and UDP over IPv6). When used without options, netstat displays active TCP connections.
The following are some common netstat options:
① netstat –a: The -a option lists all valid connection information, including established connections (ESTABLISHED) and those connections that are listening for connection requests (LISTENING).
② netstat -n: List of IP addresses in dotted decimal notation instead of symbolic hostnames and network names.
③ netstat -e: The -e option is used to display statistics about Ethernet. The items it lists include total bytes of transmitted packets, errors, discards, packets, and broadcasts. This statistic represents both number of packets sent and number of packets received. Use this option to count basic network traffic.
④ netstat -r: The -r option can display routing table information similar to information displayed in route print command. In addition to displaying active routes, currently active connections are also displayed.
The figure above shows a routing table where: Network Destination indicates destination network, 0.0.0.0 indicates an unknown network that is automatically generated by system after setting default gateway, 127.0.0.0 indicates local network address that is used for testing; 220.127.116.11 specifies a multicast address; 255.255.255.255 specifies a restricted broadcast address; The netmask is specifiedt netmask, Gateway specifies gateway, Interface specifies interface address, and Metric specifies number of routing hops.
⑤ netstat -s: The -s option can display statistics for each protocol. In this way, you can see what network connections current computer has, as well as details of sending and receiving data packets, and so on. If an application program (such as a web browser) is slow or unable to display data such as web pages, you can use this option to view displayed information. Look at statistics lines to find wrong keyword and determine problem.