Must-know Linux networking commands; List of network commands in Linux Ubuntu that every user must know. Posts lists out the advanced networking commands such as:
1. ping
send ICMP ECHO_REQUEST to network hosts. ping uses the ICMP protocol’s mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams (“pings”) have an IP and ICMP header, followed by a struct timeval and then an arbitrary number of “pad” bytes used to fill out the packet. ping6 is IPv6 version of ping, and can also send Node Information Queries (RFC4620). Intermediate hops may not be allowed, because IPv6 source routing was deprecated. The ping command (named after the sound of an active sonar system) sends echo requests to the host you specify on the command line, and lists the responses received their round trip time.
2. hostname
Tells the user the host name of the computer they are logged into. Note: may be called host. With no arguments, ‘hostname’ prints the name of the current hostsystem. With one argument, it sets the current host name to the specified string. You must have appropriate privileges to set the host name.
3. traceroute
traceroute is a network troubleshooting utility which shows number of hops taken to reach destination also determine packets traveling path. Below we are tracing route to global DNS server IP Address and able to reach destination also shows path of that packet is traveling. traceroute will show the route of a packet. It attempts to list the series of hosts through which your packets travel on their way to a given destination. Also have a look at xtraceroute (one of several graphical equivalents of this program).
4. netstat
Netstat (Network Statistic) command display connection info, routing table information etc. To displays routing table information use option as -r. Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options.
5. ifconfig
ifconfig (interface configurator) command is used to configure network interfaces, or to display their current configuration. In addition to activating and deactivating interfaces with the “up” and “down” settings, this command is necessary for setting an interface’s address information if you don’t have the ifcfg script.
6. nmap
“network exploration tool and security scanner”. nmap is a very advanced network tool used to query machines (local or remote) as to whether they are up and what ports are open on these machines.
7. dig
The “domain information groper” tool. More advanced then host… If you give a hostname as an argument to output information about that host, including it’s IP address, hostname and various other information.
8. route
The route command is the tool used to display or modify the routing table. To add a gateway as the default you would type:
9. ethtool
query or control network driver and hardware settings. ethtool is used to query and control network device driver and hardware settings, particularly for wired Ethernet devices. devname is the name of the network device on which ethtool should operate. ethtool with a single argument specifying the device name prints current settings of the specified device.
10. route
The route command is the tool used to display or modify the routing table. To add a gateway as the default you would type: route add default gw some_computer.