Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running an Ubuntu server having 255 IP addresses. I want to write down a PHP script that uses each IP to do a curl request. Is this possible ?

share|improve this question
late but why do you have a /24 on 1 Server??? – Jacob Feb 13 '11 at 23:12
up vote 4 down vote accepted

Depends on the nature of the networking as far as your server is concerned, and what it would be connecting to.

In most cases, you'll lose two addresses out of a full 256 octet - one for the network address ( and one for the broadcast address ( Remember that you'll also need a router in the same local subnet (, so you're down to 253. (Assuming this is a CIDR/24 network).

Curl has a --interface option - you can use this to specify which IP your request is coming from; you may want to consider writing in this in perl or something not web-oriented - might make it a bit easier.

Here's hoping you're not stuffing ballot boxes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.