Sign in to follow this  
Followers 0
MadBoy

Idea required for IP changing issue

7 posts in this topic

#1 ·  Posted (edited)

Hello,

I need kind of put in the right direction on one problem. I have around 10 ips that are constantly being used by someone from my team. Those IP's are static ones. We often change ips on computers and there's always someone that chooses wrong ip address from those 10. So i was wondering if it's possible to write a script that would check if IP is taken or not (as in send some kind of broadcast packet????) and it the ip is taken go for next one. I am aware of set your address easly.

I don't need the whole script or anything. Just an idea where to go with this as i am not realy network guy that much :)

Thank you very much,

MadBoy

Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites



Just wondering if a static address pool (aka registered pools) would work for you?

Share this post


Link to post
Share on other sites

Maybe:

Ping("XX.XX.XX.X1")
If @error Then
    MsgBox("","The IP XX.XX.XX.X1 seems to be available. Taking it...",2)
;~  ============
;~  *set your IP address XX.XX.XX.X1 easily*
;~  ============
    Exit
Else
    MsgBox("","The IP XX.XX.XX.X1 seems to be taken. Moving to next",2)
EndIf

Ping("XX.XX.XX.X2")
If @error Then
    MsgBox("","The IP XX.XX.XX.X2 seems to be available. Taking it...",2)
;~  ============
;~  *set your IP address XX.XX.XX.X2 easily*
;~  ============
    Exit
Else
    MsgBox("","The IP XX.XX.XX.X2 seems to be taken. Moving to next",2)
EndIf

Ping("XX.XX.XX.X3")
If @error Then
    MsgBox("","The IP XX.XX.XX.X3 seems to be available. Taking it...",2)
;~  ===========
;~  *set your IP address XX.XX.XX.X3 easily*
;~  ============
    Exit
Else
    MsgBox("","The IP XX.XX.XX.X3 seems to be taken. Moving to next",2)
EndIf

Ping("XX.XX.XX.X4")
If @error Then
    MsgBox("","The IP XX.XX.XX.X4 seems to be available. Taking it...",2)
;~  ============
;~  *set your IP address XX.XX.XX.X4 easily*
;~  ============
    Exit
Else
    MsgBox("","The IP XX.XX.XX.X4 seems to be taken. Moving to next",2)
EndIf

Share this post


Link to post
Share on other sites

I have around 10 ips that are constantly being used by someone from my team. Those IP's are static ones. We often change ips on computers and there's always someone that chooses wrong ip address from those 10. So i was wondering if it's possible to write a script that would check if IP is taken or not (as in send some kind of broadcast packet????) and it the ip is taken go for next one.

It's called DHCP.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

If you don't mind...why are you changing addresses regularly? Do you put them in a fish bowl? No but seriously, why not use dhcp?

Share this post


Link to post
Share on other sites

I see nobody understand what i meant so i'll rephrase. I know what DHCP is and i know how to use it and yes this is solution. But i just simply don't want to do that (due to many circumstances). However those 12 ip's are registred IP's from my provider aka external IP's and not internal ones. I know about "netsh" and i will probably use it as a solution to set IP. That's also not what i am asking for. What i am asking for is that i have lets say around 20 PC's that are constantly reinstalled and 3 ppl working on them at same time. 6 of those 12 ips are taken all the time so i'm only left with 6. As it requires coordination between my guys to know what Ip's are currently in use and which aren't i wanted to make a script that would precheck if the IP is in USE by one of those 20Pc's and use the ones that are free. And now we get to the point where i need to know how to precheck if that IP is in use without setting IP on computer first. Hope this clears it up and i can get some nice answer :)

@Nahuel

I don't think Ping will work if you don't have IP set, so your script isn't what i am looking for.

Thank you for the answers so far :)


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0