Skip to main content

assigning ip address from dos command

More
20 years 8 months ago #2946 by tfs
Ahh, Sahirh just hates competition. :lol:

Thanks,

Tom
More
20 years 8 months ago #2947 by sahirh
Haha and there I was in the shoutbox wondering where you were so I could resume old clashes ! :) btw lets go off topic a sec -- have you used Windows Server 2003 ? If so, what are some of the new features that the everyday admin might benefit from.. I don't care to read the spin on their website... I just want to know if its worth converting a couple of 2k servs to 2003.

Sahir Hidayatullah.
Firewall.cx Staff - Associate Editor & Security Advisor
tftfotw.blogspot.com
More
20 years 8 months ago #2954 by Cheetah
Hi

Below is an article on this, with examples. :D

[code:1]

Cool Things to Do with Netsh
Change almost any network configuration setting with this powerful tool

The Netsh command is a powerful command-line tool for Windows Server 2003, Windows XP, and Windows 2000. Netsh is available in the Microsoft Windows 2000 Server Resource Kit and is standard in Windows 2003 and XP. Netsh lets you change almost any network configuration setting as well as document network configurations. You can use the command in a batch file or from its own command shell. Netsh has a useful Help system that you can access by adding /? to almost any of its subcommands. Here are 10 cool things that you can use Netsh to do.

10. Show TCP/IP settings—The command

netsh interface ip show config
shows the system's current TCP/IP configuration settings. You can see whether the system is using DHCP or static addressing as well as view the system's current IP address, subnet mask, gateway address, and DNS servers.

9. Change network configuration—Netsh can change the current network configuration. The command

netsh interface ip set
address "Local Area
Connection" static
192.168.0.10 255.255.255.0
192.168.0.254
sets the IP address of the system configuration Local Area Connection to 192.168.0.10, the subnet mask to 255.255.255.0, and the gateway address to 192.168.0.254. This use of Netsh comes in handy for laptops that must switch between static and dynamic addressed networks.

8. Use a dynamic DHCP assigned address—The command

netsh interface ip set
address "Local Area
Connection" dhcp
sets the IP address of the Local Area Connection system configuration to use DHCP addressing.

7. Change a DNS server address—When you change the system's IP address type, you almost always have to change the DNS server's address as well. The command

netsh interface ip set dns
"Local Area Connection"
static 192.168.0.2
configures the Local Area Connection to use a DNS server whose address is 192.168.0.2.

6. Dynamically assign the DNS server address—When you switch to dynamic DHCP addressing, you typically also want the DNS server address to be assigned dynamically. The command

netsh interface ip set dns
"Local Area Connection" dhcp
sets the Local Area Connection interface to use a DHCP-assigned DNS address.

5.Configure a WINS server—Netsh also lets you configure WINS servers. The following command configures a system's Local Area Connection interface to use a WINS server that has the IP address 192.168.100.3.

netsh interface ip set wins
"Local Area Connection"
static 192.168.100.3
4. Work with other interfaces—Netsh works with DHCP, Internet Authentication Service (IAS), and RAS interfaces as well as the local network interface. The command

netsh dhcp dump > dhcpcfg.dat
dumps the local DHCP server's configuration to the dhcpcfg.dat file. You can use this file in conjunction with Netsh to recreate the DHCP server.

3. Work with remote systems—One of Netsh's best hidden features is its ability to work with remote systems. The command

netsh set machine remotecomputer
sets the current computer to a different system on the network.

2. Save the current configuration—The Interface Dump subcommand saves your current network configuration and generates a script that you can use to regenerate the configuration. The command

netsh interface dump >
mycfg.dat
redirects the Dump command to the mycfg.dat file.

1. Restore network configuration—The Netsh Exec command runs a Netsh script file. The command

netsh exec mycfg.dat
restores to your system the network configuration data that the preceding sample command saved.

[/code:1]

Kind Regards,
<b>Cheetah</b>
<i>The outcome of devotion is, quality!</i>
More
20 years 7 months ago #3214 by VaViN
But this does not work on remote computers.
Any ideas? :?:
More
20 years 7 months ago #3219 by sahirh
If you need to change it on a remote computer, telnet or better ssh to the box and then run netsh.. if you dont have console level access I dont see how you're going to do it. Once again, what are you trying to do ?

Sahir Hidayatullah.
Firewall.cx Staff - Associate Editor & Security Advisor
tftfotw.blogspot.com
More
20 years 7 months ago #3221 by Cheetah
Hi

Have a look on sysinternal's PsTools at www.sysinternals.com/ntw2k/freeware/pstools.shtml . (Freeware)

There's an executable PsExec ( www.sysinternals.com/ntw2k/freeware/psexec.shtml ), which is part of PsTools.

Write a batch file with necessary 'netsh' commands and execute this using PsExec on the remote computer. I hope this helps.

Regards
Cheetah

Kind Regards,
<b>Cheetah</b>
<i>The outcome of devotion is, quality!</i>
Time to create page: 0.147 seconds