Click here to Skip to main content
Click here to Skip to main content

Windows Networking Overview - Part II Command Line Tools IPCONFIG

, 10 Aug 2006 CPOL
Rate this:
Please Sign up or sign in to vote.
Provides a basic introduction to using IPCONFIG on the command line to work with your local area connection network adapters.

Introduction

Based upon the votes and the comments I've been receiving so far I need to address something up front in this series. This entire article series is not source code related and if you are expecting source code you won't find it. Comments so far are suggesting that this article does not belong here. I'd like to address that by saying that if you are developer writing code that will work across networks then these articles might be valuable to you. If your systems are not configured properly the best code in the world won't run right. So consider these articles prerequesite articles that should be read before starting a project where your code is intended to work across networks.

I've written a series of articles to provide developers with a broad amount of information that covers general networking topics. In this series I'll be discussing:

I had originally intended this to be a single article but it has grown to be much to large to be a single article. I also think that breaking it up into topics does a better job of granulating the information and makes it easier for readers to ask specific questions that will flow together in the reader comments area. If it's possible I'd like to have the above bulleted list link to all the articles so that readers may jump around from one topic to the other.

I'll be including this information in each relevant section but right up front I'd like to group this information for the convenience of the reader. I'm going to take the approach that you are brand new to networking and need the information presented in a way that flows smoothly from one topic to the next. Please understand this is not a simple topic. Networking is a black art and I mean that seriously. If you intend to fully understand networks and become proficient in them at a basic-working-level you will invest several hours to do so. Expect to make mistakes and expect it to be slow going at first. That's the nature of the topic.

As you read through this feel free to request an article on other topics in networking or feel free to ask me to add to a current section and drive it a bit deeper. I'm open to improving anything you see here and adding more content will just add value to the entire project.

From the top I'd start by reading TCP/IP Networking in Class C Subnets. I'd read it a few times so that you have the core down. I'd immediately move to Command Line Tools - IPCONFIG as it will provide an extra level of visibility to what was discussed in TCP/IP Networking in Class C Subnets. Even though it's the most difficult topic I've written on so far I'd recommend Adding Wireless Routers to Existing Networks next. It will force you to apply everything else I have discussed and it will do so in such a way that you will utterly understand it all by the time you have done it a few times. Even though many people have no need to know about Internet Connection Sharing (ICS) I think it's the next logical choice in progression. It will help you to understand networking landscapes a bit more and drive depth in your basic knowledge. I save the most practical for closest to the end because Sharing Files, Printers and Other Network Resource plagues almost every network I've ever seen. It's the most necessary aspect of networking for users and it can be one of the hardest to troubleshoot. You will need the knowledge gained from all the other articles to troubleshoot any problems you may have in Sharing Files, Printers and other Resources. As a final topic I'll briefly delve into VPN but it's a bit like trying to fit the ocean into a 1 gallon jug. Virtual Private Networking (VPN) is vast and enormous in scope and the security liability is enormous if you screw up.

That just about covers it. Now it's time to dive in. I hope you enjoy the material and feel free to ask further questions in the comments area.

Prerequisites

I've spent the last 8 years of my life fighting Class C subnets in Windows, Linux and MAC environments. To be honest networking is like black magic. Some people understand it and many never will. I think the reason for this is fear that you can break something. This is a valid fear. If you hose your TCP/IP stack you are in big trouble. If you are reading this article and are new to networking I'd suggest all of the following to guarantee you learn what you need and don't destroy your own PC's and network in the process.

  • If you have an extra PC to play with perfect make sure you are fine to trash it and reload it if necessary.
  • Before getting started I recommend downloading a product like Acronis True Image and making a full backup of your system. (Please verify the backup image.)
  • If you are going to play with a router that currently works please export/download it's firmware settings as a safe backup.
  • Please write down every setting you change and in what order. It's very easy to go backwards when you take good notes as you go.

Command Line Tools - IPCONFIG

IPCONFIG

IPCONFIG is a tool that is built into Windows 2000 and Windows 2003/XP products. It's primary use is for viewing network adapter settings. In this context we will show how IPCONFIG can be used to view settings, release settings and renew settings in a DHCP (Dynamic Host Configuration Protocol) context.

To open a command window in Windows 2000/XP simply go to the [Start] menu in the lower left hand corner of your display, click on it and select run in the menu that pops up. In the new dialog please type cmd and click Ok.

In some of the message boards you go to for help you might be asked to copy and paste the contents of a command window into a thread. To do this in Windows XP/2000 right-mouse-click in the command window area and 'Select All' then hit the enter key. This will place the contents of the window onto the system clipboard where it can be handily pasted into any text accepting field or document.

View: It is often nice to know exactly what one's settings are in order to know how to go about fixing them. To do this please type ipconfig at the prompt and hit enter. Your output will look something like this.

Microsoft Windows XP [Version 5.1.2600]
  (C) Copyright 1985-2001 Microsoft Corp.</p>
C:\>ipconfig</p>
Windows IP Configuration

Ethernet adapter Local Area Connection:</p>
<code>Connection-specific DNS Suffix . :

  IP Address. . . . . . . . . . . . : 192.168.0.5
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Default Gateway . . . . . . . . . : 192.168.0.1</p>
C:\</p>

IPCONFIG /RELEASE

It is sometimes necessary when using DHCP to manually release your IP adapter settings so that they are cleared from the TCP/IP stack. To do this please type ipconfig /release at the prompt and hit enter. Your output will look something like this.

Microsoft Windows XP [Version 5.1.2600]

  (C) Copyright 1985-2001 Microsoft Corp.</p>C:\ipconfig /release</p>Windows IP Configuration</p>Ethernet adapter Local Area Connection:</p>Connection-specific DNS Suffix . :

  IP Address. . . . . . . . . . . . : 0.0.0.0
  Subnet Mask . . . . . . . . . . . : 0.0.0.0
  Default Gateway . . . . . . . . . : 0.0.0.0

C:\</p>

IPCONFIG /RENEW

Anytime you have issued an ipconfig /release to release your network adapter settings you will need to issue a similar command to obtain fresh network adapter settings from the local DHCP server on your network. To do this please type ipconfig /renew at the prompt and hit enter. Your output will look something like this.

Microsoft Windows XP [Version 5.1.2600]

  (C) Copyright 1985-2001 Microsoft Corp.</p>C:\ipconfig /renew</p>Windows IP Configuration</p>Ethernet adapter Local Area Connection:</p>Connection-specific DNS Suffix . :

  IP Address. . . . . . . . . . . . : 192.168.0.5
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Default Gateway . . . . . . . . . : 192.168.0.1

C:\

IPCONFIG /ALL

IPCONFIG also has the ability to show us all the known information about all network adapter configurations currently defined on your machine. For example a laptop may have a Local Area Connection a Wireless Network Connection and in some cases even a Virtual Adapter Connection. There is a way to view all settings at once and to also see other helpful information about your installed network adapters. To do this please type ipconfig /all at the prompt and hit enter. Your output will look something like this.

Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.</p>
  
  C:\ipconfig /all</p>Windows 
  
  IP Configuration</p>  Host Name . . . . . . . . . . . . : codefrog                           // This is the user-friendly name of your PC.
  Primary Dns Suffix . . . . . . .  : Code-Frog.local                    // This is the domain or workgroup you are on.
  Node Type . . . . . . . . . . . . : Broadcast                          // This is beyond the scope of this document.
  IP Routing Enabled. . . . . . . . : No                                 // This is beyond the scope of this document.
  WINS Proxy Enabled. . . . . . . . : No                                 // This is beyond the scope of this document.
  DNS Suffix Search List. . . . . . : Code-Frog.local                    // This is beyond the scope of this document.</p>
  Ethernet adapter Wireless Network Connection:

  Connection-specific DNS Suffix .  :
  Description . . . . . . . . . . . : Wireless-G Notebook Adapter // Like it says, it's a description.
  Physical Address. . . . . . . . . : 00-06-25-41-05-AC           // Frequently referred to as your MAC addres.
  Dhcp Enabled. . . . . . . . . . . : Yes                         // This is what allows us to get an IP address using ipconfig /renew.
  Autoconfiguration Enabled . . . . : Yes
  IP Address. . . . . . . . . . . . : 192.168.0.6                 // Unique identifier, more reliable than user-friendly name.
  Subnet Mask . . . . . . . . . . . : 255.255.255.0               // This is beyond the scope of this document.
  Default Gateway . . . . . . . . . : 192.168.0.1                 // This is the IP address of our ICS Gateway.
  DHCP Server . . . . . . . . . . . : 192.168.0.1                 // This is the IP address of our DHCP server and in this case ICS Gateway.
  DNS Servers . . . . . . . . . . . : 192.168.0.1                 // This is what allows http://www.google.com to work instead of numbers.
  24.116.39.12
  24.116.0.202

  Lease Obtained. . . . . . . . . . : Friday, June 25, 2004 7:13:32 PM
  Lease Expires . . . . . . . . . . : Friday, July 02, 2004 5:52:32 PM</p><code>Ethernet adapter Local Area Connection:
  
  Media State . . . . . . . . . . . : Media disconnected
  Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Ethernet NIC
  Physical Address. . . . . . . . . : 00-02-3F-80-CB-04</p>Ethernet adapter SonicWALL Virtual Adapter:

  Connection-specific DNS Suffix .  :
  Description . . . . . . . . . . . : SonicWALL VPN Adapter
  Physical Address. . . . . . . . . : 00-60-73-E3-A0-39
  Dhcp Enabled. . . . . . . . . . . : Yes
  Autoconfiguration Enabled . . . . : No
  IP Address. . . . . . . . . . . . : 223.1.1.128
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Default Gateway . . . . . . . . . :
  DHCP Server . . . . . . . . . . . : 223.1.1.2

  Lease Obtained. . . . . . . . . . : Friday, June 25, 2004 7:13:35 PM
  Lease Expires . . . . . . . . . . : Saturday, June 25, 2005 7:13:35 PM

</p>C:\

 

History

August 10th, 2006. First release.

August 11th, 2006. Added more information in introduction to address claims that the articles do not belong on CodeProject.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

code-frog

United States United States
No Biography provided

Comments and Discussions

 
QuestionSAP R/3 PinmemberMomcilo26-Nov-06 11:39 
AnswerRe: SAP R/3 Pinmembercode-frog26-Nov-06 11:55 
Generalformatting (again) PinmemberRage20-Aug-06 23:53 
GeneralMissed PinmemberS Douglas11-Aug-06 13:58 
GeneralRe: Missed Pinmembercode-frog11-Aug-06 14:07 
GeneralRe: Missed Pinmembercode-frog11-Aug-06 17:04 
GeneralRe: Missed PinmemberS Douglas13-Aug-06 1:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1411023.1 | Last Updated 11 Aug 2006
Article Copyright 2006 by code-frog
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid