Today, lets start with basic terminal tutorial for changing Internet Protocol address or IP address of networked computers. Let’s assume we want to give our Windows based system an IP address of, a subnet mask of, a default gateway of, and a DNS server address of

In Windows:

It is possible to change or set IP address in windows machines  (Windows 8, windows 7, windows xp, etc.) fro command prompt. The commands for setting static IP address are:

netsh interface ipv4 set address “local area connection” static

netsh interface ipv set dnsservers “local area connection” static

These two commands will configure the Local Area Connection with a static IP, netmask, gateway, and DNS server.

In case, if we want our network setting to get IP address from a DHCP server, the command to do it are:

netsh interface ipv4 set address name=”local area connection” source=dhcp

netsh interface ipv4 set dnsservers name=”local area connection” source=dhcp

In Linux:

To change the IP settings in linux, we use the ifconfig command with few parameters. like

sudo ifconfig eth0 netmask

  • The interface that you want to change the IP for is eth0
  • The IP you want to give the interface is
  • The Subnet Mask you want to set for the interface is

To change the default gateway, we use

sudo route add default gw eth0