If you’re like me and use a notebook frequently at home, you probably have it set up with wireless networking. Or, you might have run an Ethernet cable from a cable/dsl router.
If you’re using cable or DSL, or even connected via Ethernet at a university, you can use a router to protect your computer from access by others. The router gets the IP address from your Internet service provider. Then, it creates a local area network to which your computer belongs. The result: you can get to the Internet, responses can get back to you (because the router keeps track of your requests and responses to it, but computers on the "other side of the router" can not initiate connections to your computer — the IP address they see is the router’s!
My notebook is normally wired to my home network. If I want to take it to another room or outside, I’ll turn on the radio in it. Then, I’ll unplug the Ethernet cable and carry the notebook wherever I wanted to go.
Unfortunately, although we can actually make multiple connections to the network from one computer (usually one for the wired connection and one for the wireless), the computer still remembers which should be its "gateway" for talking to the network and the Internet.
When I do the sequence of steps I mentioned, my computer remembers that the local network and the Internet are accessed via my wired connection — even though I just unhooked the cable.
The best way to do it would be to unhook the Ethernet cable first, and then turn on the wireless card’s radio. That way, the computer will configure itself completely to the wireless interface.
The other way, when I forget to do the right thing, is to run a short .CMD file of commands. In the old DOS and early Windows days, this was called a Batch file (.BAT). Now, it’s a Command file (.CMD).
First, let’s look at the "ipconfig" command.
The ipconfig command runs in a Windows command window (Start > Run > cmd). As output, without any of the additional options, it shows the network adapters it found and some of the data about the, especially the IP Address, the Subnet Mask and the Default Gateway. Notice that the Default Gateway for both adapters is 10.47.15.1, which is the local network IP address of my wired router.
I created my "reset_ip.cmd" command file and put a shortcut to it on my desktop. I could store it anywhere, as long as I use the shortcut (and as long as the shortcut points to the right place).
ipconfig /release *
Just double-clicking on the icon runs the Command file. It releases all the IP addresses currently assigned on the computer. Then, it renews (creates) them. The Pause command is so that the window stays open so that I can confirm that the commannds were successful.
Let’s look at the what happens if I run this while both wired and wireless connections are live.
Notice how the connections were killed (and have zeroes as their data). At that point, I would have no ability to get to the network.
Now, notice that the renewed connections read exactly as they did before. When requesting an IP address, the operating system really says "please give me IP address ___.___.___.___ if it’s available, otherwise give me another one."
Finally, let’s see what happens when I run the same Command file after I unplug my wired connection. First, I’ll unplug the Ethernet cable. Then, when I try to contact the Internet (say with my web browser or email), I can’t. The computer remembered that the wired Ethernet card was route to get to the Gateway.
Notice that the Gateway IP address is still the same. But, now the computer knows that the wireless connection is its route to get to the Gateway.
My little Command file reset_ip.cmd easily restored my connection to the Internet.