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

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.
Description | DOS/Windows Internet Protocol Commands |
---|---|
Connection Configuration | ipconfig /all |
DNS Cache Information | ipconfig /displaydns |
Release All IP Address Connections | ipconfig /release |
Renew All IP Address Connections | ipconfig /renew |
Re-Register the DNS connections | ipconfig /registerdns |
Change/Modify DHCP Class ID | ipconfig /setclassid |
Network Connections | control netconnections |
Network Setup Wizard | netsetup.cpl |
Test Connectivity | ping whatismyip.com |
Trace Route | tracert |
TCP/IP Protocol Sessions | netstat |
Local Route | route |
Resolved MAC Addresses | arp |
Name of Computer Currently On | hostname |
DHCP Class Information | ipconfig /showclassid |
NameServer Lookup | nslookup whatismyip.com |
UNIX Internet Protocol commands
The following are the most common command lines relating to Unix IP Commands.
Description | UNIX Internet Protocol Command |
---|---|
Display Current Config For All NIC's | ifconfig |
Display Current Config For dc0 | ifconfig dc0 |
Assign Multiple IPs | ifconfig dc0:0 192.168.1.2 |
Assign Second IP | ifconfig dc0:1 192.168.1.3 |
Disable Network Card | ifconfig dc0 down |
Enable Network Card | ifconfig dc0 up |
Assign IP/Subnet | ifconfig dc0 inet 192.168.1.2 netmask 255.255.255.0 |
Assign Gateway | route 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.
Description | Linux Internet Protocol Command |
---|---|
Display Current Config For All NIC's | ifconfig |
Display Current Config For eth0 | ifconfig eth0 |
Assign IP | ifconfig eth0 192.168.1.2 |
Ping | ping -c 3 192.168.1.1 |
Assign Multiple IPs | ifconfig eth0:0 192.168.1.2 |
Assign Second IP | ifconfig eth0:1 192.168.1.3 |
Disable Network Card | ifconfig eth0 down |
Enable Network Card | ifconfig eth0 up |
View Current Routing Table | route "or" route -n |
View arp Cache | arp "or" arp -n |
Assign IP/Subnet | ifconfig eth0 192.168.1.2 netmask 255.255.255.0 |
Assign Default Gateway | route add default gw 192.168.1.1 |
Trace Route | traceroute www.whatismyip.com |
Trace Path | tracepath www.whatismyip.com |
DNS Test | host www.whatismyip.com |
Advanced DNS Test | dig www.whatismyip.com |
Reverse Lookup | host 66.11.119.69 |
Advanced Reverse Lookup | dig -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!