Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

OK - so we have run out of IP addresses in our current scope (provided by the LEA) and have got to move over to a whole new, wider scope as soon as the LEA can come up with it (several weeks of waiting so far).

 

Alll our client machines are DHCP so that side of it is pretty easy, and our dozen or so servers are all static and should be farily easy to update (all our scripts use names rather than IP addresses).

 

I have switched off the IP Addresses of all the Cisco kit we have (switches and wireless access points) - we can manage with console cables until we get a chance to reassign these.

 

Our external web addresses, router and proxy server are all controlled by the LEA so that is out of my hands.

 

So the only nightmare is the printers, which are all on reservations on the DHCP box with shared queues on one of the servers. I am resigned to the fact this is going to have to happen manually (unless anyone has any good ideas!).

 

Can anyone think of anything I might have forgotten to account for?

Posted
You can script DHCP reservations - I did this for our Wireless Access Points. Can dig out an example script if you want.
Posted

That script would be useful - if I can read out the reservations then I can at least read them back in with an easy cross-reference to the new scope easily.

 

Thanks

Posted

netsh dump > dhcpcfg.txt

 

Trim all the cruft out you don't care about. Search and replace with your favorite text editor to suit. Then on your new server:

 

netsh exec dhcpcfg.txt

Posted

This is the script that I used to add our new wireless access points. It's a cmd file which relies on two external text files for input - they should be saved in the same folder as the cmd file. The first (servers.txt) lists the IP addresses of your DHCP servers, because you'll want to make the reservations on all of them; we have two. The second (wapmacs.txt) lists the details of the objects for which you want to make a reservation. It will need to contain as tab separated values the IP address you want to reserve for the object, the MAC address of the object, the name of the object and (optionally) a description for the object.

 

@echo off

FOR /F %%b IN (%~dp0servers.txt) DO @call :perserver %%b

goto :EOF

:perserver

FOR /F "delims=," %%c IN (%~dp0WAPMACs.txt) DO call :listit %1 %%c
goto :EOF

:listit
echo %*
pause
echo %1 + %2 + %3 + %4
::netsh dhcp server %1 scope xx.xx.xxx.0 add reservedip %2 %3 %4
echo netsh dhcp server %1 scope xx.xx.xxx.0 add reservedip %2 %3 %4

pause
goto :EOF

 

NOTE: as it stands, this code will simply echo the parameters it finds and the netsh command it creates; it won't do anything, it's in test mode. To use it in anger you'll need to uncomment the netsh line and comment the echoes and pauses below :listit. Use it at your own risk - I won't be responsible for consequences.

 

Examples of the content of the accompanying files:

 

WAPMACS.txt

xxx.xxx.xxx.105	00156CD656B0	WirelessAP29 	"Wireless Access Point"
xxx.xxx.xxx.106	00156CD656B1	WirelessAP30 	"Wireless Access Point"
xxx.xxx.xxx.107	00156CD656B2	WirelessAP31 	"Wireless Access Point"

 

servers.txt

xx.xx.xxx.14
xx.xx.xxx.15

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...