TCP/IP Commands for Various Operating Systems

The following are commands for TCP/IP services with different type of systems. Knowing these commands is essential, as you will be able to diagnose most TCP/IP problems and begin working on a viable solution.

Commands relating to type of system

Learn important TCP/IP commands.

DOS/Windows Internet Protocol commands

DOS/Windows IP commands are used to perform several tasks, like assigning an address to a network interface or configuring network interface parameters. Below you'll find a list of the most common Internet Protocol commands for Windows and DOS. This is only a small list of the types of DOS and Windows Internet Protocol Commands that are available, but it includes ipconfig, trace route, nslookup, netstat, arp, route, hostname, and control netconnections.

DescriptionDOS/Windows Internet Protocol Commands
Connection Configurationipconfig /all
DNS Cache Informationipconfig /displaydns
Release All IP Address Connectionsipconfig /release
Renew All IP Address Connectionsipconfig /renew
Re-Register the DNS connectionsipconfig /registerdns
Change/Modify DHCP Class IDipconfig /setclassid
Network Connectionscontrol netconnections
Network Setup Wizardnetsetup.cpl
Test Connectivityping whatismyip.com
Trace Routetracert
TCP/IP Protocol Sessionsnetstat
Local Routeroute
Resolved MAC Addressesarp
Name of Computer Currently Onhostname
DHCP Class Informationipconfig /showclassid
NameServer Lookupnslookup whatismyip.com

UNIX Internet Protocol commands

The following are the most common command lines relating to Unix IP Commands.

DescriptionUNIX Internet Protocol Command
Display Current Config For All NIC'sifconfig
Display Current Config For dc0ifconfig dc0
Assign Multiple IPsifconfig dc0:0 192.168.1.2
Assign Second IPifconfig dc0:1 192.168.1.3
Disable Network Cardifconfig dc0 down
Enable Network Cardifconfig dc0 up
Assign IP/Subnetifconfig dc0 inet 192.168.1.2 netmask 255.255.255.0
Assign Gatewayroute delete default && route add default 192.168.1.1

Note that you must be at the root user to make or save any changes. Furthermore, you will need to save your changes in the /etc/rc.conf file. Network cards are referred to as dc0, dc1, dc2, and so on based on their position on the PCI bus.

*Special thanks to Romanov Sergey Vladimirovich from Moscow for the UNIX IP Commands!

Linux Internet Protocol commands

The following are the most common command lines relating to Linux IP Commands.

DescriptionLinux Internet Protocol Command
Display Current Config For All NIC'sifconfig
Display Current Config For eth0ifconfig eth0
Assign IPifconfig eth0 192.168.1.2
Pingping -c 3 192.168.1.1
Assign Multiple IPsifconfig eth0:0 192.168.1.2
Assign Second IPifconfig eth0:1 192.168.1.3
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 192.168.1.2 netmask 255.255.255.0
Assign Default Gatewayroute add default gw 192.168.1.1
Trace Routetraceroute www.whatismyip.com
Trace Pathtracepath www.whatismyip.com
DNS Testhost www.whatismyip.com
Advanced DNS Testdig www.whatismyip.com
Reverse Lookuphost 66.11.119.69
Advanced Reverse Lookupdig -x 66.11.119.69

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

*Special thanks to Gergely for the Linux Internet Protocol Commands!

VMS Internet Protocol commands

As the system administrator ("SYSTEM"), one can use TCP/IP commands to maintain TCP/IP services in various ways. The below are all CLI commands with DCL.

Note that exclamation marks (i.e. "!") denote comments. They relate to VMS IP Commands.

To display the current configuration, the fastest way would be by invoking the following command: $ SHOW NETWORK

The following command shows detailed information for the TCP/IP configuration(s) in particular and also lists active ports in use: $ SHOW NETWORK /FULL "TCP/IP"

One of the easiest ways of setting up TCP/IP networking is with the following utility:  $ @SYS$SYSROOT:[SYSMGR]TCPIP$CONFIG.COM

It's executed via the UNIX-like command:  $ TCPIP

So, for example:
$ TCPIP IFCONFIG (...) ! whatever ! desired ! options & ! values
$ TCPIP PING 192.168.1.1 ! just as an ! example
$ TCPIP TRACEROUTE GOOGLE.COM ! idem ditto
$ TCPIP NETSTAT -A

All the Ethernet adapters should typically be listed as EW* devices, which can be found by typing: $ SHOW DEVICES EW</code?

With advanced descriptions, add the /FULL qualifier, like so: $ SHOW DEVICES /FULL EW

However, for just one device, say EWA0: $ SHOW DEVICE /FULL EWA0

Alternatively, this also works: $ TCPIP SHOW INTERFACES /FULL $ TCPIP IFCONFIG -A

*Special thanks to Marco Gariboldi for the VMS Internet Protocol Commands!