Basic networking commands
Basic networking commands (such as tracert, traceroute, ping, netstat, ipconfig, hostname, tcp dump and nslookup) . And their arguments, options and parameters in details including how they are used to troubleshoot the computer network.
Ifconfig: -Getting network configuration
- Ifconfig stands for “interface configuration” .
- One of the most basic networking commands is ifconfig.
- View network configuration, it displays the current network adapter configuration. It is handy to determine if you are getting transmit (TX) or receive (RX) errors.
- It will tell you about your network interfaces, the state that they’re in, your assigned IP address, and even provides some counts of packets that have crossed the interface since the system was last booted. These days, you may see both ipv4 and ipv6 addresses.
- The RX (receive) and TX (transmit) packets counts as well as the same basic statistics shown in bytes.
- These numbers may seem huge, but the system was running for roughly a year.
Ping: -Test network connection.
- The ping command sends an echo request to a host available on the network.
- Using this command, you can check if your remote host is responding well or not.
- Tracking and isolating hardware and software problems.
- Determining the status of the network and various foreign hosts.
- Testing, measuring, and managing networks.
- Syntax: –Following is the simple syntax to use the ping command − $ping hostname or IP-address. The above command starts printing a response after every second.
- Example: -$ping google.com
Netstat: -Network connections, routing tables, interface statistics .
- The netstat command can tell you about ongoing connections on the local system and ports (i.e., services) that are listening, indicating that services are waiting for requests to come through.
- By itself,
netstatgives you a lot information. With – aoption, it gives you even more. Traceroute: – routing steps it takes to reach the remote host
- A handy utility to view the number of hops and response time to get to a remote system or website is
traceroute. Again, you need an internet connection to make use of this tool.
traceroutecommand will attempt to provide a list of all the routers your connections, cross when reaching out to a remote system.
- The output also provides some information on how long each segment of the path takes, thus giving you some notion of the quality of a connection.
traceroutegets to aapoint at which it is unable to provide further information, you will start to see asterisks where you used to see system names and timing. Nslookup: – Query DNS lookup name.
- If you know the IP address it will display hostname.
- To find all the IP addresses for a given domain name, the command
- You must have a connection to the internet for this utility to be useful,
- Example: – $
Hostname: – finding host/domain name and IP address.
- Generally, you know the name of the system you’re logged into.
- Here are some hostname command options that you might not be using.
- Example: –
hostnamewith no option displays the machine’s hostname. hostname-d displays the domain name the machine belongs to. hostname-f displays the fully qualified host and domain name. hostname– idisplays the IP address for the current machine. The – ioption provides and easy way to grab the system’s IP address without having to separate it from it ifconfig output.
- You can often find a lot more information about a domain using the
- Example; – $
- It is queried and response protocol.
Type of packet analyzer software utility that monitors and logs
Install using install
- Capture packets from specific interface
tcp– ieth0 :Display available interfaces Tcpdump–d :Read captured packets in file Tcpdump–r abc . pcap:Capture packets from ipsource Tcpdump– ieth0 src192.168.0.2
You can also refer basic commands in linux by clicking below.
One Comment on “Basic Networking command in Linux/Unix”