Navigating the world of Linux networking can be both intriguing and challenging. Equip yourself with these top 5 Linux networking commands to master your network configuration and troubleshooting, complete with examples to guide you.
ifconfig /all: To Get Your System Network Information
ifconfig
The command ifconfig is an interface configurator that enables us to initialize an interface, assign IP addresses, enable or disable an interface, and display routes and network interfaces. With the ifconfig command, you can view IP addresses, MAC addresses, and MTU (Maximum Transmission Unit).

Explanation
mtu:- Maximum Transmission Unit, which is the size of the largest packet that can be transmitted. Here, it is 9001.
inet:-IPv4 address assigned to the interface (172.31.22.37), netmask (255.255.240.0), and broadcast address (172.31.31.255).
inet6: -IPv6 address (fe80::3a:4ff:fe3:e6d7) and other IPv6 parameters.
ether:- MAC address of the interface (02:3a:04:e3:e6:d7).
txqueuelen:- Transmit queue length (1000).
RX/TX packets:- Number of packets received (380000) and transmitted (157574).
RX/TX bytes: Number of bytes received (382654724 bytes or 382.6 MB) and transmitted (18950176 bytes or 18.9 MB).
- errors, dropped, overruns, frame, carrier, and collisions Statistics for errors and issues related to packet transmission and reception, all show 0 indicating no problems.
Interface lo (Loopback)
flags: -73<UP,LOOPBACK,RUNNING> indicates:
UP:- Interface is up.
LOOPBACK:- This is the loopback interface.
RUNNING:- Interface is running.
mtu:- 65536.
inet:- IPv4 loopback address (127.0.0.1).
inet6:- IPv6 loopback address (::1).
loop:- Loopback indicator.
txqueuelen:- 1000.
RX/TX packets:- Number of packets received and transmitted (228523).
RX/TX bytes:- Number of bytes received and transmitted (11671418 bytes or 11.6 MB)
- There are no errors, dropped packets, overruns, frame issues, carrier problems, or collisions. All values are 0, indicating no issues.
nslookup: To Resolve IP Address from Domain Name or Vice Versa
‘nslookup, a network administration command-line tool, queries the Domain Name System (DNS) for obtaining domain name or IP address mapping.’

Explanation
Server Information:- The DNS server used for the query is127.0.0.53
, a local DNS resolver.
Non-authoritative Answer:- Indicates the information is from a cached source.
Domain Name and IP Addresses:- Lists the IP addresses associated withgoogle.com
.
ping: To Check Whether the Host is Reachable or Not
Ping, a network administration utility, tests the reachability of a host on an IP network and measures the round-trip time for messages sent from the originating host to a destination computer.

Explanation
64 bytes from sb-in-f113.1e100.net (74.125.130.113): Each reply includes the size of the packet and the hostname and IP address of the responding host.
icmp_seq: The sequence number of the packet.
ttl: Time-to-live value, indicating the remaining hops before the packet is discarded.
time: Round-trip time for the packet in milliseconds.
traceroute (Trace Route): To Get the Path or the Hops the Packet is Taking to Reach the Host

Explanation
traceroute to google.com: The destination domain being traced.
(74.125.200.138):- The IP address of the destination.
30 hops max:- The maximum number of hops (intermediate routers) allowed before stopping the trace.
60 byte packets:- The size of the packets being sent.
Hop Number: Each step in the route.
Round-trip Time: Time taken for the packet to travel to the hop and back.
Hostname/IP Address: The name or IP of the router at each hop.
netstat: To Identify Current Active Connections in Your System
Netstat, a network utility, displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

Explanation
Proto: The protocol used (e.g., TCP, UDP).
Local Address:- The address and port number of the local end of the connection.
Foreign Address:- The address and port number of the remote end of the connection.
State:- The state of the connection (e.g., ESTABLISHED, LISTENING).