Command: network related commands

If you want to be the master of your VPS or dedicated server you must know some basic networking commands to troubleshoot connection issues or to find out more information about your or someone else server.

This guide will not go into any depth for each command, thats what the man pages are for ūüôā This is here as a cheat-sheet to keep close when you need it.
Lets get started, the commands are listed in alphabetical order:


This command manipulates the kernel’s ARP cache in various ways. The primary options are clearing an address mapping entry or ¬†manually setting up one.
For debugging purposes, the arp program also allows a complete dump of the ARP cache.

Example:[precode]arp -van[/precode]


This command is used to check all network interfaces. Using the ifconfig command without parameters will show you details of already configured network cards or interfaces. This is a great way to get a check that your network hardware is working properly.


OpenVZ [precode] ifconfig venet0:0[/precode] or [precode]ifconfig venet0[/precode]

KVM or dedicated [precode] ifconfig eth0 [/precode]


This command displays all sockets and server connections. This is usually very helpful for webserver administrating.

Example: [precode] netstat -nap[/precode]

This command shows you the IP (n) instead of hostname, all (a) listening ports and what program/pid (p) is listening on that port.


You can use this command to check the domain name and IP information of a server, user -query=<type> to change what type of information you are looking for.

Example: [precode]nslookup -query=ns [/precode]


As you can guess, ping is used to ping a server to check if it works properly

Example: [precode]ping

PING ( 56(84) bytes of data.
64 bytes from ( icmp_req=1 ttl=46 time=129 ms



PING 56 data bytes
64 bytes from icmp_seq=1 ttl=45 time=905 ms



This command has the same usage as the command netstat -r. Route (without parameters) will display a list of the routing tables for your server.

Example: [precode]route[/precode]

You can manually add/remove routes, meaning you can force traffic to go one specific way to reach it’s destination.


This is a very powerful network command that basically gives the exact route between your machine and a server. It is used to trace the existing network routing for a remote or local server.

Example: [precode] traceroute [/precode]



mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.

mtr¬†supports both IPv6 and IPv4 and will default to IPv6 when available. It is possible to force and IPv4 trace using the ‘-4‘ switch.

Example: [precode] mtr [/precode]

4 comments for “Command: network related commands

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.