Configuration & network diagnostic

In this tutorial, we will present you the different configuration and network diagnostic on Unix.


Ifconfig

ifconfig is a command allowing to configure and list the network interfaces of a machine.

Assignment of the IP 192.168.1.10 to the interface eth0
Activate/Deactivate the interface
Specify the subnet mask
Specify the MTU value
Specify the metric/the cost of a path (value required for a dynamic routing)
Activate/Deactivate the cache ARP
Specify the broadcast IP
Activate/Deactivate the multicast


Ping

ping (Packet INternet Groper) is a test command of connectivity between 2 hosts.

The command, valid for a LAN or WAN interface, uses the protocole ICMP.

This command must be followed by either an IP address or a domain that will be resolved.


Traceroute

traceroute is a command displaying all the equipments and their IP addresses as well as the response time between a machine and the desired destination, this is referred to as saut.


Netstat

netstat (Network Statistic) is a command allowing to look at the statistics on all the network interfaces visible to a machine.

This commande can take into account several accumulative parameters (source Wiki) :

Provides your ports use statistics
Provides all the ports
Provides all the TCP ports
Provides all the UDP ports
Provides all the listening ports
Directly provides the IP. No name resolution
Provides the program name and the associated PID


Dig

dig (Domain Information Groper) is a command that questions a server DNS (Domain Name Server) and returns the different recordings A, CNAME, MX, TXT, PTR, …

Returns a IPv4 address for a given hostname.
Returns a IPv6 address for a given hostname.
Delegates a zone management to an authoritative name server.
Allows to realize an alias (shortcut) from a host to another.
Performs the inverse of the recording A or AAAA, gives a hostname (FQDN) for an IP address.
Specifies the name of the domain mail server.
A free characters string.


Host

host is a command allowing to know a domain IP address or inversely.
The CNAME, MX, … records can also be displayed.


Nslookup

nslookup (Name System Look Up) is a command allowing to search for recordings on a DNS server.

returns the A record
returns the “Reverse DNS” record
returns the MX – Mail eXchange record
returns the NS – Name Server record


Arp

arp (Address Resolution Protocol) is a command allowing to list the ARP cache entries containing the MAC physical addresses and the IP addresses.

To return the ARP table from the chosen interface
To empty the ARP table
Add an entry in the ARP table
returns the NS – Name Server record