?
Solved

editing registry dhcp/ip-address

Posted on 2003-03-17
7
Medium Priority
?
733 Views
Last Modified: 2010-05-18
I want to switch my nic's properties from dhcp to given ip-address and vice-versa!

I thought of editing the registry:
what I did when switching from dhcp to fixed ip:
---cut---
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{My Nic's ID}\Parameters\Tcpip]
"EnableDHCP"=dword:00000000
"IPAddress"=hex(7):31,00,30,00,2e,00,30,00,2e,00,30,00,2e,00,31,00,30,00,30,00,00,00,00,00
"SubnetMask"=hex(7):32,00,35,00,35,00,2e,00,32,00,35,00,35,00,2e,00,32,00,35,00,35,00,2e,00,30,00,00,00,00,00
"DefaultGateway"=hex(7):00,00
"DhcpServer"="255.255.255.255"
"DhcpIPAddress"=-
"DhcpSubnetMask"=-
"DhcpDefaultGateway"=-
"DhcpNameserver"=-
"DhcpDomain"=-
"DhcpSubnetMaskOpt"=-

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"DhcpNameServer"=-
"DhcpDomain"=-
---cut---

what I did when switching from fixed ip to dhcp:
---cut---
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{My Nic's ID}\Parameters\Tcpip]
"EnableDHCP"=dword:00000001
"IPAddress"=hex(7):30,00,2e,00,30,00,2e,00,30,00,2e,00,30,00,00,00,00,00
"SubnetMask"=hex(7):30,00,2e,00,30,00,2e,00,30,00,2e,00,30,00,00,00,00,00
"DefaultGateway"=hex(7):00,00
"DhcpIPAddress"=-
"DhcpSubnetMask"=-
"DhcpServer"=-
---cut---

my problem - the nic does not recognize the change!
I see the changes in the registry, but the nic's properties haven't change!

how can I do this?

thanks
michi
0
Comment
Question by:witty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 2

Expert Comment

by:somchaiu
ID: 8157358
Why you cannot change TCP/IP settings in control panel?
0
 
LVL 1

Author Comment

by:witty
ID: 8158162
I can ;-) but not the users, this solution would be for!!!

thx
michi
0
 
LVL 2

Expert Comment

by:somchaiu
ID: 8158395
You should use the DHCP on client, and manually assign IP address on DHCP server console.
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 7

Expert Comment

by:YarnoSG
ID: 8158689
There is a command prompt command to do what you are attempting:  not only does it make the change, but it re-initialises the settings:  
NETSH  
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/server/netsh.asp

I would familiarize myself with it and write some batch files to turn dhcp on and off.

HTH
-Steven Yarnot
http://yarnosg.home.insightbb.com
0
 
LVL 10

Accepted Solution

by:
ryangorman earned 1000 total points
ID: 8170885
I agree with YarnoSG - NETSH is the way to go (W2K/XP). However, you may need local Admin access to run it.

rem Force DHCP
netsh int ip delete wins lan all
netsh int ip delete dns lan all
netsh int ip set address lan dhcp

rem Force a Static IP
netsh int ip delete wins lan all
netsh int ip delete dns lan all
netsh int ip set address lan static 192.168.1.1 255.255.255.0 192.168.1.254 1
netsh int ip add dns lan 195.92.195.94
netsh int ip add wins lan 192.168.1.20
0
 
LVL 1

Author Comment

by:witty
ID: 8170912
exactly what I needed!!!
what is the last paramter (gwetric) for?

thx michi
0
 
LVL 10

Expert Comment

by:ryangorman
ID: 8175980
Gwmetric is Gateway Metric. It concerns router hops. Just accept that 1 is a good number (as in the right hand column below).

C:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x1000003 ...00 d0 59 33 c1 01 ...... Intel 8255x-based Integrated Fast Etherne

===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0   192.168.100.19  192.168.100.134      1
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
    192.168.100.0    255.255.255.0  192.168.100.134  192.168.100.134      1
  192.168.100.134  255.255.255.255        127.0.0.1       127.0.0.1       1
  192.168.100.255  255.255.255.255  192.168.100.134  192.168.100.134      1
        224.0.0.0        224.0.0.0  192.168.100.134  192.168.100.134      1
  255.255.255.255  255.255.255.255  192.168.100.134  192.168.100.134      1
Default Gateway:    192.168.100.19
===========================================================================
Persistent Routes:
  None
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question