How to Assign Static IP Address From Command Prompt

No device can communicate over a network without a valid IP address. Usually DHCP server is providing Internet Protocol address to computers connected to the network. However, in certain cases we must assign static IP address to a PC by our self. There are different ways to assign it to a PC but the easiest method is DOS method. There is a DOS prompt command to set static IP address on a Windows computer. This tutorial explains how to configure static IP address from Command Prompt and explain the procedure with a practical example. At the end of this tutorial, you can see how to perform same procedure in MAC.


Steps to Assign Static IP To Any Interface From Command Prompt
  1. Start MS DOS as Administrator

    You must start command prompt as administrator to set static Internet Protocol number on your computer from command prompt. On Start menu, right click on cmd and click run as administrator. To learn more about it, visit the link below.
    Run DOS As Administrator

  2. Type the following command on DOS window.

    netsh interface ip set address name="[Interface Name]" static [IP Address] [Subnet Mask] [Default Gateway]

  3. Press Enter

This is the theoretical explanation of configuring logical address on a laptop without the help of DHCP server. Now let us check a practical example to learn it.

Practical Explanation

Here I am going to assign Permanent logical number 192.168.42.1 to my computer with default gateway 192.168.42.129 and subnet mask 255.255.255.0
  1. Check current Addressing using ipconfig

    Here make note of the current default gateway and most importantly the Interface name.
    assign

  2. Type the command

    netsh interface ip set address name="Local Area Connection 2" static 192.168.42.1 255.255.255.0 192.168.42.129 and press enter.

  3. Check the current addressing with the command ipconfig
    Show

How to Release Static IP From Command Prompt

You cannot release and renew static IP by using ipconfig/release. There is another DOS Prompt command to release static IP address set on a computer. To learn more about it, visit the link below.
Configure Automatic Logical Addressing From Command Prompt


How to Assign Static IP on MAC OS
  1. Click the Apple menu(upper right-hand corner of the screen)


  2. From the menu select System Preferences


  3. On System Preferences window click on Network


  4. On the Network select the following

    Location = Automatic
    Show     =  Built-in Ethernet


  5. Select manual option for Configure IPv4

Now you can enter the logical number you want to assign for this MAC. After entering the details click on Apply Now button to save the settings.


Related Topics
  1. How to Activate Disabled Adapter on your computer

  2. How to Track a Chat User and find location

  3. How to Use Netstat Command

New Topics

1 comment:

SPM said...

Just don't forget, if you mentioned GW in syntax, you should also fill in [metric] parameter!!