1

Suppose that I am in a LAN with the following parameters:

IP:      172.16.20.X
NETMASK: 255.255.252.0
GATEWAY: 172.16.20.1
DNS:     172.16.20.1

In order to connect to my LAN, I have to find, quickly, the first IP available, this means find a value for X which is NOT ALREADY TAKEN by another user of the same LAN.

Which method do you suggest to use?

Assumption: I am using WINDOWS 7 Operating System.

11
  • 2
    This is normally done by the DHCP server. Is there some reason you can't use DHCP?
    – Flimzy
    Jun 30, 2011 at 8:45
  • 2
    I would post a question about fixing DHCP then :)
    – Flimzy
    Jun 30, 2011 at 8:55
  • 1
    Then ask your system administrator which static IP you should use.
    – Flimzy
    Jun 30, 2011 at 8:59
  • 1
    The problem with that approach is that to send a ping, you have to already have an IP address that works.
    – Flimzy
    Jun 30, 2011 at 9:01
  • 1
    Short of re-inventing DHCP, there's really not an automatic way. I think you're stuck with trial-and-error until your admin returns to fix your DHCP server.
    – Flimzy
    Jun 30, 2011 at 9:04

5 Answers 5

2

As per our discussion in comments, this is normally done via DHCP. But since you say DHCP isn't working, and your administrator is on vacation, I'm afraid you'll be stuck with some trial and error, as you've already been doing. My advice is to find an IP that works, and keep it, until your admin returns to fix DHCP and/or to assign you a permanent static IP.

4
  • OK, accepted answer. I am stupidly trying to reinvent DHCP ;-) Jun 30, 2011 at 9:08
  • 1
    for a temp solution, nmap -sP 172.16.20.0/22 | grep scan and pick an unused number
    – Sirex
    Jun 30, 2011 at 11:48
  • 'nmap' is not recognized as an internal or external command, operable program or batch file. Jun 30, 2011 at 14:18
  • Assumption: I am using WINDOWS 7 Operating System. Jun 30, 2011 at 14:18
2

Well, that's the whole point of DHCP - which is what you should be using. Considering there's a gateway and presumably a network. Else, its pretty much trying IP addresses till one sticks.

After all, standards are around so we don't have to reinvent things in new, and painful ways.

2
  • Ok, but please describe a method you would use in case of DHCP not working. Jun 30, 2011 at 8:56
  • 2
    pick a random number between 2 and 255. I'd suggest something in the middle - people tend to pick high or low numbers.
    – Journeyman Geek
    Jun 30, 2011 at 9:05
2

So quickly find a static ip available, use colasoft's free mac address scanner.

To scan a subnet outside your local one, use lizard systems network scanner or nmap.

1

Use network inventory advisor trial version or perhaps newt trial version, run a scan of the IP range and whichever IP addresses don't respond - you'll have a good chance that that IP address is not taken :)

1

Again, everyone is right that you should use DHCP if it is available, but since you asked, here is the range you have available for hosts on that network: 172.16.20.1-172.16.23.254. If you do have to, just find a machine that already has an IP address, and ping something in middle. You are bound to hit a free IP address with 1022 potential host IP addresses on the subnet.

http://www.subnet-calculator.com/subnet.php?net_class=B

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .