Welcome to my site. Please CLICK HERE to give your opinions regarding this new look of "PCTipsbyAnu". Thanks for visiting.

Monday, July 5, 2010

Browse » Home » , , , , , , » TUT - How to change to Static IP via DOS - 4

TUT - How to change to Static IP via DOS - 4


Wanna to change IP via DOS..?

Here is a Full Featured Tutorial for doing that

To change to static IP:
------------------------------------------------------------ ----
This changes the IP address and Default Gateway:

netsh int ip set address "local area connection" static {192.168.0.101} 255.255.255.0 {192.168.0.254} 1
This changes DNS:
netsh int ip set dns "local area connection" static {192.168.0.254} primary
----------------------------------------------------------------
You will want to change the values between the curly braces, but do not use the curly braces when you run the command.
----------------------------------------------------------------
To change the interface back to DHCP (get IP automatically) use this command:

netsh int ip set address "local area connection" dhcp

DNS:

netsh int ip set dns "local area connection" dhcp
----------------------------------------------------------------

============================
I would recommend you view the help for this command, it will shed much more insight on what you're actually doing.
 

The netsh command allows you to change many things such the firewall configuration to the ip addresses.
You can get help for the netsh command by adding each word of the command and adding /?. For example:

=================================

C:\Documents and Settings\tiger>netsh /?
Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [Command | -f ScriptFile]

The following commands are available:

Commands in this context:
? - Displays a list of commands.
add - Adds a configuration entry to a list of entries.
bridge - Changes to the `netsh bridge' context.
delete - Deletes a configuration entry from a list of entries.
diag - Changes to the `netsh diag' context.
dump - Displays a configuration script.
exec - Runs a script file.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
interface - Changes to the `netsh interface' context.
ras - Changes to the `netsh ras' context.
routing - Changes to the `netsh routing' context.
set - Updates configuration settings.
show - Displays information.
winsock - Changes to the `netsh winsock' context.

The following sub-contexts are available:

bridge 
diag 
firewall 
interface 
ras 
routing 
winsock

To view help for a command, type the command, followed by a space, and then type ?.

=================================

C:\Documents and Settings\tiger>netsh int /?

The following commands are available:

Commands in this context:

? - Displays a list of commands.
add - Adds a configuration entry to a table.
delete - Deletes a configuration entry from a table.
dump - Displays a configuration script.
help - Displays a list of commands.
ip - Changes to the `netsh interface ip' context.
ipv6 - Changes to the `netsh interface ipv6' context.
portproxy - Changes to the `netsh interface portproxy' context.
reset - Resets information.
set - Sets configuration information.
show - Displays information.
The following sub-contexts are available:
ip 
ipv6 
portproxy

To view help for a command, type the command, followed by a space, and then type ?.

=================================
C:\Documents and Settings\tiger#netsh int ip /?

The following commands are available:

Commands in this context:

? - Displays a list of commands.
add - Adds a configuration entry to a table.
delete - Deletes a configuration entry from a table.
dump - Displays a configuration script.
help - Displays a list of commands.
reset - Resets TCP/IP and related components to a clean state.
set - Sets configuration information.
show - Displays information.
 
To view help for a command, type the command, followed by a space, and then type ?.

=================================
C:\Documents and Settings\tiger#netsh int ip set /?

The following commands are available:

Commands in this context:
set address - Sets the IP address or default gateway to the specified interface.
set dns - Sets DNS server mode and addresses.
set wins - Sets WINS server mode and addresses.

=================================

C:\Documents and Settings\tiger#netsh int ip set address /?

Usage: set address [name=]
[[source=]dhcp |
[source=] static [addr=]IP address [mask=]IP subnet mask] [[gateway=]
|none [gwmetric=]integer]
Parameters:

Tag Value
name - The name of the interface.
source - One of the following values:
dhcp : Sets DHCP as the source for configuring IP addresses for the specific interface.
static : Sets the source for configuring IP addresses to local static configuration.


gateway - One of the following values:
: A specific default gateway for the static IP address you are setting.
none : No default gateways are set.
gwmetric - The metric for the default gateway. This field should
not be set if gateway is set to
'none'.
 

The following options are used only if source is 'static':

addr - An IP address for the specified interface.
mask - The subnet mask for the specified IP address.


Remarks: Used to change the IP address configuration mode from either DHCP to static mode or static mode to DHCP. Adds IP addresses on an interface with static IP address or adds default gateways.

Examples:

set address name="Local Area Connection" source=dhcp
set address local static 10.0.0.9 255.0.0.0 10.0.0.1 1


C:\Documents and Settings\tiger#
=================================

If you ever mess up the configuration you can always modify the settings through the graphical interface of the control panel. From Start - Control Panel - Switch to Classic View, and open Network Connections

Before running these commands, look at your existing (working) IP configuration with the ipconfig command: 


This will show you the Default Gateway and DNS entries to put in the commands above where the {braces} are.
================================

C:\Documents and Settings\tiger#ipconfig /all

Windows IP Configuration

Host Name . . . . . . . . . . . . : computar
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) PRO/1000 XT Server Adapter
Physical Address. . . . . . . . . : 00-02-B3-B5-D6-J3
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.0.101
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.2
DNS Servers . . . . . . . . . . . : 192.168.0.2

C:\Documents and Settings\tiger#
================================
You can leave a response, or trackback from your own site.

About 'Anu': My name is 'Anu' also Known as 'ANU 007 TIGER' .I'm administrator of 'PC Tips by Anu' blog .This blog was opened for sharing contents about hacking n cracking.
Thanks YAHOO OR GMAIL

1 comments:

Tough Shed said...

This is cool! And so interested! Are u have more posts like this? Plese tell me, thanks

Post a Comment

 
Back to Top