This article lists the 10 basic network and monitoring commands that each Linux user should know about. Network and Monitoring commands are similar to these: hostname, ping, ifconfig, Iwconfig, netstat, nslookup, traceroute, Finger, Telnet, ethtool to view the Linux server IP address , Manage server network configuration, establish network links between Linux with Telnet and Ethernet, view server information of Linux, etc. Let's look at the use of network and monitoring commands under Linux.
1. hostname
Hostname no option to display the host name Hostname–d display the machine belongs to the domain name hostname–f display the full hostname and domain name Hostname–i display the current machine's IP address
2. Ping
Ping sends the packet to the user-specified address. When the packet is received, the target machine sends a return packet. There are two main functions of ping:
- To confirm that the network connection is unblocked.
- Used to view speed information for a connection.
If you ping www.yahoo.com it will return its IP address. You can stop the command by CTRL + C.
3. Ifconfig
View the user network configuration. It displays the current network device configuration. This tool is extremely useful when you need to receive or send data for error lookups.
4. Iwconfig
The Iwconfig tool is similar to Ifconfig and Ethtool. is for the wireless card. You can use him to view settings for basic Wi-Fi network information, such as SSID, channel, and encryption. There are many other configurations that you can also view and modify, including receive sensitivity, Rts/cts, the Shard size of the sending packet, and the retransmission mechanism of the wireless card.
5. Nslookup
Nslookup This command, when you have an IP address, can use this command to display the hostname, and you can find all the IP addresses for a given domain name. You must be connected to the Internet to use this command.
Example: Nslookup blogger.com. You can also use Nslookup to get the hostname from the IP or get the IP from the host name.
6. Traceroute
A handy tool. Can be used to view the IP address, hop count, and response time of the router that the packet passed through when it was submitted to the remote system or Web site. You must also link to the Internet to use this command.
7. Finger
View user information. Displays the user's login name, real name, and login terminal name and login rights. This is a very old Unix command and is now seldom used.
8. Telnet
Connecting to the target host via the Telnet protocol, if the Telnet connection can be completed at either port, it represents a good connection between the two hosts.
Telnet hostname port– uses the specified port Telnet host name. This is usually used to test whether the host is online or if the network is healthy.
9. Ethtool
Ethtool allows you to view and change many of the network card settings (not including the Wi-Fi network card). You can manage many advanced settings, including TX/RX, checksum, and wake-on-LAN capabilities. Here are some basic commands you might be interested in: Ethtool-i Displays the driver information for a particular NIC, especially useful when checking for software compatibility Ethtool-p start an adapter's specified behavior, such as having the adapter's LED light flashing, To help you identify the interface name in multiple adapters or interfaces Ethtool-s Display network statistics Ethtool speed <10|100|1000> Set the adapter's connection rate, in Mbps
Ten. Netstat
Discover the most useful and common Linux commands for host connections. You can use "netstat-g" to query all multicast groups (networks) that the host subscribes to
Netstat-nap | grep Port will display the process of the application using that port Idnetstat-a or Netstat–all will display all connections including TCP and UDP netstat–tcp or netstat–t will display a TCP connection NETSTAT–UDP The or netstat–u will display the UDP connection netstat-g will display all multicast networks that the host subscribes to.
10 useful Linux networks and monitoring commands [go]