This article lists the network and monitoring commands that every Linux user should know about. The network and monitoring commands are similar to the hostname, ping, ifconfig, iwconfig, netstat, nslookup, traceroute, finger, telnet, and ethtool commands for viewing linux Server IP addresses and managing server network configurations, establish a network connection with linux Through telnet and ethernet, and view linux server information. Next let's take a look at the use of network and monitoring commands in Linux.
1. hostname
No option for hostname. The host name is displayed.
Hostname-d: display the Domain Name of the machine
Hostname-f displays the complete host name and domain name
Hostname-I displays the IP address of the Current Machine
2. ping
Ping to send data packets to the specified address. When the packet is received, the target machine sends the returned packet. Ping has two main functions:
Used to confirm that the network connection is smooth.
Used to view the connection speed information.
If you ping www.yahoo.com, it returns its IP address. You can use ctrl + C to stop the command.
3. ifconfig
View the network configurations of a user. It displays the current network device configuration. This tool is extremely useful for error searches that require receiving or sending data.
4. iwconfig
Iwconfig is similar to ifconfig and ethtool. Is used for wireless network interfaces. you can use it to view basic Wi-Fi network information, such as SSID, channel, and encryption. you can also view and modify many other configurations, including the receiver sensitivity, RTS/CTS, the shard size of sent packets, and the retransmission mechanism of the wireless network adapter.
5. nslookup
When the nslookup command has an IP address, you can use this command to display the Host Name and find all the IP addresses of the given domain name. You must connect to the Internet to use this command.
Example: nslookup blogger.com. You can also use nslookup to obtain the host name from the ip address or the ip address from the host name.
6. traceroute
A convenient tool. You can view the IP address, hop count, and response time of the router when the data packet is submitted to a remote system or website. Similarly, you must connect to the Internet to use this command.
7. finger
View user information. Displays the user's logon name, real name, and logon terminal name and permissions. This is a very old unix Command, which is rarely used now.
8. telnet
Connect to the target host through telnet. If the telnet connection can be completed on any port, the connection between the two hosts is good.
Telnet hostname port-use the specified port to telnet the host name. This is usually used to test whether the host is online or the network is normal.
9. ethtool
Ethtool allows you to view and change many network card settings (excluding Wi-Fi network cards ). You can manage many advanced settings, including tx/rx, verification, and network wake-up functions. Below are some basic commands you may be interested in:
Ethtool-I displays the driver information of a specific network card, which is particularly useful when checking the software compatibility
Ethtool-p starts the specified behavior of an adapter, such as flashing the LED lights of the adapter to help you identify the interface name in multiple adapters or interfaces
Ethtool-s displays network statistics
Ethtool speed <10 | 100 | 1000> sets the connection speed of the adapter, in Mbps.
10. netstat
Find the most useful and common Linux commands for host connection. You can use "netstat-g" to query all multicast groups (networks) subscribed to by the host)
Netstat-nap | grep port will display the process id of the application using this port
Netstat-a or netstat-all will display all connections including TCP and UDP
Netstat-tcp or netstat-t will display the TCP Connection
Netstat-udp or netstat-u will display UDP connections
Netstat-g displays all Multicast Networks subscribed to by the host.