Home Search First Look Rules Help TheDaddy.org BlogLogin/Register
By bye hackers
Non-Persistent IP Addresse in Windows - 1 to 11
Return To Techy Corner

Agentgonzo
There's no pee in catheter!
Wed 8th Apr '09 6:02PM
811 Posts
Agentgonzo's Avatar
Member Since
8th Aug '06
Does anyone know how to set up a static (but temporary) IP address on a windows machine (XP and 2003) that will be applied for as long as the machine is running, but be cleared on the next boot?
  

Epicure_mammon
I'm not crazy cause I take the RIGHT pills :)
Thu 9th Apr '09 8:26AM
140 Posts
Epicure_mammon's Avatar
Member Since
12th Dec '06
I'm not sure this is something you can do easily. What are you trying to achieve? (I'm fascinated by why you'd want to do this )
  

Agentgonzo
There's no pee in catheter!
Thu 9th Apr '09 10:28AM
811 Posts
Agentgonzo's Avatar
Member Since
8th Aug '06


Epicure_mammon was bold enough to comment:
I'm not sure this is something you can do easily. What are you trying to achieve? (I'm fascinated by why you'd want to do this )


In short, a massively (ie, >1600 computers) reconfigurable system, whereby each machine will alias on additional IP addresses (along with it's 'base' IP address) depending on the configuration. At reboot (resetting the system), I want the computer to have *only* the 'base' address assigned to it and to lose all the other IP addresses. At each reconfiguration, the pool of aliased on IP addresses change to other machines depending on the configuration of the system at that time. All IP address-machine combinations are known and derived from the system configuration (which can change up to twice a day).

It's really simple to do this in linux (some distros at least, I don't know if it works this way for all of them or not) with ifconfig. The changes are made, but upon reboot, the system reverts to how it was set up before.
  

Amanshu*
Giggity Giggity goo
Tue 14th Apr '09 12:25PM
2708 Posts
Amanshu's Avatar
Member Since
25th Aug '04
I think you'd probably have to create some sort of batch file to run at either shutdown or startup. You can set it as a group policy - something along the lines of 'Local Computer\Windows Settings\scripts\Startup/Shutdown'.

I've got a vague feeling that it might be possible to add it as a scheduled task as well, but if you're looking at >1600 you probably want to go the group policy route...

Of course that means it'll happen everytime a machine is rebooted, I assume that's not an issue?
   

Agentgonzo
There's no pee in catheter!
Wed 15th Apr '09 10:00AM
811 Posts
Agentgonzo's Avatar
Member Since
8th Aug '06


Amanshu was bold enough to comment:
I think you'd probably have to create some sort of batch file to run at either shutdown or startup. You can set it as a group policy - something along the lines of 'Local Computer\Windows Settings\scripts\Startup/Shutdown'.

I've got a vague feeling that it might be possible to add it as a scheduled task as well, but if you're looking at >1600 you probably want to go the group policy route...

Of course that means it'll happen everytime a machine is rebooted, I assume that's not an issue?


The script with the group policy is the way that we're going already. I was just after another route as the shutdown script won't run in the event of BSOD/power-cut etc (when the machine doesn't do a clean shutdown). I don't think it's possible, which is pesky.
  

Amanshu*
Giggity Giggity goo
Wed 15th Apr '09 6:28PM
2708 Posts
Amanshu's Avatar
Member Since
25th Aug '04
Wouldn't it make more sense to run it as a startup script? As you say in event of total failure it won't run, but I assume you always start them up gracefully. In fact I'd be interested to know how you'd start them up non-gracefully!

Or would a startup script run too late? After the network connections have already been setup for instance?
   

Agentgonzo
There's no pee in catheter!
Thu 16th Apr '09 10:07AM
811 Posts
Agentgonzo's Avatar
Member Since
8th Aug '06


Amanshu was bold enough to comment:
Wouldn't it make more sense to run it as a startup script? As you say in event of total failure it won't run, but I assume you always start them up gracefully. In fact I'd be interested to know how you'd start them up non-gracefully!

Or would a startup script run too late? After the network connections have already been setup for instance?


A startup 'script' will only run at logon. A service will start before logon, but still some time after network initialisation and as soon as network initialisation occurs, you get IP conflicts which Windows doesn't handle well. That's how we're running it currently (service clears IP addresses at startup, but even that's too late)
  

Amanshu*
Giggity Giggity goo
Thu 16th Apr '09 11:18AM
2708 Posts
Amanshu's Avatar
Member Since
25th Aug '04
In which case, why don't you try setting the network services to manual startup and then get your service to start the network services after it's reset the ip addresses?
   

Agentgonzo
There's no pee in catheter!
Thu 16th Apr '09 11:43AM
811 Posts
Agentgonzo's Avatar
Member Since
8th Aug '06


Amanshu was bold enough to comment:
In which case, why don't you try setting the network services to manual startup and then get your service to start the network services after it's reset the ip addresses?


Interesting. Possible, but I'm sure that will have other pitfalls. Though it uses DNS to determine what it's own IP address should be, so we may end up with a chicken-egg situation. Worth looking at though
  

Epicure_mammon
I'm not crazy cause I take the RIGHT pills :)
Thu 23rd Apr '09 3:39PM
140 Posts
Epicure_mammon's Avatar
Member Since
12th Dec '06
I can't help thinking that you might be looking at this backwards. Would it not make more sense to take an existing technology for configuring IP addresses on bootup and use that? The obvious example is DHCP. Now, there is not a DHCP server currently which does what you want (at least I don't think there is), however it would mean that you're not messing around with the OSs on the machines themselves to any great extent.

One thing I have seen done is, within the DHCP configuration, not type in any IP addresses or mac addreses at all and do all of the reservations against host names. The client machine includes the hostname in the DHCP request, the DHCP server then looks up in DNS what the IP address which matches that host name should be and then issues it. This means that the DNS records are automatically up to date. This is largely moot in an active directory environment as DNS registration sorts all that out, but in a unix environment it certainly makes administration easier. Could this be manipulated to meet your needs?

If it can't directly then it may well be worth putting in some development effort to customising an existing open source DHCP server. By using DHCP rather than a strange customisation of a client operating system then you're a lot less sensitive to odd requirements within the OS and any possible future OS migration.
  

Agentgonzo
There's no pee in catheter!
Mon 27th Apr '09 3:56PM
811 Posts
Agentgonzo's Avatar
Member Since
8th Aug '06


Epicure_mammon was bold enough to comment:
I can't help thinking that you might be looking at this backwards. Would it not make more sense to take an existing technology for configuring IP addresses on bootup and use that?


No, it wouldn't. The machines need to have a static base address, and can alias on a number of addresses (vis, more than one) onto the same NIC. DHCP clients do not have the facility to do this, and we're not planning on rewriting parts of the operating system to accomplish this. There are also many many other reasons (like not changing the underlying design of a massive project)
  

Bookmark With: Post to DiggDigg   Post to DeliciousDelicious   Post to RedditReddit   Post to FacebookFacebook   Post to StumbleuponStumbleupon
Return To Techy Corner

Time Zone is Greenwich Mean Time You are Visible
Html Tags are On Smileys are On
Anonymous Posting is Not AllowedSwoop is The Daddy