In one of our previous tutorials, you've learned how to use basic commands in Command Prompt. Now it's time to take things to the next level and show how to use some of the more advanced commands. The first set of advanced commands contains useful network commands which facilitate the following: viewing information about your network devices and connections (assigned IP Address, the MAC of the network card), checking the availability of a certain host and displaying a wealth of networking and ports information.
Retrieving Information About Your Network Connection
To obtain detailed information about your network connection, use the ipconfig command. Type ipconfig in Command Prompt and press Enter. As you can see below, a list with the network devices existing on your system and their IP addresses is displayed. You get also details such the default gateway, subnet mask or the state of the network adapter.
With the /all switch you will get a whole new level of detail: DNS information, the MAC (Media Access Control) (in the Physical Address field) and other information about each network component. Check out the picture below to see a sample of the combination of ipconfig command with the /all parameter.
It's worth mentioning that the ipconfig command allows you to perform certain operations, if you use the right parameter. For example the ipconfig /release and ipconfig /renew commands force your network adapter to drop and renew the current IP address. These parameters are useful in networks that use DHCP (Dynamic Host Configuration Protocol) to distribute IP addresses automatically. Basically your system gives up its current address and requests a new one from the DHCP server. This can be very useful in certain networking scenarios.
Finding Your Computer's MAC Address
Another way to obtain the MAC address is to use the getmac command. Just type getmac and press Enter, as shown below.
Testing the Connection to a Website or Network/Internet Location
To test your connection to a certain website or another network or Internet location, you can use the ping network command followed by a web-address or IP address. For example, if you want to check the connectivity to our website, without opening a web browser, type ping www.7tutorials.com and then press Enter.
This command allows you to use a quite useful parameter that enables you to ping the specified address until it's stopped manually: -t. For example, I typed ping -t 192.168.2.1. After a period I decided that I want to see some statistics and I used the keyboard combination CRTL + Break. This shows the averages for the ping commands run until then.
Finally I terminated the action by using the keyboard combination CTRL+C. This stopped the endless cycle of ping commands to the specified address.
Check Network Connections and Display Port Information
With the netstat command you will be able to see active network connections between your system and any other systems on your network or the Internet.
The -a parameter shows all connections and listening ports. A sample can be seen in the image below.
If you liked today's article, don't miss the next article from ours Command Prompt series. We will cover other useful commands which can be used in this tool. If you have any questions about this set of commands, don't hesitate to leave a comment.