Linux IP Commands for TCP/IP Services

Since its release in 1991, Linux has become increasingly popular as a base. Approximately 1.84% of all desktops run Linux, and considering that there are roughly two billion desktops, servers, and laptops running in the world, that means Linux runs on an estimated 37 million computers. Chrome-OS, along with many other lightweight devices, use Linux kernel as their base because of its robust and highly customizable nature.

The command line tool is one of the most essential tools on a desktop, regardless of operating system. Understanding the most common command lines makes it easy to test your ping, perform a DNS test, or any number of simple tasks. Furthermore, if you have ever worked on servers, it's likely that you've come across some version of Linux and have had to use some of the Linux IP Commands listed below.

The following are some of the more frequently used command lines relating to Linux TCP/IP commands.

DescriptionLinux Internet Protocol Command
Display Current Config for all NICsifconfig
Display Current Config for eth0ifconfig eth0
Assign IPifconfig eth0
Pingping -c 3
Assign multiple IPsifconfig eth0:0
Assign second IPifconfig eth0:1
Disable network cardifconfig eth0 down
Enable network cardifconfig eth0 up
View current routing tableroute "or" route -n
View arp cachearp "or" arp -n
Assign IP/Subnetifconfig eth0 netmask
Assign Default Gatewayroute add default gw
Trace Routetraceroute
Trace Pathtracepath
DNS Testhost
Advanced DNS Testdig
Reverse Lookuphost
Advanced Reverse Lookupdig -x

Note that you must be at the root user to make or save any changes. If you are a Linux user, your distribution will determine the location of your network config file, which will then need to be updated and saved for the changes to remain in effect after rebooting. Network cards are referred to as eth0, eth1, eth2, etc based on their position on the PCI bus.

Replacing the Linux IP command ifconfig with ipconfig

Ifconfig has been around since 1983 and it is one of the more common command line interface tools used to help administrators of devices view and assign IP address information to network interface cards within the devices. In newer Linux distributions, however, the ifconfig command has been replaced with ipconfig and may not be available.

If you enter the ifconfig command and get an error message, switch to using the ipconfig command or install the deprecated ifconfig command.